000-linux_mips.patch 757 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704
  1. --- a/arch/mips/au1000/common/au1xxx_irqmap.c
  2. +++ b/arch/mips/au1000/common/au1xxx_irqmap.c
  3. @@ -172,14 +172,14 @@ au1xxx_irq_map_t au1xxx_ic0_map[] = {
  4. { AU1550_PSC1_INT, INTC_INT_HIGH_LEVEL, 0},
  5. { AU1550_PSC2_INT, INTC_INT_HIGH_LEVEL, 0},
  6. { AU1550_PSC3_INT, INTC_INT_HIGH_LEVEL, 0},
  7. - { AU1550_TOY_INT, INTC_INT_RISE_EDGE, 0 },
  8. - { AU1550_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
  9. - { AU1550_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
  10. - { AU1550_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 },
  11. - { AU1550_RTC_INT, INTC_INT_RISE_EDGE, 0 },
  12. - { AU1550_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
  13. - { AU1550_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
  14. - { AU1550_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 },
  15. + { AU1000_TOY_INT, INTC_INT_RISE_EDGE, 0 },
  16. + { AU1000_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
  17. + { AU1000_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
  18. + { AU1000_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 },
  19. + { AU1000_RTC_INT, INTC_INT_RISE_EDGE, 0 },
  20. + { AU1000_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
  21. + { AU1000_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
  22. + { AU1000_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 },
  23. { AU1550_NAND_INT, INTC_INT_RISE_EDGE, 0},
  24. { AU1550_USB_DEV_REQ_INT, INTC_INT_HIGH_LEVEL, 0 },
  25. { AU1550_USB_DEV_SUS_INT, INTC_INT_RISE_EDGE, 0 },
  26. @@ -200,14 +200,14 @@ au1xxx_irq_map_t au1xxx_ic0_map[] = {
  27. { AU1200_PSC1_INT, INTC_INT_HIGH_LEVEL, 0},
  28. { AU1200_AES_INT, INTC_INT_HIGH_LEVEL, 0},
  29. { AU1200_CAMERA_INT, INTC_INT_HIGH_LEVEL, 0},
  30. - { AU1200_TOY_INT, INTC_INT_RISE_EDGE, 0 },
  31. - { AU1200_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
  32. - { AU1200_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
  33. - { AU1200_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 },
  34. - { AU1200_RTC_INT, INTC_INT_RISE_EDGE, 0 },
  35. - { AU1200_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
  36. - { AU1200_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
  37. - { AU1200_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 },
  38. + { AU1000_TOY_INT, INTC_INT_RISE_EDGE, 0 },
  39. + { AU1000_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
  40. + { AU1000_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
  41. + { AU1000_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 },
  42. + { AU1000_RTC_INT, INTC_INT_RISE_EDGE, 0 },
  43. + { AU1000_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
  44. + { AU1000_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
  45. + { AU1000_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 },
  46. { AU1200_NAND_INT, INTC_INT_RISE_EDGE, 0},
  47. { AU1200_USB_INT, INTC_INT_HIGH_LEVEL, 0 },
  48. { AU1200_LCD_INT, INTC_INT_HIGH_LEVEL, 0},
  49. --- a/arch/mips/au1000/common/cputable.c
  50. +++ b/arch/mips/au1000/common/cputable.c
  51. @@ -39,7 +39,8 @@ struct cpu_spec cpu_specs[] = {
  52. { 0xffffffff, 0x02030203, "Au1100 BD", 0, 1 },
  53. { 0xffffffff, 0x02030204, "Au1100 BE", 0, 1 },
  54. { 0xffffffff, 0x03030200, "Au1550 AA", 0, 1 },
  55. - { 0xffffffff, 0x04030200, "Au1200 AA", 0, 1 },
  56. + { 0xffffffff, 0x04030200, "Au1200 AB", 0, 0 },
  57. + { 0xffffffff, 0x04030201, "Au1200 AC", 0, 0 },
  58. { 0x00000000, 0x00000000, "Unknown Au1xxx", 1, 0 },
  59. };
  60. --- a/arch/mips/au1000/common/dbdma.c
  61. +++ b/arch/mips/au1000/common/dbdma.c
  62. @@ -41,6 +41,8 @@
  63. #include <asm/au1xxx_dbdma.h>
  64. #include <asm/system.h>
  65. +#include <linux/module.h>
  66. +
  67. #if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
  68. /*
  69. @@ -60,37 +62,10 @@ static spinlock_t au1xxx_dbdma_spin_lock
  70. */
  71. #define ALIGN_ADDR(x, a) ((((u32)(x)) + (a-1)) & ~(a-1))
  72. -static volatile dbdma_global_t *dbdma_gptr = (dbdma_global_t *)DDMA_GLOBAL_BASE;
  73. -static int dbdma_initialized;
  74. +static dbdma_global_t *dbdma_gptr = (dbdma_global_t *)DDMA_GLOBAL_BASE;
  75. +static int dbdma_initialized=0;
  76. static void au1xxx_dbdma_init(void);
  77. -typedef struct dbdma_device_table {
  78. - u32 dev_id;
  79. - u32 dev_flags;
  80. - u32 dev_tsize;
  81. - u32 dev_devwidth;
  82. - u32 dev_physaddr; /* If FIFO */
  83. - u32 dev_intlevel;
  84. - u32 dev_intpolarity;
  85. -} dbdev_tab_t;
  86. -
  87. -typedef struct dbdma_chan_config {
  88. - u32 chan_flags;
  89. - u32 chan_index;
  90. - dbdev_tab_t *chan_src;
  91. - dbdev_tab_t *chan_dest;
  92. - au1x_dma_chan_t *chan_ptr;
  93. - au1x_ddma_desc_t *chan_desc_base;
  94. - au1x_ddma_desc_t *get_ptr, *put_ptr, *cur_ptr;
  95. - void *chan_callparam;
  96. - void (*chan_callback)(int, void *, struct pt_regs *);
  97. -} chan_tab_t;
  98. -
  99. -#define DEV_FLAGS_INUSE (1 << 0)
  100. -#define DEV_FLAGS_ANYUSE (1 << 1)
  101. -#define DEV_FLAGS_OUT (1 << 2)
  102. -#define DEV_FLAGS_IN (1 << 3)
  103. -
  104. static dbdev_tab_t dbdev_tab[] = {
  105. #ifdef CONFIG_SOC_AU1550
  106. /* UARTS */
  107. @@ -156,13 +131,13 @@ static dbdev_tab_t dbdev_tab[] = {
  108. { DSCR_CMD0_MAE_BOTH, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
  109. { DSCR_CMD0_LCD, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
  110. - { DSCR_CMD0_SDMS_TX0, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 },
  111. - { DSCR_CMD0_SDMS_RX0, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 },
  112. - { DSCR_CMD0_SDMS_TX1, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 },
  113. - { DSCR_CMD0_SDMS_RX1, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 },
  114. + { DSCR_CMD0_SDMS_TX0, DEV_FLAGS_OUT, 4, 8, 0x10600000, 0, 0 },
  115. + { DSCR_CMD0_SDMS_RX0, DEV_FLAGS_IN, 4, 8, 0x10600004, 0, 0 },
  116. + { DSCR_CMD0_SDMS_TX1, DEV_FLAGS_OUT, 4, 8, 0x10680000, 0, 0 },
  117. + { DSCR_CMD0_SDMS_RX1, DEV_FLAGS_IN, 4, 8, 0x10680004, 0, 0 },
  118. - { DSCR_CMD0_AES_TX, DEV_FLAGS_OUT, 0, 0, 0x00000000, 0, 0 },
  119. - { DSCR_CMD0_AES_RX, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 },
  120. + { DSCR_CMD0_AES_RX, DEV_FLAGS_IN , 4, 32, 0x10300008, 0, 0 },
  121. + { DSCR_CMD0_AES_TX, DEV_FLAGS_OUT, 4, 32, 0x10300004, 0, 0 },
  122. { DSCR_CMD0_PSC0_TX, DEV_FLAGS_OUT, 0, 0, 0x11a0001c, 0, 0 },
  123. { DSCR_CMD0_PSC0_RX, DEV_FLAGS_IN, 0, 0, 0x11a0001c, 0, 0 },
  124. @@ -172,9 +147,9 @@ static dbdev_tab_t dbdev_tab[] = {
  125. { DSCR_CMD0_PSC1_RX, DEV_FLAGS_IN, 0, 0, 0x11b0001c, 0, 0 },
  126. { DSCR_CMD0_PSC1_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
  127. - { DSCR_CMD0_CIM_RXA, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 },
  128. - { DSCR_CMD0_CIM_RXB, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 },
  129. - { DSCR_CMD0_CIM_RXC, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 },
  130. + { DSCR_CMD0_CIM_RXA, DEV_FLAGS_IN, 0, 32, 0x14004020, 0, 0 },
  131. + { DSCR_CMD0_CIM_RXB, DEV_FLAGS_IN, 0, 32, 0x14004040, 0, 0 },
  132. + { DSCR_CMD0_CIM_RXC, DEV_FLAGS_IN, 0, 32, 0x14004060, 0, 0 },
  133. { DSCR_CMD0_CIM_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
  134. { DSCR_CMD0_NAND_FLASH, DEV_FLAGS_IN, 0, 0, 0x00000000, 0, 0 },
  135. @@ -183,6 +158,24 @@ static dbdev_tab_t dbdev_tab[] = {
  136. { DSCR_CMD0_THROTTLE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
  137. { DSCR_CMD0_ALWAYS, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
  138. +
  139. + /* Provide 16 user definable device types */
  140. + { 0, 0, 0, 0, 0, 0, 0 },
  141. + { 0, 0, 0, 0, 0, 0, 0 },
  142. + { 0, 0, 0, 0, 0, 0, 0 },
  143. + { 0, 0, 0, 0, 0, 0, 0 },
  144. + { 0, 0, 0, 0, 0, 0, 0 },
  145. + { 0, 0, 0, 0, 0, 0, 0 },
  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. };
  157. #define DBDEV_TAB_SIZE (sizeof(dbdev_tab) / sizeof(dbdev_tab_t))
  158. @@ -202,6 +195,30 @@ find_dbdev_id (u32 id)
  159. return NULL;
  160. }
  161. +u32
  162. +au1xxx_ddma_add_device(dbdev_tab_t *dev)
  163. +{
  164. + u32 ret = 0;
  165. + dbdev_tab_t *p=NULL;
  166. + static u16 new_id=0x1000;
  167. +
  168. + p = find_dbdev_id(0);
  169. + if ( NULL != p )
  170. + {
  171. + memcpy(p, dev, sizeof(dbdev_tab_t));
  172. + p->dev_id = DSCR_DEV2CUSTOM_ID(new_id,dev->dev_id);
  173. + ret = p->dev_id;
  174. + new_id++;
  175. +#if 0
  176. + printk("add_device: id:%x flags:%x padd:%x\n",
  177. + p->dev_id, p->dev_flags, p->dev_physaddr );
  178. +#endif
  179. + }
  180. +
  181. + return ret;
  182. +}
  183. +EXPORT_SYMBOL(au1xxx_ddma_add_device);
  184. +
  185. /* Allocate a channel and return a non-zero descriptor if successful.
  186. */
  187. u32
  188. @@ -214,7 +231,7 @@ au1xxx_dbdma_chan_alloc(u32 srcid, u32 d
  189. int i;
  190. dbdev_tab_t *stp, *dtp;
  191. chan_tab_t *ctp;
  192. - volatile au1x_dma_chan_t *cp;
  193. + au1x_dma_chan_t *cp;
  194. /* We do the intialization on the first channel allocation.
  195. * We have to wait because of the interrupt handler initialization
  196. @@ -224,9 +241,6 @@ au1xxx_dbdma_chan_alloc(u32 srcid, u32 d
  197. au1xxx_dbdma_init();
  198. dbdma_initialized = 1;
  199. - if ((srcid > DSCR_NDEV_IDS) || (destid > DSCR_NDEV_IDS))
  200. - return 0;
  201. -
  202. if ((stp = find_dbdev_id(srcid)) == NULL) return 0;
  203. if ((dtp = find_dbdev_id(destid)) == NULL) return 0;
  204. @@ -268,9 +282,9 @@ au1xxx_dbdma_chan_alloc(u32 srcid, u32 d
  205. /* If kmalloc fails, it is caught below same
  206. * as a channel not available.
  207. */
  208. - ctp = (chan_tab_t *)kmalloc(sizeof(chan_tab_t), GFP_KERNEL);
  209. + ctp = (chan_tab_t *)
  210. + kmalloc(sizeof(chan_tab_t), GFP_KERNEL);
  211. chan_tab_ptr[i] = ctp;
  212. - ctp->chan_index = chan = i;
  213. break;
  214. }
  215. }
  216. @@ -278,10 +292,11 @@ au1xxx_dbdma_chan_alloc(u32 srcid, u32 d
  217. if (ctp != NULL) {
  218. memset(ctp, 0, sizeof(chan_tab_t));
  219. + ctp->chan_index = chan = i;
  220. dcp = DDMA_CHANNEL_BASE;
  221. dcp += (0x0100 * chan);
  222. ctp->chan_ptr = (au1x_dma_chan_t *)dcp;
  223. - cp = (volatile au1x_dma_chan_t *)dcp;
  224. + cp = (au1x_dma_chan_t *)dcp;
  225. ctp->chan_src = stp;
  226. ctp->chan_dest = dtp;
  227. ctp->chan_callback = callback;
  228. @@ -298,6 +313,9 @@ au1xxx_dbdma_chan_alloc(u32 srcid, u32 d
  229. i |= DDMA_CFG_DED;
  230. if (dtp->dev_intpolarity)
  231. i |= DDMA_CFG_DP;
  232. + if ((stp->dev_flags & DEV_FLAGS_SYNC) ||
  233. + (dtp->dev_flags & DEV_FLAGS_SYNC))
  234. + i |= DDMA_CFG_SYNC;
  235. cp->ddma_cfg = i;
  236. au_sync();
  237. @@ -308,14 +326,14 @@ au1xxx_dbdma_chan_alloc(u32 srcid, u32 d
  238. rv = (u32)(&chan_tab_ptr[chan]);
  239. }
  240. else {
  241. - /* Release devices.
  242. - */
  243. + /* Release devices */
  244. stp->dev_flags &= ~DEV_FLAGS_INUSE;
  245. dtp->dev_flags &= ~DEV_FLAGS_INUSE;
  246. }
  247. }
  248. return rv;
  249. }
  250. +EXPORT_SYMBOL(au1xxx_dbdma_chan_alloc);
  251. /* Set the device width if source or destination is a FIFO.
  252. * Should be 8, 16, or 32 bits.
  253. @@ -343,6 +361,7 @@ au1xxx_dbdma_set_devwidth(u32 chanid, in
  254. return rv;
  255. }
  256. +EXPORT_SYMBOL(au1xxx_dbdma_set_devwidth);
  257. /* Allocate a descriptor ring, initializing as much as possible.
  258. */
  259. @@ -369,7 +388,8 @@ au1xxx_dbdma_ring_alloc(u32 chanid, int
  260. * and if we try that first we are likely to not waste larger
  261. * slabs of memory.
  262. */
  263. - desc_base = (u32)kmalloc(entries * sizeof(au1x_ddma_desc_t), GFP_KERNEL);
  264. + desc_base = (u32)kmalloc(entries * sizeof(au1x_ddma_desc_t),
  265. + GFP_KERNEL|GFP_DMA);
  266. if (desc_base == 0)
  267. return 0;
  268. @@ -380,7 +400,7 @@ au1xxx_dbdma_ring_alloc(u32 chanid, int
  269. kfree((const void *)desc_base);
  270. i = entries * sizeof(au1x_ddma_desc_t);
  271. i += (sizeof(au1x_ddma_desc_t) - 1);
  272. - if ((desc_base = (u32)kmalloc(i, GFP_KERNEL)) == 0)
  273. + if ((desc_base = (u32)kmalloc(i, GFP_KERNEL|GFP_DMA)) == 0)
  274. return 0;
  275. desc_base = ALIGN_ADDR(desc_base, sizeof(au1x_ddma_desc_t));
  276. @@ -460,9 +480,14 @@ au1xxx_dbdma_ring_alloc(u32 chanid, int
  277. /* If source input is fifo, set static address.
  278. */
  279. if (stp->dev_flags & DEV_FLAGS_IN) {
  280. - src0 = stp->dev_physaddr;
  281. - src1 |= DSCR_SRC1_SAM(DSCR_xAM_STATIC);
  282. + if ( stp->dev_flags & DEV_FLAGS_BURSTABLE )
  283. + src1 |= DSCR_SRC1_SAM(DSCR_xAM_BURST);
  284. + else
  285. + src1 |= DSCR_SRC1_SAM(DSCR_xAM_STATIC);
  286. +
  287. }
  288. + if (stp->dev_physaddr)
  289. + src0 = stp->dev_physaddr;
  290. /* Set up dest1. For now, assume no stride and increment.
  291. * A channel attribute update can change this later.
  292. @@ -486,10 +511,18 @@ au1xxx_dbdma_ring_alloc(u32 chanid, int
  293. /* If destination output is fifo, set static address.
  294. */
  295. if (dtp->dev_flags & DEV_FLAGS_OUT) {
  296. - dest0 = dtp->dev_physaddr;
  297. + if ( dtp->dev_flags & DEV_FLAGS_BURSTABLE )
  298. + dest1 |= DSCR_DEST1_DAM(DSCR_xAM_BURST);
  299. + else
  300. dest1 |= DSCR_DEST1_DAM(DSCR_xAM_STATIC);
  301. }
  302. + if (dtp->dev_physaddr)
  303. + dest0 = dtp->dev_physaddr;
  304. +#if 0
  305. + printk("did:%x sid:%x cmd0:%x cmd1:%x source0:%x source1:%x dest0:%x dest1:%x\n",
  306. + dtp->dev_id, stp->dev_id, cmd0, cmd1, src0, src1, dest0, dest1 );
  307. +#endif
  308. for (i=0; i<entries; i++) {
  309. dp->dscr_cmd0 = cmd0;
  310. dp->dscr_cmd1 = cmd1;
  311. @@ -498,6 +531,7 @@ au1xxx_dbdma_ring_alloc(u32 chanid, int
  312. dp->dscr_dest0 = dest0;
  313. dp->dscr_dest1 = dest1;
  314. dp->dscr_stat = 0;
  315. + dp->sw_context = dp->sw_status = 0;
  316. dp->dscr_nxtptr = DSCR_NXTPTR(virt_to_phys(dp + 1));
  317. dp++;
  318. }
  319. @@ -510,13 +544,14 @@ au1xxx_dbdma_ring_alloc(u32 chanid, int
  320. return (u32)(ctp->chan_desc_base);
  321. }
  322. +EXPORT_SYMBOL(au1xxx_dbdma_ring_alloc);
  323. /* Put a source buffer into the DMA ring.
  324. * This updates the source pointer and byte count. Normally used
  325. * for memory to fifo transfers.
  326. */
  327. u32
  328. -au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes)
  329. +_au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags)
  330. {
  331. chan_tab_t *ctp;
  332. au1x_ddma_desc_t *dp;
  333. @@ -543,24 +578,40 @@ au1xxx_dbdma_put_source(u32 chanid, void
  334. */
  335. dp->dscr_source0 = virt_to_phys(buf);
  336. dp->dscr_cmd1 = nbytes;
  337. - dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */
  338. - ctp->chan_ptr->ddma_dbell = 0xffffffff; /* Make it go */
  339. -
  340. + /* Check flags */
  341. + if (flags & DDMA_FLAGS_IE)
  342. + dp->dscr_cmd0 |= DSCR_CMD0_IE;
  343. + if (flags & DDMA_FLAGS_NOIE)
  344. + dp->dscr_cmd0 &= ~DSCR_CMD0_IE;
  345. /* Get next descriptor pointer.
  346. */
  347. ctp->put_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
  348. + /*
  349. + * There is an errata on the Au1200/Au1550 parts that could result
  350. + * in "stale" data being DMA'd. It has to do with the snoop logic on
  351. + * the dache eviction buffer. NONCOHERENT_IO is on by default for
  352. + * these parts. If it is fixedin the future, these dma_cache_inv will
  353. + * just be nothing more than empty macros. See io.h.
  354. + * */
  355. + dma_cache_wback_inv(buf,nbytes);
  356. + dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */
  357. + au_sync();
  358. + dma_cache_wback_inv(dp, sizeof(dp));
  359. + ctp->chan_ptr->ddma_dbell = 0;
  360. +
  361. /* return something not zero.
  362. */
  363. return nbytes;
  364. }
  365. +EXPORT_SYMBOL(_au1xxx_dbdma_put_source);
  366. /* Put a destination buffer into the DMA ring.
  367. * This updates the destination pointer and byte count. Normally used
  368. * to place an empty buffer into the ring for fifo to memory transfers.
  369. */
  370. u32
  371. -au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes)
  372. +_au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags)
  373. {
  374. chan_tab_t *ctp;
  375. au1x_ddma_desc_t *dp;
  376. @@ -582,11 +633,33 @@ au1xxx_dbdma_put_dest(u32 chanid, void *
  377. if (dp->dscr_cmd0 & DSCR_CMD0_V)
  378. return 0;
  379. - /* Load up buffer address and byte count.
  380. - */
  381. + /* Load up buffer address and byte count */
  382. +
  383. + /* Check flags */
  384. + if (flags & DDMA_FLAGS_IE)
  385. + dp->dscr_cmd0 |= DSCR_CMD0_IE;
  386. + if (flags & DDMA_FLAGS_NOIE)
  387. + dp->dscr_cmd0 &= ~DSCR_CMD0_IE;
  388. +
  389. dp->dscr_dest0 = virt_to_phys(buf);
  390. dp->dscr_cmd1 = nbytes;
  391. +#if 0
  392. + printk("cmd0:%x cmd1:%x source0:%x source1:%x dest0:%x dest1:%x\n",
  393. + dp->dscr_cmd0, dp->dscr_cmd1, dp->dscr_source0,
  394. + dp->dscr_source1, dp->dscr_dest0, dp->dscr_dest1 );
  395. +#endif
  396. + /*
  397. + * There is an errata on the Au1200/Au1550 parts that could result in
  398. + * "stale" data being DMA'd. It has to do with the snoop logic on the
  399. + * dache eviction buffer. NONCOHERENT_IO is on by default for these
  400. + * parts. If it is fixedin the future, these dma_cache_inv will just
  401. + * be nothing more than empty macros. See io.h.
  402. + * */
  403. + dma_cache_inv(buf,nbytes);
  404. dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */
  405. + au_sync();
  406. + dma_cache_wback_inv(dp, sizeof(dp));
  407. + ctp->chan_ptr->ddma_dbell = 0;
  408. /* Get next descriptor pointer.
  409. */
  410. @@ -596,6 +669,7 @@ au1xxx_dbdma_put_dest(u32 chanid, void *
  411. */
  412. return nbytes;
  413. }
  414. +EXPORT_SYMBOL(_au1xxx_dbdma_put_dest);
  415. /* Get a destination buffer into the DMA ring.
  416. * Normally used to get a full buffer from the ring during fifo
  417. @@ -645,7 +719,7 @@ void
  418. au1xxx_dbdma_stop(u32 chanid)
  419. {
  420. chan_tab_t *ctp;
  421. - volatile au1x_dma_chan_t *cp;
  422. + au1x_dma_chan_t *cp;
  423. int halt_timeout = 0;
  424. ctp = *((chan_tab_t **)chanid);
  425. @@ -665,6 +739,7 @@ au1xxx_dbdma_stop(u32 chanid)
  426. cp->ddma_stat |= (DDMA_STAT_DB | DDMA_STAT_V);
  427. au_sync();
  428. }
  429. +EXPORT_SYMBOL(au1xxx_dbdma_stop);
  430. /* Start using the current descriptor pointer. If the dbdma encounters
  431. * a not valid descriptor, it will stop. In this case, we can just
  432. @@ -674,17 +749,17 @@ void
  433. au1xxx_dbdma_start(u32 chanid)
  434. {
  435. chan_tab_t *ctp;
  436. - volatile au1x_dma_chan_t *cp;
  437. + au1x_dma_chan_t *cp;
  438. ctp = *((chan_tab_t **)chanid);
  439. -
  440. cp = ctp->chan_ptr;
  441. cp->ddma_desptr = virt_to_phys(ctp->cur_ptr);
  442. cp->ddma_cfg |= DDMA_CFG_EN; /* Enable channel */
  443. au_sync();
  444. - cp->ddma_dbell = 0xffffffff; /* Make it go */
  445. + cp->ddma_dbell = 0;
  446. au_sync();
  447. }
  448. +EXPORT_SYMBOL(au1xxx_dbdma_start);
  449. void
  450. au1xxx_dbdma_reset(u32 chanid)
  451. @@ -703,15 +778,21 @@ au1xxx_dbdma_reset(u32 chanid)
  452. do {
  453. dp->dscr_cmd0 &= ~DSCR_CMD0_V;
  454. + /* reset our SW status -- this is used to determine
  455. + * if a descriptor is in use by upper level SW. Since
  456. + * posting can reset 'V' bit.
  457. + */
  458. + dp->sw_status = 0;
  459. dp = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
  460. } while (dp != ctp->chan_desc_base);
  461. }
  462. +EXPORT_SYMBOL(au1xxx_dbdma_reset);
  463. u32
  464. au1xxx_get_dma_residue(u32 chanid)
  465. {
  466. chan_tab_t *ctp;
  467. - volatile au1x_dma_chan_t *cp;
  468. + au1x_dma_chan_t *cp;
  469. u32 rv;
  470. ctp = *((chan_tab_t **)chanid);
  471. @@ -746,15 +827,16 @@ au1xxx_dbdma_chan_free(u32 chanid)
  472. kfree(ctp);
  473. }
  474. +EXPORT_SYMBOL(au1xxx_dbdma_chan_free);
  475. static void
  476. dbdma_interrupt(int irq, void *dev_id, struct pt_regs *regs)
  477. {
  478. - u32 intstat;
  479. + u32 intstat, flags;
  480. u32 chan_index;
  481. chan_tab_t *ctp;
  482. au1x_ddma_desc_t *dp;
  483. - volatile au1x_dma_chan_t *cp;
  484. + au1x_dma_chan_t *cp;
  485. intstat = dbdma_gptr->ddma_intstat;
  486. au_sync();
  487. @@ -773,18 +855,26 @@ dbdma_interrupt(int irq, void *dev_id, s
  488. (ctp->chan_callback)(irq, ctp->chan_callparam, regs);
  489. ctp->cur_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
  490. -
  491. }
  492. -static void
  493. -au1xxx_dbdma_init(void)
  494. +static void au1xxx_dbdma_init(void)
  495. {
  496. + int irq_nr;
  497. +
  498. dbdma_gptr->ddma_config = 0;
  499. dbdma_gptr->ddma_throttle = 0;
  500. dbdma_gptr->ddma_inten = 0xffff;
  501. au_sync();
  502. - if (request_irq(AU1550_DDMA_INT, dbdma_interrupt, SA_INTERRUPT,
  503. +#if defined(CONFIG_SOC_AU1550)
  504. + irq_nr = AU1550_DDMA_INT;
  505. +#elif defined(CONFIG_SOC_AU1200)
  506. + irq_nr = AU1200_DDMA_INT;
  507. +#else
  508. + #error Unknown Au1x00 SOC
  509. +#endif
  510. +
  511. + if (request_irq(irq_nr, dbdma_interrupt, SA_INTERRUPT,
  512. "Au1xxx dbdma", (void *)dbdma_gptr))
  513. printk("Can't get 1550 dbdma irq");
  514. }
  515. @@ -795,7 +885,8 @@ au1xxx_dbdma_dump(u32 chanid)
  516. chan_tab_t *ctp;
  517. au1x_ddma_desc_t *dp;
  518. dbdev_tab_t *stp, *dtp;
  519. - volatile au1x_dma_chan_t *cp;
  520. + au1x_dma_chan_t *cp;
  521. + u32 i = 0;
  522. ctp = *((chan_tab_t **)chanid);
  523. stp = ctp->chan_src;
  524. @@ -820,15 +911,64 @@ au1xxx_dbdma_dump(u32 chanid)
  525. dp = ctp->chan_desc_base;
  526. do {
  527. - printk("dp %08x, cmd0 %08x, cmd1 %08x\n",
  528. - (u32)dp, dp->dscr_cmd0, dp->dscr_cmd1);
  529. - printk("src0 %08x, src1 %08x, dest0 %08x\n",
  530. - dp->dscr_source0, dp->dscr_source1, dp->dscr_dest0);
  531. - printk("dest1 %08x, stat %08x, nxtptr %08x\n",
  532. - dp->dscr_dest1, dp->dscr_stat, dp->dscr_nxtptr);
  533. + printk("Dp[%d]= %08x, cmd0 %08x, cmd1 %08x\n",
  534. + i++, (u32)dp, dp->dscr_cmd0, dp->dscr_cmd1);
  535. + printk("src0 %08x, src1 %08x, dest0 %08x, dest1 %08x\n",
  536. + dp->dscr_source0, dp->dscr_source1, dp->dscr_dest0, dp->dscr_dest1);
  537. + printk("stat %08x, nxtptr %08x\n",
  538. + dp->dscr_stat, dp->dscr_nxtptr);
  539. dp = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
  540. } while (dp != ctp->chan_desc_base);
  541. }
  542. +/* Put a descriptor into the DMA ring.
  543. + * This updates the source/destination pointers and byte count.
  544. + */
  545. +u32
  546. +au1xxx_dbdma_put_dscr(u32 chanid, au1x_ddma_desc_t *dscr )
  547. +{
  548. + chan_tab_t *ctp;
  549. + au1x_ddma_desc_t *dp;
  550. + u32 nbytes=0;
  551. +
  552. + /* I guess we could check this to be within the
  553. + * range of the table......
  554. + */
  555. + ctp = *((chan_tab_t **)chanid);
  556. +
  557. + /* We should have multiple callers for a particular channel,
  558. + * an interrupt doesn't affect this pointer nor the descriptor,
  559. + * so no locking should be needed.
  560. + */
  561. + dp = ctp->put_ptr;
  562. +
  563. + /* If the descriptor is valid, we are way ahead of the DMA
  564. + * engine, so just return an error condition.
  565. + */
  566. + if (dp->dscr_cmd0 & DSCR_CMD0_V)
  567. + return 0;
  568. +
  569. + /* Load up buffer addresses and byte count.
  570. + */
  571. + dp->dscr_dest0 = dscr->dscr_dest0;
  572. + dp->dscr_source0 = dscr->dscr_source0;
  573. + dp->dscr_dest1 = dscr->dscr_dest1;
  574. + dp->dscr_source1 = dscr->dscr_source1;
  575. + dp->dscr_cmd1 = dscr->dscr_cmd1;
  576. + nbytes = dscr->dscr_cmd1;
  577. + /* Allow the caller to specifiy if an interrupt is generated */
  578. + dp->dscr_cmd0 &= ~DSCR_CMD0_IE;
  579. + dp->dscr_cmd0 |= dscr->dscr_cmd0 | DSCR_CMD0_V;
  580. + ctp->chan_ptr->ddma_dbell = 0;
  581. +
  582. + /* Get next descriptor pointer.
  583. + */
  584. + ctp->put_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
  585. +
  586. + /* return something not zero.
  587. + */
  588. + return nbytes;
  589. +}
  590. +
  591. #endif /* defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) */
  592. --- /dev/null
  593. +++ b/arch/mips/au1000/common/gpio.c
  594. @@ -0,0 +1,118 @@
  595. +/*
  596. + * This program is free software; you can redistribute it and/or modify it
  597. + * under the terms of the GNU General Public License as published by the
  598. + * Free Software Foundation; either version 2 of the License, or (at your
  599. + * option) any later version.
  600. + *
  601. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  602. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  603. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  604. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  605. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  606. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  607. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  608. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  609. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  610. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  611. + *
  612. + * You should have received a copy of the GNU General Public License along
  613. + * with this program; if not, write to the Free Software Foundation, Inc.,
  614. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  615. + */
  616. +
  617. +#include <asm/au1000.h>
  618. +#include <asm/au1xxx_gpio.h>
  619. +
  620. +#define gpio1 sys
  621. +#if !defined(CONFIG_SOC_AU1000)
  622. +static AU1X00_GPIO2 * const gpio2 = (AU1X00_GPIO2 *)GPIO2_BASE;
  623. +
  624. +#define GPIO2_OUTPUT_ENABLE_MASK 0x00010000
  625. +
  626. +int au1xxx_gpio2_read(int signal)
  627. +{
  628. + signal -= 200;
  629. +/* gpio2->dir &= ~(0x01 << signal); //Set GPIO to input */
  630. + return ((gpio2->pinstate >> signal) & 0x01);
  631. +}
  632. +
  633. +void au1xxx_gpio2_write(int signal, int value)
  634. +{
  635. + signal -= 200;
  636. +
  637. + gpio2->output = (GPIO2_OUTPUT_ENABLE_MASK << signal) |
  638. + (value << signal);
  639. +}
  640. +
  641. +void au1xxx_gpio2_tristate(int signal)
  642. +{
  643. + signal -= 200;
  644. + gpio2->dir &= ~(0x01 << signal); /* Set GPIO to input */
  645. +}
  646. +#endif
  647. +
  648. +int au1xxx_gpio1_read(int signal)
  649. +{
  650. +/* gpio1->trioutclr |= (0x01 << signal); */
  651. + return ((gpio1->pinstaterd >> signal) & 0x01);
  652. +}
  653. +
  654. +void au1xxx_gpio1_write(int signal, int value)
  655. +{
  656. + if(value)
  657. + gpio1->outputset = (0x01 << signal);
  658. + else
  659. + gpio1->outputclr = (0x01 << signal); /* Output a Zero */
  660. +}
  661. +
  662. +void au1xxx_gpio1_tristate(int signal)
  663. +{
  664. + gpio1->trioutclr = (0x01 << signal); /* Tristate signal */
  665. +}
  666. +
  667. +
  668. +int au1xxx_gpio_read(int signal)
  669. +{
  670. + if(signal >= 200)
  671. +#if defined(CONFIG_SOC_AU1000)
  672. + return 0;
  673. +#else
  674. + return au1xxx_gpio2_read(signal);
  675. +#endif
  676. + else
  677. + return au1xxx_gpio1_read(signal);
  678. +}
  679. +
  680. +void au1xxx_gpio_write(int signal, int value)
  681. +{
  682. + if(signal >= 200)
  683. +#if defined(CONFIG_SOC_AU1000)
  684. + ;
  685. +#else
  686. + au1xxx_gpio2_write(signal, value);
  687. +#endif
  688. + else
  689. + au1xxx_gpio1_write(signal, value);
  690. +}
  691. +
  692. +void au1xxx_gpio_tristate(int signal)
  693. +{
  694. + if(signal >= 200)
  695. +#if defined(CONFIG_SOC_AU1000)
  696. + ;
  697. +#else
  698. + au1xxx_gpio2_tristate(signal);
  699. +#endif
  700. + else
  701. + au1xxx_gpio1_tristate(signal);
  702. +}
  703. +
  704. +void au1xxx_gpio1_set_inputs(void)
  705. +{
  706. + gpio1->pininputen = 0;
  707. +}
  708. +
  709. +EXPORT_SYMBOL(au1xxx_gpio1_set_inputs);
  710. +EXPORT_SYMBOL(au1xxx_gpio_tristate);
  711. +EXPORT_SYMBOL(au1xxx_gpio_write);
  712. +EXPORT_SYMBOL(au1xxx_gpio_read);
  713. --- a/arch/mips/au1000/common/irq.c
  714. +++ b/arch/mips/au1000/common/irq.c
  715. @@ -303,8 +303,30 @@ static struct hw_interrupt_type level_ir
  716. };
  717. #ifdef CONFIG_PM
  718. -void startup_match20_interrupt(void)
  719. +void startup_match20_interrupt(void (*handler)(int, void *, struct pt_regs *))
  720. {
  721. + static struct irqaction action;
  722. + /* This is a big problem.... since we didn't use request_irq
  723. + when kernel/irq.c calls probe_irq_xxx this interrupt will
  724. + be probed for usage. This will end up disabling the device :(
  725. +
  726. + Give it a bogus "action" pointer -- this will keep it from
  727. + getting auto-probed!
  728. +
  729. + By setting the status to match that of request_irq() we
  730. + can avoid it. --cgray
  731. + */
  732. + action.dev_id = handler;
  733. + action.flags = 0;
  734. + action.mask = 0;
  735. + action.name = "Au1xxx TOY";
  736. + action.handler = handler;
  737. + action.next = NULL;
  738. +
  739. + irq_desc[AU1000_TOY_MATCH2_INT].action = &action;
  740. + irq_desc[AU1000_TOY_MATCH2_INT].status
  741. + &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | IRQ_INPROGRESS);
  742. +
  743. local_enable_irq(AU1000_TOY_MATCH2_INT);
  744. }
  745. #endif
  746. @@ -508,6 +530,7 @@ void intc0_req0_irqdispatch(struct pt_re
  747. if (!intc0_req0) return;
  748. +#ifdef AU1000_USB_DEV_REQ_INT
  749. /*
  750. * Because of the tight timing of SETUP token to reply
  751. * transactions, the USB devices-side packet complete
  752. @@ -518,6 +541,7 @@ void intc0_req0_irqdispatch(struct pt_re
  753. do_IRQ(AU1000_USB_DEV_REQ_INT, regs);
  754. return;
  755. }
  756. +#endif
  757. irq = au_ffs(intc0_req0) - 1;
  758. intc0_req0 &= ~(1<<irq);
  759. @@ -536,17 +560,7 @@ void intc0_req1_irqdispatch(struct pt_re
  760. irq = au_ffs(intc0_req1) - 1;
  761. intc0_req1 &= ~(1<<irq);
  762. -#ifdef CONFIG_PM
  763. - if (irq == AU1000_TOY_MATCH2_INT) {
  764. - mask_and_ack_rise_edge_irq(irq);
  765. - counter0_irq(irq, NULL, regs);
  766. - local_enable_irq(irq);
  767. - }
  768. - else
  769. -#endif
  770. - {
  771. - do_IRQ(irq, regs);
  772. - }
  773. + do_IRQ(irq, regs);
  774. }
  775. --- a/arch/mips/au1000/common/Makefile
  776. +++ b/arch/mips/au1000/common/Makefile
  777. @@ -19,9 +19,9 @@ O_TARGET := au1000.o
  778. export-objs = prom.o clocks.o power.o usbdev.o
  779. obj-y := prom.o int-handler.o irq.o puts.o time.o reset.o cputable.o \
  780. - au1xxx_irqmap.o clocks.o power.o setup.o sleeper.o dma.o dbdma.o
  781. + au1xxx_irqmap.o clocks.o power.o setup.o sleeper.o dma.o dbdma.o gpio.o
  782. -export-objs += dma.o dbdma.o
  783. +export-objs += dma.o dbdma.o gpio.o
  784. obj-$(CONFIG_AU1X00_USB_DEVICE) += usbdev.o
  785. obj-$(CONFIG_KGDB) += dbg_io.o
  786. --- a/arch/mips/au1000/common/pci_fixup.c
  787. +++ b/arch/mips/au1000/common/pci_fixup.c
  788. @@ -75,9 +75,13 @@ void __init pcibios_fixup(void)
  789. #ifdef CONFIG_NONCOHERENT_IO
  790. /*
  791. - * Set the NC bit in controller for pre-AC silicon
  792. + * Set the NC bit in controller for Au1500 pre-AC silicon
  793. */
  794. - au_writel( 1<<16 | au_readl(Au1500_PCI_CFG), Au1500_PCI_CFG);
  795. + u32 prid = read_c0_prid();
  796. + if ( (prid & 0xFF000000) == 0x01000000 && prid < 0x01030202) {
  797. + au_writel( 1<<16 | au_readl(Au1500_PCI_CFG), Au1500_PCI_CFG);
  798. + printk("Non-coherent PCI accesses enabled\n");
  799. + }
  800. printk("Non-coherent PCI accesses enabled\n");
  801. #endif
  802. --- a/arch/mips/au1000/common/pci_ops.c
  803. +++ b/arch/mips/au1000/common/pci_ops.c
  804. @@ -162,6 +162,7 @@ unsigned long last_entryLo0, last_entryL
  805. static int config_access(unsigned char access_type, struct pci_dev *dev,
  806. unsigned char where, u32 * data)
  807. {
  808. + int error = PCIBIOS_SUCCESSFUL;
  809. #if defined( CONFIG_SOC_AU1500 ) || defined( CONFIG_SOC_AU1550 )
  810. unsigned char bus = dev->bus->number;
  811. unsigned int dev_fn = dev->devfn;
  812. @@ -170,7 +171,6 @@ static int config_access(unsigned char a
  813. unsigned long offset, status;
  814. unsigned long cfg_base;
  815. unsigned long flags;
  816. - int error = PCIBIOS_SUCCESSFUL;
  817. unsigned long entryLo0, entryLo1;
  818. if (device > 19) {
  819. @@ -205,9 +205,8 @@ static int config_access(unsigned char a
  820. last_entryLo0 = last_entryLo1 = 0xffffffff;
  821. }
  822. - /* Since the Au1xxx doesn't do the idsel timing exactly to spec,
  823. - * many board vendors implement their own off-chip idsel, so call
  824. - * it now. If it doesn't succeed, may as well bail out at this point.
  825. + /* Allow board vendors to implement their own off-chip idsel.
  826. + * If it doesn't succeed, may as well bail out at this point.
  827. */
  828. if (board_pci_idsel) {
  829. if (board_pci_idsel(device, 1) == 0) {
  830. @@ -271,8 +270,11 @@ static int config_access(unsigned char a
  831. }
  832. local_irq_restore(flags);
  833. - return error;
  834. +#else
  835. + /* Fake out Config space access with no responder */
  836. + *data = 0xFFFFFFFF;
  837. #endif
  838. + return error;
  839. }
  840. #endif
  841. --- a/arch/mips/au1000/common/power.c
  842. +++ b/arch/mips/au1000/common/power.c
  843. @@ -50,7 +50,6 @@
  844. static void calibrate_delay(void);
  845. -extern void set_au1x00_speed(unsigned int new_freq);
  846. extern unsigned int get_au1x00_speed(void);
  847. extern unsigned long get_au1x00_uart_baud_base(void);
  848. extern void set_au1x00_uart_baud_base(unsigned long new_baud_base);
  849. @@ -116,6 +115,7 @@ save_core_regs(void)
  850. sleep_uart0_clkdiv = au_readl(UART0_ADDR + UART_CLK);
  851. sleep_uart0_enable = au_readl(UART0_ADDR + UART_MOD_CNTRL);
  852. +#ifndef CONFIG_SOC_AU1200
  853. /* Shutdown USB host/device.
  854. */
  855. sleep_usbhost_enable = au_readl(USB_HOST_CONFIG);
  856. @@ -127,6 +127,7 @@ save_core_regs(void)
  857. sleep_usbdev_enable = au_readl(USBD_ENABLE);
  858. au_writel(0, USBD_ENABLE); au_sync();
  859. +#endif
  860. /* Save interrupt controller state.
  861. */
  862. @@ -212,14 +213,12 @@ void wakeup_from_suspend(void)
  863. int au_sleep(void)
  864. {
  865. unsigned long wakeup, flags;
  866. - extern void save_and_sleep(void);
  867. + extern unsigned int save_and_sleep(void);
  868. spin_lock_irqsave(&pm_lock,flags);
  869. save_core_regs();
  870. - flush_cache_all();
  871. -
  872. /** The code below is all system dependent and we should probably
  873. ** have a function call out of here to set this up. You need
  874. ** to configure the GPIO or timer interrupts that will bring
  875. @@ -227,27 +226,26 @@ int au_sleep(void)
  876. ** For testing, the TOY counter wakeup is useful.
  877. **/
  878. -#if 0
  879. +#if 1
  880. au_writel(au_readl(SYS_PINSTATERD) & ~(1 << 11), SYS_PINSTATERD);
  881. /* gpio 6 can cause a wake up event */
  882. wakeup = au_readl(SYS_WAKEMSK);
  883. wakeup &= ~(1 << 8); /* turn off match20 wakeup */
  884. - wakeup |= 1 << 6; /* turn on gpio 6 wakeup */
  885. + wakeup = 1 << 5; /* turn on gpio 6 wakeup */
  886. #else
  887. - /* For testing, allow match20 to wake us up.
  888. - */
  889. + /* For testing, allow match20 to wake us up. */
  890. #ifdef SLEEP_TEST_TIMEOUT
  891. wakeup_counter0_set(sleep_ticks);
  892. #endif
  893. wakeup = 1 << 8; /* turn on match20 wakeup */
  894. wakeup = 0;
  895. #endif
  896. - au_writel(1, SYS_WAKESRC); /* clear cause */
  897. + au_writel(0, SYS_WAKESRC); /* clear cause */
  898. au_sync();
  899. au_writel(wakeup, SYS_WAKEMSK);
  900. au_sync();
  901. -
  902. + DPRINTK("Entering sleep!\n");
  903. save_and_sleep();
  904. /* after a wakeup, the cpu vectors back to 0x1fc00000 so
  905. @@ -255,6 +253,7 @@ int au_sleep(void)
  906. */
  907. restore_core_regs();
  908. spin_unlock_irqrestore(&pm_lock, flags);
  909. + DPRINTK("Leaving sleep!\n");
  910. return 0;
  911. }
  912. @@ -285,7 +284,6 @@ static int pm_do_sleep(ctl_table * ctl,
  913. if (retval)
  914. return retval;
  915. -
  916. au_sleep();
  917. retval = pm_send_all(PM_RESUME, (void *) 0);
  918. }
  919. @@ -296,7 +294,6 @@ static int pm_do_suspend(ctl_table * ctl
  920. void *buffer, size_t * len)
  921. {
  922. int retval = 0;
  923. - void au1k_wait(void);
  924. if (!write) {
  925. *len = 0;
  926. @@ -305,119 +302,9 @@ static int pm_do_suspend(ctl_table * ctl
  927. if (retval)
  928. return retval;
  929. suspend_mode = 1;
  930. - au1k_wait();
  931. - retval = pm_send_all(PM_RESUME, (void *) 0);
  932. - }
  933. - return retval;
  934. -}
  935. -
  936. -static int pm_do_freq(ctl_table * ctl, int write, struct file *file,
  937. - void *buffer, size_t * len)
  938. -{
  939. - int retval = 0, i;
  940. - unsigned long val, pll;
  941. -#define TMPBUFLEN 64
  942. -#define MAX_CPU_FREQ 396
  943. - char buf[TMPBUFLEN], *p;
  944. - unsigned long flags, intc0_mask, intc1_mask;
  945. - unsigned long old_baud_base, old_cpu_freq, baud_rate, old_clk,
  946. - old_refresh;
  947. - unsigned long new_baud_base, new_cpu_freq, new_clk, new_refresh;
  948. -
  949. - spin_lock_irqsave(&pm_lock, flags);
  950. - if (!write) {
  951. - *len = 0;
  952. - } else {
  953. - /* Parse the new frequency */
  954. - if (*len > TMPBUFLEN - 1) {
  955. - spin_unlock_irqrestore(&pm_lock, flags);
  956. - return -EFAULT;
  957. - }
  958. - if (copy_from_user(buf, buffer, *len)) {
  959. - spin_unlock_irqrestore(&pm_lock, flags);
  960. - return -EFAULT;
  961. - }
  962. - buf[*len] = 0;
  963. - p = buf;
  964. - val = simple_strtoul(p, &p, 0);
  965. - if (val > MAX_CPU_FREQ) {
  966. - spin_unlock_irqrestore(&pm_lock, flags);
  967. - return -EFAULT;
  968. - }
  969. -
  970. - pll = val / 12;
  971. - if ((pll > 33) || (pll < 7)) { /* 396 MHz max, 84 MHz min */
  972. - /* revisit this for higher speed cpus */
  973. - spin_unlock_irqrestore(&pm_lock, flags);
  974. - return -EFAULT;
  975. - }
  976. -
  977. - old_baud_base = get_au1x00_uart_baud_base();
  978. - old_cpu_freq = get_au1x00_speed();
  979. -
  980. - new_cpu_freq = pll * 12 * 1000000;
  981. - new_baud_base = (new_cpu_freq / (2 * ((int)(au_readl(SYS_POWERCTRL)&0x03) + 2) * 16));
  982. - set_au1x00_speed(new_cpu_freq);
  983. - set_au1x00_uart_baud_base(new_baud_base);
  984. -
  985. - old_refresh = au_readl(MEM_SDREFCFG) & 0x1ffffff;
  986. - new_refresh =
  987. - ((old_refresh * new_cpu_freq) /
  988. - old_cpu_freq) | (au_readl(MEM_SDREFCFG) & ~0x1ffffff);
  989. -
  990. - au_writel(pll, SYS_CPUPLL);
  991. - au_sync_delay(1);
  992. - au_writel(new_refresh, MEM_SDREFCFG);
  993. - au_sync_delay(1);
  994. -
  995. - for (i = 0; i < 4; i++) {
  996. - if (au_readl
  997. - (UART_BASE + UART_MOD_CNTRL +
  998. - i * 0x00100000) == 3) {
  999. - old_clk =
  1000. - au_readl(UART_BASE + UART_CLK +
  1001. - i * 0x00100000);
  1002. - // baud_rate = baud_base/clk
  1003. - baud_rate = old_baud_base / old_clk;
  1004. - /* we won't get an exact baud rate and the error
  1005. - * could be significant enough that our new
  1006. - * calculation will result in a clock that will
  1007. - * give us a baud rate that's too far off from
  1008. - * what we really want.
  1009. - */
  1010. - if (baud_rate > 100000)
  1011. - baud_rate = 115200;
  1012. - else if (baud_rate > 50000)
  1013. - baud_rate = 57600;
  1014. - else if (baud_rate > 30000)
  1015. - baud_rate = 38400;
  1016. - else if (baud_rate > 17000)
  1017. - baud_rate = 19200;
  1018. - else
  1019. - (baud_rate = 9600);
  1020. - // new_clk = new_baud_base/baud_rate
  1021. - new_clk = new_baud_base / baud_rate;
  1022. - au_writel(new_clk,
  1023. - UART_BASE + UART_CLK +
  1024. - i * 0x00100000);
  1025. - au_sync_delay(10);
  1026. - }
  1027. - }
  1028. + retval = pm_send_all(PM_RESUME, (void *) 0);
  1029. }
  1030. -
  1031. -
  1032. - /* We don't want _any_ interrupts other than
  1033. - * match20. Otherwise our calibrate_delay()
  1034. - * calculation will be off, potentially a lot.
  1035. - */
  1036. - intc0_mask = save_local_and_disable(0);
  1037. - intc1_mask = save_local_and_disable(1);
  1038. - local_enable_irq(AU1000_TOY_MATCH2_INT);
  1039. - spin_unlock_irqrestore(&pm_lock, flags);
  1040. - calibrate_delay();
  1041. - restore_local_and_enable(0, intc0_mask);
  1042. - restore_local_and_enable(1, intc1_mask);
  1043. return retval;
  1044. }
  1045. @@ -425,7 +312,6 @@ static int pm_do_freq(ctl_table * ctl, i
  1046. static struct ctl_table pm_table[] = {
  1047. {ACPI_S1_SLP_TYP, "suspend", NULL, 0, 0600, NULL, &pm_do_suspend},
  1048. {ACPI_SLEEP, "sleep", NULL, 0, 0600, NULL, &pm_do_sleep},
  1049. - {CTL_ACPI, "freq", NULL, 0, 0600, NULL, &pm_do_freq},
  1050. {0}
  1051. };
  1052. --- a/arch/mips/au1000/common/reset.c
  1053. +++ b/arch/mips/au1000/common/reset.c
  1054. @@ -37,8 +37,6 @@
  1055. #include <asm/system.h>
  1056. #include <asm/au1000.h>
  1057. -extern int au_sleep(void);
  1058. -
  1059. void au1000_restart(char *command)
  1060. {
  1061. /* Set all integrated peripherals to disabled states */
  1062. @@ -144,6 +142,26 @@ void au1000_restart(char *command)
  1063. au_writel(0x00, 0xb1900064); /* sys_auxpll */
  1064. au_writel(0x00, 0xb1900100); /* sys_pininputen */
  1065. break;
  1066. + case 0x04000000: /* Au1200 */
  1067. + au_writel(0x00, 0xb400300c); /* ddma */
  1068. + au_writel(0x00, 0xb1a00004); /* psc 0 */
  1069. + au_writel(0x00, 0xb1b00004); /* psc 1 */
  1070. + au_writel(0x00d02000, 0xb4020004); /* ehci, ohci, udc, otg */
  1071. + au_writel(0x00, 0xb5000004); /* lcd */
  1072. + au_writel(0x00, 0xb060000c); /* sd0 */
  1073. + au_writel(0x00, 0xb068000c); /* sd1 */
  1074. + au_writel(0x00, 0xb1100100); /* swcnt */
  1075. + au_writel(0x00, 0xb0300000); /* aes */
  1076. + au_writel(0x00, 0xb4004000); /* cim */
  1077. + au_writel(0x00, 0xb1100100); /* uart0_enable */
  1078. + au_writel(0x00, 0xb1200100); /* uart1_enable */
  1079. + au_writel(0x00, 0xb1900020); /* sys_freqctrl0 */
  1080. + au_writel(0x00, 0xb1900024); /* sys_freqctrl1 */
  1081. + au_writel(0x00, 0xb1900028); /* sys_clksrc */
  1082. + au_writel(0x10, 0xb1900060); /* sys_cpupll */
  1083. + au_writel(0x00, 0xb1900064); /* sys_auxpll */
  1084. + au_writel(0x00, 0xb1900100); /* sys_pininputen */
  1085. + break;
  1086. default:
  1087. break;
  1088. @@ -163,32 +181,23 @@ void au1000_restart(char *command)
  1089. void au1000_halt(void)
  1090. {
  1091. -#if defined(CONFIG_MIPS_PB1550)
  1092. - /* power off system */
  1093. - printk("\n** Powering off Pb1550\n");
  1094. - au_writew(au_readw(0xAF00001C) | (3<<14), 0xAF00001C);
  1095. - au_sync();
  1096. - while(1); /* should not get here */
  1097. -#endif
  1098. - printk(KERN_NOTICE "\n** You can safely turn off the power\n");
  1099. -#ifdef CONFIG_MIPS_MIRAGE
  1100. - au_writel((1 << 26) | (1 << 10), GPIO2_OUTPUT);
  1101. -#endif
  1102. -#ifdef CONFIG_PM
  1103. - au_sleep();
  1104. -
  1105. - /* should not get here */
  1106. - printk(KERN_ERR "Unable to put cpu in sleep mode\n");
  1107. - while(1);
  1108. -#else
  1109. - while (1)
  1110. + /* Use WAIT in a low-power infinite spin loop */
  1111. + while (1) {
  1112. __asm__(".set\tmips3\n\t"
  1113. "wait\n\t"
  1114. ".set\tmips0");
  1115. -#endif
  1116. + }
  1117. }
  1118. void au1000_power_off(void)
  1119. {
  1120. + extern void board_power_off (void);
  1121. +
  1122. + printk(KERN_NOTICE "\n** You can safely turn off the power\n");
  1123. +
  1124. + /* Give board a chance to power-off */
  1125. + board_power_off();
  1126. +
  1127. + /* If board can't power-off, spin forever */
  1128. au1000_halt();
  1129. }
  1130. --- a/arch/mips/au1000/common/setup.c
  1131. +++ b/arch/mips/au1000/common/setup.c
  1132. @@ -174,6 +174,40 @@ void __init au1x00_setup(void)
  1133. initrd_end = (unsigned long)&__rd_end;
  1134. #endif
  1135. +#if defined(CONFIG_SOC_AU1200)
  1136. +#ifdef CONFIG_USB_EHCI_HCD
  1137. + if ((argptr = strstr(argptr, "usb_ehci=")) == NULL) {
  1138. + char usb_args[80];
  1139. + argptr = prom_getcmdline();
  1140. + memset(usb_args, 0, sizeof(usb_args));
  1141. + sprintf(usb_args, " usb_ehci=base:0x%x,len:0x%x,irq:%d",
  1142. + USB_EHCI_BASE, USB_EHCI_LEN, AU1000_USB_HOST_INT);
  1143. + strcat(argptr, usb_args);
  1144. + }
  1145. +#ifdef CONFIG_USB_AMD5536UDC
  1146. + /* enable EHC + OHC + UDC clocks, memory and bus mastering */
  1147. +/* au_writel( 0x00DF207F, USB_MSR_BASE + 4); */
  1148. + au_writel( 0xC0DF207F, USB_MSR_BASE + 4); // incl. prefetch
  1149. +#else
  1150. + /* enable EHC + OHC clocks, memory and bus mastering */
  1151. +/* au_writel( 0x00DB200F, USB_MSR_BASE + 4); */
  1152. + au_writel( 0xC0DB200F, USB_MSR_BASE + 4); /* incl. prefetch */
  1153. +#endif
  1154. + udelay(1000);
  1155. +
  1156. +#else /* CONFIG_USB_EHCI_HCD */
  1157. +
  1158. +#ifdef CONFIG_USB_AMD5536UDC
  1159. +#ifndef CONFIG_USB_OHCI
  1160. + /* enable UDC clocks, memory and bus mastering */
  1161. +/* au_writel( 0x00DC2070, USB_MSR_BASE + 4); */
  1162. + au_writel( 0xC0DC2070, USB_MSR_BASE + 4); // incl. prefetch
  1163. + udelay(1000);
  1164. +#endif
  1165. +#endif
  1166. +#endif /* CONFIG_USB_EHCI_HCD */
  1167. +#endif /* CONFIG_SOC_AU1200 */
  1168. +
  1169. #if defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE)
  1170. #ifdef CONFIG_USB_OHCI
  1171. if ((argptr = strstr(argptr, "usb_ohci=")) == NULL) {
  1172. @@ -187,19 +221,38 @@ void __init au1x00_setup(void)
  1173. #endif
  1174. #ifdef CONFIG_USB_OHCI
  1175. - // enable host controller and wait for reset done
  1176. +#if defined(CONFIG_SOC_AU1200)
  1177. +#ifndef CONFIG_USB_EHCI_HCD
  1178. +#ifdef CONFIG_USB_AMD5536UDC
  1179. + /* enable OHC + UDC clocks, memory and bus mastering */
  1180. +/* au_writel( 0x00DD2073, USB_MSR_BASE + 4); */
  1181. + au_writel( 0xC0DD2073, USB_MSR_BASE + 4); // incl. prefetch
  1182. +#else
  1183. + /* enable OHC clocks, memory and bus mastering */
  1184. + au_writel( 0x00D12003, USB_MSR_BASE + 4);
  1185. +#endif
  1186. + udelay(1000);
  1187. +printk("DEBUG: Reading Au1200 USB2 reg 0x%x\n", au_readl(USB_MSR_BASE + 4));
  1188. +#endif
  1189. +#else
  1190. + /* Au1000, Au1500, Au1100, Au1550 */
  1191. + /* enable host controller and wait for reset done */
  1192. au_writel(0x08, USB_HOST_CONFIG);
  1193. udelay(1000);
  1194. au_writel(0x0E, USB_HOST_CONFIG);
  1195. udelay(1000);
  1196. - au_readl(USB_HOST_CONFIG); // throw away first read
  1197. + au_readl(USB_HOST_CONFIG); /* throw away first read */
  1198. while (!(au_readl(USB_HOST_CONFIG) & 0x10))
  1199. au_readl(USB_HOST_CONFIG);
  1200. +#endif /* CONFIG_SOC_AU1200 */
  1201. #endif
  1202. -#endif // defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE)
  1203. +#else
  1204. +
  1205. +#endif /* defined (CONFIG_USB_OHCI) || defined (CONFIG_AU1X00_USB_DEVICE) */
  1206. +
  1207. #ifdef CONFIG_FB
  1208. - // Needed if PCI video card in use
  1209. + /* Needed if PCI video card in use */
  1210. conswitchp = &dummy_con;
  1211. #endif
  1212. @@ -209,8 +262,7 @@ void __init au1x00_setup(void)
  1213. #endif
  1214. #ifdef CONFIG_BLK_DEV_IDE
  1215. - /* Board setup takes precedence for unique devices.
  1216. - */
  1217. + /* Board setup takes precedence for unique devices. */
  1218. if ((ide_ops == NULL) || (ide_ops == &no_ide_ops))
  1219. ide_ops = &std_ide_ops;
  1220. #endif
  1221. --- a/arch/mips/au1000/common/sleeper.S
  1222. +++ b/arch/mips/au1000/common/sleeper.S
  1223. @@ -15,17 +15,48 @@
  1224. #include <asm/addrspace.h>
  1225. #include <asm/regdef.h>
  1226. #include <asm/stackframe.h>
  1227. +#include <asm/au1000.h>
  1228. +
  1229. +/*
  1230. + * Note: This file is *not* conditional on CONFIG_PM since Alchemy sleep
  1231. + * need not be tied to any particular power management scheme.
  1232. + */
  1233. +
  1234. + .extern ___flush_cache_all
  1235. .text
  1236. - .set macro
  1237. - .set noat
  1238. .align 5
  1239. -/* Save all of the processor general registers and go to sleep.
  1240. - * A wakeup condition will get us back here to restore the registers.
  1241. +/*
  1242. + * Save the processor general registers and go to sleep. A wakeup
  1243. + * condition will get us back here to restore the registers.
  1244. */
  1245. -LEAF(save_and_sleep)
  1246. +/* still need to fix alignment issues here */
  1247. +save_and_sleep_frmsz = 48
  1248. +NESTED(save_and_sleep, save_and_sleep_frmsz, ra)
  1249. + .set noreorder
  1250. + .set nomacro
  1251. + .set noat
  1252. + subu sp, save_and_sleep_frmsz
  1253. + sw ra, save_and_sleep_frmsz-4(sp)
  1254. + sw s0, save_and_sleep_frmsz-8(sp)
  1255. + sw s1, save_and_sleep_frmsz-12(sp)
  1256. + sw s2, save_and_sleep_frmsz-16(sp)
  1257. + sw s3, save_and_sleep_frmsz-20(sp)
  1258. + sw s4, save_and_sleep_frmsz-24(sp)
  1259. + sw s5, save_and_sleep_frmsz-28(sp)
  1260. + sw s6, save_and_sleep_frmsz-32(sp)
  1261. + sw s7, save_and_sleep_frmsz-36(sp)
  1262. + sw s8, save_and_sleep_frmsz-40(sp)
  1263. + sw gp, save_and_sleep_frmsz-44(sp)
  1264. +
  1265. + /* We only need to save the registers that the calling function
  1266. + * hasn't saved for us. 0 is always zero. 8 - 15, 24 and 25 are
  1267. + * temporaries and can be used without saving. 26 and 27 are reserved
  1268. + * for interrupt/trap handling and expected to change. 29 is the
  1269. + * stack pointer which is handled as a special case here.
  1270. + */
  1271. subu sp, PT_SIZE
  1272. sw $1, PT_R1(sp)
  1273. sw $2, PT_R2(sp)
  1274. @@ -34,14 +65,6 @@ LEAF(save_and_sleep)
  1275. sw $5, PT_R5(sp)
  1276. sw $6, PT_R6(sp)
  1277. sw $7, PT_R7(sp)
  1278. - sw $8, PT_R8(sp)
  1279. - sw $9, PT_R9(sp)
  1280. - sw $10, PT_R10(sp)
  1281. - sw $11, PT_R11(sp)
  1282. - sw $12, PT_R12(sp)
  1283. - sw $13, PT_R13(sp)
  1284. - sw $14, PT_R14(sp)
  1285. - sw $15, PT_R15(sp)
  1286. sw $16, PT_R16(sp)
  1287. sw $17, PT_R17(sp)
  1288. sw $18, PT_R18(sp)
  1289. @@ -50,32 +73,47 @@ LEAF(save_and_sleep)
  1290. sw $21, PT_R21(sp)
  1291. sw $22, PT_R22(sp)
  1292. sw $23, PT_R23(sp)
  1293. - sw $24, PT_R24(sp)
  1294. - sw $25, PT_R25(sp)
  1295. - sw $26, PT_R26(sp)
  1296. - sw $27, PT_R27(sp)
  1297. sw $28, PT_R28(sp)
  1298. - sw $29, PT_R29(sp)
  1299. sw $30, PT_R30(sp)
  1300. sw $31, PT_R31(sp)
  1301. +#define PT_C0STATUS PT_LO
  1302. +#define PT_CONTEXT PT_HI
  1303. +#define PT_PAGEMASK PT_EPC
  1304. +#define PT_CONFIG PT_BVADDR
  1305. mfc0 k0, CP0_STATUS
  1306. - sw k0, 0x20(sp)
  1307. + sw k0, PT_C0STATUS(sp) // 0x20
  1308. mfc0 k0, CP0_CONTEXT
  1309. - sw k0, 0x1c(sp)
  1310. + sw k0, PT_CONTEXT(sp) // 0x1c
  1311. mfc0 k0, CP0_PAGEMASK
  1312. - sw k0, 0x18(sp)
  1313. + sw k0, PT_PAGEMASK(sp) // 0x18
  1314. mfc0 k0, CP0_CONFIG
  1315. - sw k0, 0x14(sp)
  1316. + sw k0, PT_CONFIG(sp) // 0x14
  1317. +
  1318. + .set macro
  1319. + .set at
  1320. +
  1321. + li t0, SYS_SLPPWR
  1322. + sw zero, 0(t0) /* Get the processor ready to sleep */
  1323. + sync
  1324. /* Now set up the scratch registers so the boot rom will
  1325. * return to this point upon wakeup.
  1326. + * sys_scratch0 : SP
  1327. + * sys_scratch1 : RA
  1328. + */
  1329. + li t0, SYS_SCRATCH0
  1330. + li t1, SYS_SCRATCH1
  1331. + sw sp, 0(t0)
  1332. + la k0, resume_from_sleep
  1333. + sw k0, 0(t1)
  1334. +
  1335. +/*
  1336. + * Flush DCACHE to make sure context is in memory
  1337. */
  1338. - la k0, 1f
  1339. - lui k1, 0xb190
  1340. - ori k1, 0x18
  1341. - sw sp, 0(k1)
  1342. - ori k1, 0x1c
  1343. - sw k0, 0(k1)
  1344. + la t1,___flush_cache_all /* _flush_cache_all is a function pointer */
  1345. + lw t0,0(t1)
  1346. + jal t0
  1347. + nop
  1348. /* Put SDRAM into self refresh. Preload instructions into cache,
  1349. * issue a precharge, then auto refresh, then sleep commands to it.
  1350. @@ -88,30 +126,65 @@ LEAF(save_and_sleep)
  1351. cache 0x14, 96(t0)
  1352. .set mips0
  1353. + /* Put SDRAM to sleep */
  1354. sdsleep:
  1355. - lui k0, 0xb400
  1356. - sw zero, 0x001c(k0) /* Precharge */
  1357. - sw zero, 0x0020(k0) /* Auto refresh */
  1358. - sw zero, 0x0030(k0) /* SDRAM sleep */
  1359. + li a0, MEM_PHYS_ADDR
  1360. + or a0, a0, 0xA0000000
  1361. +#if defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1100) || defined(CONFIG_SOC_AU1500)
  1362. + lw k0, MEM_SDMODE0(a0)
  1363. + sw zero, MEM_SDPRECMD(a0) /* Precharge */
  1364. + sw zero, MEM_SDAUTOREF(a0) /* Auto Refresh */
  1365. + sw zero, MEM_SDSLEEP(a0) /* Sleep */
  1366. sync
  1367. -
  1368. - lui k1, 0xb190
  1369. - sw zero, 0x0078(k1) /* get ready to sleep */
  1370. +#endif
  1371. +#if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
  1372. + sw zero, MEM_SDPRECMD(a0) /* Precharge */
  1373. + sw zero, MEM_SDSREF(a0)
  1374. +
  1375. + #lw t0, MEM_SDSTAT(a0)
  1376. + #and t0, t0, 0x01000000
  1377. + li t0, 0x01000000
  1378. +refresh_not_set:
  1379. + lw t1, MEM_SDSTAT(a0)
  1380. + and t2, t1, t0
  1381. + beq zero, t2, refresh_not_set
  1382. + nop
  1383. +
  1384. + li t0, ~0x30000000
  1385. + lw t1, MEM_SDCONFIGA(a0)
  1386. + and t1, t0, t1
  1387. + sw t1, MEM_SDCONFIGA(a0)
  1388. sync
  1389. - sw zero, 0x007c(k1) /* Put processor to sleep */
  1390. +#endif
  1391. +
  1392. + li t0, SYS_SLEEP
  1393. + sw zero, 0(t0) /* Put processor to sleep */
  1394. sync
  1395. + nop
  1396. + nop
  1397. + nop
  1398. + nop
  1399. + nop
  1400. + nop
  1401. + nop
  1402. + nop
  1403. +
  1404. /* This is where we return upon wakeup.
  1405. * Reload all of the registers and return.
  1406. */
  1407. -1: nop
  1408. - lw k0, 0x20(sp)
  1409. +resume_from_sleep:
  1410. + nop
  1411. + .set nomacro
  1412. + .set noat
  1413. +
  1414. + lw k0, PT_C0STATUS(sp) // 0x20
  1415. mtc0 k0, CP0_STATUS
  1416. - lw k0, 0x1c(sp)
  1417. + lw k0, PT_CONTEXT(sp) // 0x1c
  1418. mtc0 k0, CP0_CONTEXT
  1419. - lw k0, 0x18(sp)
  1420. + lw k0, PT_PAGEMASK(sp) // 0x18
  1421. mtc0 k0, CP0_PAGEMASK
  1422. - lw k0, 0x14(sp)
  1423. + lw k0, PT_CONFIG(sp) // 0x14
  1424. mtc0 k0, CP0_CONFIG
  1425. lw $1, PT_R1(sp)
  1426. lw $2, PT_R2(sp)
  1427. @@ -120,14 +193,6 @@ sdsleep:
  1428. lw $5, PT_R5(sp)
  1429. lw $6, PT_R6(sp)
  1430. lw $7, PT_R7(sp)
  1431. - lw $8, PT_R8(sp)
  1432. - lw $9, PT_R9(sp)
  1433. - lw $10, PT_R10(sp)
  1434. - lw $11, PT_R11(sp)
  1435. - lw $12, PT_R12(sp)
  1436. - lw $13, PT_R13(sp)
  1437. - lw $14, PT_R14(sp)
  1438. - lw $15, PT_R15(sp)
  1439. lw $16, PT_R16(sp)
  1440. lw $17, PT_R17(sp)
  1441. lw $18, PT_R18(sp)
  1442. @@ -136,15 +201,36 @@ sdsleep:
  1443. lw $21, PT_R21(sp)
  1444. lw $22, PT_R22(sp)
  1445. lw $23, PT_R23(sp)
  1446. - lw $24, PT_R24(sp)
  1447. - lw $25, PT_R25(sp)
  1448. - lw $26, PT_R26(sp)
  1449. - lw $27, PT_R27(sp)
  1450. lw $28, PT_R28(sp)
  1451. - lw $29, PT_R29(sp)
  1452. lw $30, PT_R30(sp)
  1453. lw $31, PT_R31(sp)
  1454. +
  1455. + .set macro
  1456. + .set at
  1457. +
  1458. + /* clear the wake source, but save it as the return value of the function */
  1459. + li t0, SYS_WAKESRC
  1460. + lw v0, 0(t0)
  1461. + sw v0, PT_R2(sp)
  1462. + sw zero, 0(t0)
  1463. +
  1464. addiu sp, PT_SIZE
  1465. + lw gp, save_and_sleep_frmsz-44(sp)
  1466. + lw s8, save_and_sleep_frmsz-40(sp)
  1467. + lw s7, save_and_sleep_frmsz-36(sp)
  1468. + lw s6, save_and_sleep_frmsz-32(sp)
  1469. + lw s5, save_and_sleep_frmsz-28(sp)
  1470. + lw s4, save_and_sleep_frmsz-24(sp)
  1471. + lw s3, save_and_sleep_frmsz-20(sp)
  1472. + lw s2, save_and_sleep_frmsz-16(sp)
  1473. + lw s1, save_and_sleep_frmsz-12(sp)
  1474. + lw s0, save_and_sleep_frmsz-8(sp)
  1475. + lw ra, save_and_sleep_frmsz-4(sp)
  1476. +
  1477. + addu sp, save_and_sleep_frmsz
  1478. jr ra
  1479. + nop
  1480. + .set reorder
  1481. END(save_and_sleep)
  1482. +
  1483. --- a/arch/mips/au1000/common/time.c
  1484. +++ b/arch/mips/au1000/common/time.c
  1485. @@ -50,7 +50,6 @@
  1486. #include <linux/mc146818rtc.h>
  1487. #include <linux/timex.h>
  1488. -extern void startup_match20_interrupt(void);
  1489. extern void do_softirq(void);
  1490. extern volatile unsigned long wall_jiffies;
  1491. unsigned long missed_heart_beats = 0;
  1492. @@ -59,14 +58,14 @@ static unsigned long r4k_offset; /* Amou
  1493. static unsigned long r4k_cur; /* What counter should be at next timer irq */
  1494. extern rwlock_t xtime_lock;
  1495. int no_au1xxx_32khz;
  1496. -void (*au1k_wait_ptr)(void);
  1497. +extern int allow_au1k_wait; /* default off for CP0 Counter */
  1498. /* Cycle counter value at the previous timer interrupt.. */
  1499. static unsigned int timerhi = 0, timerlo = 0;
  1500. #ifdef CONFIG_PM
  1501. #define MATCH20_INC 328
  1502. -extern void startup_match20_interrupt(void);
  1503. +extern void startup_match20_interrupt(void (*handler)(int, void *, struct pt_regs *));
  1504. static unsigned long last_pc0, last_match20;
  1505. #endif
  1506. @@ -385,7 +384,6 @@ void __init au1xxx_timer_setup(void)
  1507. {
  1508. unsigned int est_freq;
  1509. extern unsigned long (*do_gettimeoffset)(void);
  1510. - extern void au1k_wait(void);
  1511. printk("calculating r4koff... ");
  1512. r4k_offset = cal_r4koff();
  1513. @@ -437,9 +435,6 @@ void __init au1xxx_timer_setup(void)
  1514. au_writel(0, SYS_TOYWRITE);
  1515. while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C0S);
  1516. - au_writel(au_readl(SYS_WAKEMSK) | (1<<8), SYS_WAKEMSK);
  1517. - au_writel(~0, SYS_WAKESRC);
  1518. - au_sync();
  1519. while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20);
  1520. /* setup match20 to interrupt once every 10ms */
  1521. @@ -447,13 +442,13 @@ void __init au1xxx_timer_setup(void)
  1522. au_writel(last_match20 + MATCH20_INC, SYS_TOYMATCH2);
  1523. au_sync();
  1524. while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20);
  1525. - startup_match20_interrupt();
  1526. + startup_match20_interrupt(counter0_irq);
  1527. do_gettimeoffset = do_fast_pm_gettimeoffset;
  1528. /* We can use the real 'wait' instruction.
  1529. */
  1530. - au1k_wait_ptr = au1k_wait;
  1531. + allow_au1k_wait = 1;
  1532. }
  1533. #else
  1534. --- a/arch/mips/au1000/db1x00/board_setup.c
  1535. +++ b/arch/mips/au1000/db1x00/board_setup.c
  1536. @@ -46,10 +46,22 @@
  1537. #include <asm/au1000.h>
  1538. #include <asm/db1x00.h>
  1539. -extern struct rtc_ops no_rtc_ops;
  1540. +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX) && defined(CONFIG_MIPS_DB1550)
  1541. +#include <asm/au1xxx_dbdma.h>
  1542. +extern struct ide_ops *ide_ops;
  1543. +extern struct ide_ops au1xxx_ide_ops;
  1544. +extern u32 au1xxx_ide_virtbase;
  1545. +extern u64 au1xxx_ide_physbase;
  1546. +extern int au1xxx_ide_irq;
  1547. +
  1548. +/* Ddma */
  1549. +chan_tab_t *ide_read_ch, *ide_write_ch;
  1550. +u32 au1xxx_ide_ddma_enable = 0, switch4ddma = 1; // PIO+ddma
  1551. +
  1552. +dbdev_tab_t new_dbdev_tab_element = { DSCR_CMD0_THROTTLE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 };
  1553. +#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX */
  1554. -/* not correct for db1550 */
  1555. -static BCSR * const bcsr = (BCSR *)0xAE000000;
  1556. +extern struct rtc_ops no_rtc_ops;
  1557. void board_reset (void)
  1558. {
  1559. @@ -57,6 +69,13 @@ void board_reset (void)
  1560. au_writel(0x00000000, 0xAE00001C);
  1561. }
  1562. +void board_power_off (void)
  1563. +{
  1564. +#ifdef CONFIG_MIPS_MIRAGE
  1565. + au_writel((1 << 26) | (1 << 10), GPIO2_OUTPUT);
  1566. +#endif
  1567. +}
  1568. +
  1569. void __init board_setup(void)
  1570. {
  1571. u32 pin_func;
  1572. @@ -108,8 +127,42 @@ void __init board_setup(void)
  1573. au_writel(0x02000200, GPIO2_OUTPUT);
  1574. #endif
  1575. +#if defined(CONFIG_AU1XXX_SMC91111)
  1576. +#define CPLD_CONTROL (0xAF00000C)
  1577. + {
  1578. + extern uint32_t au1xxx_smc91111_base;
  1579. + extern unsigned int au1xxx_smc91111_irq;
  1580. + extern int au1xxx_smc91111_nowait;
  1581. +
  1582. + au1xxx_smc91111_base = 0xAC000300;
  1583. + au1xxx_smc91111_irq = AU1000_GPIO_8;
  1584. + au1xxx_smc91111_nowait = 1;
  1585. +
  1586. + /* set up the Static Bus timing - only 396Mhz */
  1587. + bcsr->resets |= 0x7;
  1588. + au_writel(0x00010003, MEM_STCFG0);
  1589. + au_writel(0x000c00c0, MEM_STCFG2);
  1590. + au_writel(0x85E1900D, MEM_STTIME2);
  1591. + }
  1592. +#endif /* end CONFIG_SMC91111 */
  1593. au_sync();
  1594. +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX) && defined(CONFIG_MIPS_DB1550)
  1595. + /*
  1596. + * Iniz IDE parameters
  1597. + */
  1598. + ide_ops = &au1xxx_ide_ops;
  1599. + au1xxx_ide_irq = DAUGHTER_CARD_IRQ;
  1600. + au1xxx_ide_physbase = AU1XXX_ATA_PHYS_ADDR;
  1601. + au1xxx_ide_virtbase = KSEG1ADDR(AU1XXX_ATA_PHYS_ADDR);
  1602. +
  1603. + /*
  1604. + * change PIO or PIO+Ddma
  1605. + * check the GPIO-6 pin condition. db1550:s6_dot
  1606. + */
  1607. + switch4ddma = (au_readl(SYS_PINSTATERD) & (1 << 6)) ? 1 : 0;
  1608. +#endif
  1609. +
  1610. #ifdef CONFIG_MIPS_DB1000
  1611. printk("AMD Alchemy Au1000/Db1000 Board\n");
  1612. #endif
  1613. --- a/arch/mips/au1000/db1x00/irqmap.c
  1614. +++ b/arch/mips/au1000/db1x00/irqmap.c
  1615. @@ -53,6 +53,7 @@ au1xxx_irq_map_t au1xxx_irq_map[] = {
  1616. #ifdef CONFIG_MIPS_DB1550
  1617. { AU1000_GPIO_3, INTC_INT_LOW_LEVEL, 0 }, // PCMCIA Card 0 IRQ#
  1618. { AU1000_GPIO_5, INTC_INT_LOW_LEVEL, 0 }, // PCMCIA Card 1 IRQ#
  1619. + { AU1000_GPIO_8, INTC_INT_LOW_LEVEL, 0 }, // Daughtercard IRQ#
  1620. #else
  1621. { AU1000_GPIO_0, INTC_INT_LOW_LEVEL, 0 }, // PCMCIA Card 0 Fully_Interted#
  1622. { AU1000_GPIO_1, INTC_INT_LOW_LEVEL, 0 }, // PCMCIA Card 0 STSCHG#
  1623. --- a/arch/mips/au1000/db1x00/Makefile
  1624. +++ b/arch/mips/au1000/db1x00/Makefile
  1625. @@ -17,4 +17,11 @@ O_TARGET := db1x00.o
  1626. obj-y := init.o board_setup.o irqmap.o
  1627. obj-$(CONFIG_WM97XX_COMODULE) += mirage_ts.o
  1628. +ifdef CONFIG_MIPS_DB1100
  1629. +ifdef CONFIG_MMC
  1630. +obj-y += mmc_support.o
  1631. +export-objs += mmc_support.o
  1632. +endif
  1633. +endif
  1634. +
  1635. include $(TOPDIR)/Rules.make
  1636. --- /dev/null
  1637. +++ b/arch/mips/au1000/db1x00/mmc_support.c
  1638. @@ -0,0 +1,126 @@
  1639. +/*
  1640. + * BRIEF MODULE DESCRIPTION
  1641. + *
  1642. + * MMC support routines for DB1100.
  1643. + *
  1644. + *
  1645. + * Copyright (c) 2003-2004 Embedded Edge, LLC.
  1646. + * Author: Embedded Edge, LLC.
  1647. + * Contact: [email protected]
  1648. + *
  1649. + * This program is free software; you can redistribute it and/or modify it
  1650. + * under the terms of the GNU General Public License as published by the
  1651. + * Free Software Foundation; either version 2 of the License, or (at your
  1652. + * option) any later version.
  1653. + *
  1654. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  1655. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  1656. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  1657. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  1658. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  1659. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  1660. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  1661. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  1662. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  1663. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  1664. + *
  1665. + * You should have received a copy of the GNU General Public License along
  1666. + * with this program; if not, write to the Free Software Foundation, Inc.,
  1667. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  1668. + *
  1669. + */
  1670. +
  1671. +
  1672. +#include <linux/config.h>
  1673. +#include <linux/kernel.h>
  1674. +#include <linux/module.h>
  1675. +#include <linux/init.h>
  1676. +
  1677. +#include <asm/irq.h>
  1678. +#include <asm/au1000.h>
  1679. +#include <asm/au1100_mmc.h>
  1680. +#include <asm/db1x00.h>
  1681. +
  1682. +
  1683. +/* SD/MMC controller support functions */
  1684. +
  1685. +/*
  1686. + * Detect card.
  1687. + */
  1688. +void mmc_card_inserted(int _n_, int *_res_)
  1689. +{
  1690. + u32 gpios = au_readl(SYS_PINSTATERD);
  1691. + u32 emptybit = (_n_) ? (1<<20) : (1<<19);
  1692. + *_res_ = ((gpios & emptybit) == 0);
  1693. +}
  1694. +
  1695. +/*
  1696. + * Check card write protection.
  1697. + */
  1698. +void mmc_card_writable(int _n_, int *_res_)
  1699. +{
  1700. + BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  1701. + unsigned long mmc_wp, board_specific;
  1702. +
  1703. + if (_n_) {
  1704. + mmc_wp = BCSR_BOARD_SD1_WP;
  1705. + } else {
  1706. + mmc_wp = BCSR_BOARD_SD0_WP;
  1707. + }
  1708. +
  1709. + board_specific = au_readl((unsigned long)(&bcsr->specific));
  1710. +
  1711. + if (!(board_specific & mmc_wp)) {/* low means card writable */
  1712. + *_res_ = 1;
  1713. + } else {
  1714. + *_res_ = 0;
  1715. + }
  1716. +}
  1717. +
  1718. +/*
  1719. + * Apply power to card slot.
  1720. + */
  1721. +void mmc_power_on(int _n_)
  1722. +{
  1723. + BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  1724. + unsigned long mmc_pwr, board_specific;
  1725. +
  1726. + if (_n_) {
  1727. + mmc_pwr = BCSR_BOARD_SD1_PWR;
  1728. + } else {
  1729. + mmc_pwr = BCSR_BOARD_SD0_PWR;
  1730. + }
  1731. +
  1732. + board_specific = au_readl((unsigned long)(&bcsr->specific));
  1733. + board_specific |= mmc_pwr;
  1734. +
  1735. + au_writel(board_specific, (int)(&bcsr->specific));
  1736. + au_sync_delay(1);
  1737. +}
  1738. +
  1739. +/*
  1740. + * Remove power from card slot.
  1741. + */
  1742. +void mmc_power_off(int _n_)
  1743. +{
  1744. + BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  1745. + unsigned long mmc_pwr, board_specific;
  1746. +
  1747. + if (_n_) {
  1748. + mmc_pwr = BCSR_BOARD_SD1_PWR;
  1749. + } else {
  1750. + mmc_pwr = BCSR_BOARD_SD0_PWR;
  1751. + }
  1752. +
  1753. + board_specific = au_readl((unsigned long)(&bcsr->specific));
  1754. + board_specific &= ~mmc_pwr;
  1755. +
  1756. + au_writel(board_specific, (int)(&bcsr->specific));
  1757. + au_sync_delay(1);
  1758. +}
  1759. +
  1760. +EXPORT_SYMBOL(mmc_card_inserted);
  1761. +EXPORT_SYMBOL(mmc_card_writable);
  1762. +EXPORT_SYMBOL(mmc_power_on);
  1763. +EXPORT_SYMBOL(mmc_power_off);
  1764. +
  1765. --- /dev/null
  1766. +++ b/arch/mips/au1000/ficmmp/au1200_ibutton.c
  1767. @@ -0,0 +1,270 @@
  1768. +/* ----------------------------------------------------------------------
  1769. + * mtwilson_keys.c
  1770. + *
  1771. + * Copyright (C) 2003 Intrinsyc Software Inc.
  1772. + *
  1773. + * Intel Personal Media Player buttons
  1774. + *
  1775. + * This program is free software; you can redistribute it and/or modify
  1776. + * it under the terms of the GNU General Public License version 2 as
  1777. + * published by the Free Software Foundation.
  1778. + *
  1779. + * May 02, 2003 : Initial version [FB]
  1780. + *
  1781. + ------------------------------------------------------------------------*/
  1782. +
  1783. +#include <linux/config.h>
  1784. +#include <linux/module.h>
  1785. +#include <linux/kernel.h>
  1786. +#include <linux/init.h>
  1787. +#include <linux/fs.h>
  1788. +#include <linux/sched.h>
  1789. +#include <linux/miscdevice.h>
  1790. +#include <linux/errno.h>
  1791. +#include <linux/poll.h>
  1792. +#include <linux/delay.h>
  1793. +#include <linux/input.h>
  1794. +
  1795. +#include <asm/au1000.h>
  1796. +#include <asm/uaccess.h>
  1797. +#include <asm/au1xxx_gpio.h>
  1798. +#include <asm/irq.h>
  1799. +#include <asm/keyboard.h>
  1800. +#include <linux/time.h>
  1801. +
  1802. +#define DRIVER_VERSION "V1.0"
  1803. +#define DRIVER_AUTHOR "FIC"
  1804. +#define DRIVER_DESC "FIC Travis Media Player Button Driver"
  1805. +#define DRIVER_NAME "Au1200Button"
  1806. +
  1807. +#define BUTTON_MAIN (1<<1)
  1808. +#define BUTTON_SELECT (1<<6)
  1809. +#define BUTTON_GUIDE (1<<12)
  1810. +#define BUTTON_DOWN (1<<17)
  1811. +#define BUTTON_LEFT (1<<19)
  1812. +#define BUTTON_RIGHT (1<<26)
  1813. +#define BUTTON_UP (1<<28)
  1814. +
  1815. +#define BUTTON_MASK (\
  1816. + BUTTON_MAIN \
  1817. + | BUTTON_SELECT \
  1818. + | BUTTON_GUIDE \
  1819. + | BUTTON_DOWN \
  1820. + | BUTTON_LEFT \
  1821. + | BUTTON_RIGHT \
  1822. + | BUTTON_UP \
  1823. + )
  1824. +
  1825. +#define BUTTON_INVERT (\
  1826. + BUTTON_MAIN \
  1827. + | 0 \
  1828. + | BUTTON_GUIDE \
  1829. + | 0 \
  1830. + | 0 \
  1831. + | 0 \
  1832. + | 0 \
  1833. + )
  1834. +
  1835. +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};
  1836. +//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};
  1837. +
  1838. +//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};
  1839. +//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};
  1840. +
  1841. +#define BUTTON_COUNT (sizeof (button_map) / sizeof (button_map[0]))
  1842. +
  1843. +struct input_dev dev;
  1844. +struct timeval cur_tv;
  1845. +
  1846. +static unsigned int old_tv_usec = 0;
  1847. +
  1848. +static unsigned int read_button_state(void)
  1849. +{
  1850. + unsigned int state;
  1851. +
  1852. + state = au_readl(SYS_PINSTATERD) & BUTTON_MASK; /* get gpio status */
  1853. +
  1854. + state ^= BUTTON_INVERT; /* invert main & guide button */
  1855. +
  1856. + /* printk("au1200_ibutton.c: button state [0x%X]\r\n",state); */
  1857. + return state;
  1858. +}
  1859. +
  1860. +//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
  1861. +static unsigned int bounce()
  1862. +{
  1863. +
  1864. + unsigned int elapsed_time;
  1865. +
  1866. + do_gettimeofday (&cur_tv);
  1867. +
  1868. + if (!old_tv_usec) {
  1869. + old_tv_usec = cur_tv.tv_usec;
  1870. + return 0;
  1871. + }
  1872. +
  1873. + if(cur_tv.tv_usec > old_tv_usec) {
  1874. + /* If there hasn't been rollover */
  1875. + elapsed_time = ((cur_tv.tv_usec - old_tv_usec));
  1876. + }
  1877. + else {
  1878. + /* Accounting for rollover */
  1879. + elapsed_time = ((1000000 - old_tv_usec + cur_tv.tv_usec));
  1880. + }
  1881. +
  1882. + if (elapsed_time > 250000) {
  1883. + old_tv_usec = 0; /* reset the bounce time */
  1884. + return 0;
  1885. + }
  1886. +
  1887. + return 1;
  1888. +}
  1889. +
  1890. +/* button interrupt handler */
  1891. +static void button_interrupt(int irq, void *dev, struct pt_regs *regs)
  1892. +{
  1893. +
  1894. + unsigned int i,bit_mask, key_choice;
  1895. + u32 button_state;
  1896. +
  1897. + /* Report state to upper level */
  1898. +
  1899. + button_state = read_button_state() & BUTTON_MASK; /* get new gpio status */
  1900. +
  1901. + /* Return if this is a repeated (bouncing) event */
  1902. + if(bounce())
  1903. + return;
  1904. +
  1905. + /* we want to make keystrokes */
  1906. + for( i=0; i< BUTTON_COUNT; i++) {
  1907. + bit_mask = 1<<i;
  1908. + if (button_state & bit_mask) {
  1909. + key_choice = button_map[i];
  1910. + /* toggle key down */
  1911. + input_report_key(dev, key_choice, 1);
  1912. + /* toggle key up */
  1913. + input_report_key(dev, key_choice, 0);
  1914. + printk("ibutton gpio %d stat %x scan code %d\r\n",
  1915. + i, button_state, key_choice);
  1916. + /* Only report the first key event; it doesn't make
  1917. + * sense for two keys to be pressed at the same time,
  1918. + * and causes problems with the directional keys
  1919. + * return;
  1920. + */
  1921. + }
  1922. + }
  1923. +}
  1924. +
  1925. +static int
  1926. +button_translate(unsigned char scancode, unsigned char *keycode, char raw_mode)
  1927. +{
  1928. + static int prev_scancode;
  1929. +
  1930. + printk( "ibutton.c: translate: scancode=%x raw_mode=%x\n",
  1931. + scancode, raw_mode);
  1932. +
  1933. + if (scancode == 0xe0 || scancode == 0xe1) {
  1934. + prev_scancode = scancode;
  1935. + return 0;
  1936. + }
  1937. +
  1938. + if (scancode == 0x00 || scancode == 0xff) {
  1939. + prev_scancode = 0;
  1940. + return 0;
  1941. + }
  1942. +
  1943. + *keycode = scancode;
  1944. +
  1945. + return 1;
  1946. +}
  1947. +
  1948. +/* init button hardware */
  1949. +static int button_hw_init(void)
  1950. +{
  1951. + unsigned int ipinfunc=0;
  1952. +
  1953. + printk("au1200_ibutton.c: Initializing buttons hardware\n");
  1954. +
  1955. + // initialize GPIO pin function assignments
  1956. +
  1957. + ipinfunc = au_readl(SYS_PINFUNC);
  1958. +
  1959. + ipinfunc &= ~(SYS_PINFUNC_DMA | SYS_PINFUNC_S0A | SYS_PINFUNC_S0B);
  1960. + au_writel( ipinfunc ,SYS_PINFUNC);
  1961. +
  1962. + ipinfunc |= (SYS_PINFUNC_S0C);
  1963. + au_writel( ipinfunc ,SYS_PINFUNC);
  1964. +
  1965. + return 0;
  1966. +}
  1967. +
  1968. +/* button driver init */
  1969. +static int __init button_init(void)
  1970. +{
  1971. + int ret, i;
  1972. + unsigned int flag=0;
  1973. +
  1974. + printk("au1200_ibutton.c: button_init()\r\n");
  1975. +
  1976. + button_hw_init();
  1977. +
  1978. + /* register all button irq handler */
  1979. +
  1980. + for(i=0; i< sizeof(button_map)/sizeof(button_map[0]); i++)
  1981. + {
  1982. + /* register irq <-- gpio 1 ,6 ,12 , 17 ,19 , 26 ,28 */
  1983. + if(button_map[i] != 0)
  1984. + {
  1985. + ret = request_irq(AU1000_GPIO_0 + i ,
  1986. + &button_interrupt , SA_INTERRUPT ,
  1987. + DRIVER_NAME , &dev);
  1988. + if(ret) flag |= 1<<i;
  1989. + }
  1990. + }
  1991. +
  1992. + printk("au1200_ibutton.c: request_irq,ret:0x%x\r\n",ret);
  1993. +
  1994. + if (ret) {
  1995. + printk("au1200_ibutton.c: request_irq:%X failed\r\n",flag);
  1996. + return ret;
  1997. + }
  1998. +
  1999. + dev.name = DRIVER_NAME;
  2000. + dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
  2001. +
  2002. + for (i=0;i<sizeof(button_map)/sizeof(button_map[0]);i++)
  2003. + {
  2004. + dev.keybit[LONG(button_map[i])] |= BIT(button_map[i]);
  2005. + }
  2006. +
  2007. + input_register_device(&dev);
  2008. +
  2009. + /* ready to receive interrupts */
  2010. +
  2011. + return 0;
  2012. +}
  2013. +
  2014. +/* button driver exit */
  2015. +static void __exit button_exit(void)
  2016. +{
  2017. + int i;
  2018. +
  2019. + for(i=0;i<sizeof(button_map)/sizeof(button_map[0]);i++)
  2020. + {
  2021. + if(button_map[i] != 0)
  2022. + {
  2023. + free_irq( AU1000_GPIO_0 + i, &dev);
  2024. + }
  2025. + }
  2026. +
  2027. + input_unregister_device(&dev);
  2028. +
  2029. + printk("au1200_ibutton.c: button_exit()\r\n");
  2030. +}
  2031. +
  2032. +module_init(button_init);
  2033. +module_exit(button_exit);
  2034. +
  2035. +MODULE_AUTHOR( DRIVER_AUTHOR );
  2036. +MODULE_DESCRIPTION( DRIVER_DESC );
  2037. +MODULE_LICENSE("GPL");
  2038. --- /dev/null
  2039. +++ b/arch/mips/au1000/ficmmp/au1xxx_dock.c
  2040. @@ -0,0 +1,261 @@
  2041. +/*
  2042. + * Copyright (C) 2003 Metrowerks, All Rights Reserved.
  2043. + *
  2044. + * This program is free software; you can redistribute it and/or modify
  2045. + * it under the terms of the GNU General Public License version 2 as
  2046. + * published by the Free Software Foundation.
  2047. + */
  2048. +
  2049. +#include <linux/config.h>
  2050. +#include <linux/module.h>
  2051. +#include <linux/init.h>
  2052. +#include <linux/fs.h>
  2053. +#include <linux/sched.h>
  2054. +#include <linux/miscdevice.h>
  2055. +#include <linux/errno.h>
  2056. +#include <linux/poll.h>
  2057. +#include <asm/au1000.h>
  2058. +#include <asm/uaccess.h>
  2059. +#include <asm/au1xxx_gpio.h>
  2060. +
  2061. +
  2062. +#if defined(CONFIG_MIPS_FICMMP)
  2063. + #define DOCK_GPIO 215
  2064. +#else
  2065. + #error Unsupported Au1xxx Platform
  2066. +#endif
  2067. +
  2068. +#define MAKE_FLAG 0x20
  2069. +
  2070. +#undef DEBUG
  2071. +
  2072. +#define DEBUG 0
  2073. +//#define DEBUG 1
  2074. +
  2075. +#if DEBUG
  2076. +#define DPRINTK(format, args...) printk(__FUNCTION__ ": " format, ## args)
  2077. +#else
  2078. +#define DPRINTK(format, args...) do { } while (0)
  2079. +#endif
  2080. +
  2081. +/* Please note that this driver is based on a timer and is not interrupt
  2082. + * driven. If you are going to make use of this driver, you will need to have
  2083. + * your application open the dock listing from the /dev directory first.
  2084. + */
  2085. +
  2086. +struct au1xxx_dock {
  2087. + struct fasync_struct *fasync;
  2088. + wait_queue_head_t read_wait;
  2089. + int open_count;
  2090. + unsigned int debounce;
  2091. + unsigned int current;
  2092. + unsigned int last;
  2093. +};
  2094. +
  2095. +static struct au1xxx_dock dock_info;
  2096. +
  2097. +
  2098. +static void dock_timer_periodic(void *data);
  2099. +
  2100. +static struct tq_struct dock_task = {
  2101. + routine: dock_timer_periodic,
  2102. + data: NULL
  2103. +};
  2104. +
  2105. +static int cleanup_flag = 0;
  2106. +static DECLARE_WAIT_QUEUE_HEAD(cleanup_wait_queue);
  2107. +
  2108. +
  2109. +static unsigned int read_dock_state(void)
  2110. +{
  2111. + u32 state;
  2112. +
  2113. + state = au1xxx_gpio_read(DOCK_GPIO);
  2114. +
  2115. + /* printk( "Current Dock State: %d\n", state ); */
  2116. +
  2117. + return state;
  2118. +}
  2119. +
  2120. +
  2121. +static void dock_timer_periodic(void *data)
  2122. +{
  2123. + struct au1xxx_dock *dock = (struct au1xxx_dock *)data;
  2124. + unsigned long dock_state;
  2125. +
  2126. + /* If cleanup wants us to die */
  2127. + if (cleanup_flag) {
  2128. + /* now cleanup_module can return */
  2129. + wake_up(&cleanup_wait_queue);
  2130. + } else {
  2131. + /* put ourselves back in the task queue */
  2132. + queue_task(&dock_task, &tq_timer);
  2133. + }
  2134. +
  2135. + /* read current dock */
  2136. + dock_state = read_dock_state();
  2137. +
  2138. + /* if dock states hasn't changed */
  2139. + /* save time and be done. */
  2140. + if (dock_state == dock->current) {
  2141. + return;
  2142. + }
  2143. +
  2144. + if (dock_state == dock->debounce) {
  2145. + dock->current = dock_state;
  2146. + } else {
  2147. + dock->debounce = dock_state;
  2148. + }
  2149. + if (dock->current != dock->last) {
  2150. + if (waitqueue_active(&dock->read_wait)) {
  2151. + wake_up_interruptible(&dock->read_wait);
  2152. + }
  2153. + }
  2154. +}
  2155. +
  2156. +
  2157. +static ssize_t au1xxx_dock_read(struct file *filp, char *buffer, size_t count, loff_t *ppos)
  2158. +{
  2159. + struct au1xxx_dock *dock = filp->private_data;
  2160. + char event[3];
  2161. + int last;
  2162. + int cur;
  2163. + int err;
  2164. +
  2165. +try_again:
  2166. +
  2167. + while (dock->current == dock->last) {
  2168. + if (filp->f_flags & O_NONBLOCK) {
  2169. + return -EAGAIN;
  2170. + }
  2171. + interruptible_sleep_on(&dock->read_wait);
  2172. + if (signal_pending(current)) {
  2173. + return -ERESTARTSYS;
  2174. + }
  2175. + }
  2176. +
  2177. + cur = dock->current;
  2178. + last = dock->last;
  2179. +
  2180. + if(cur != last)
  2181. + {
  2182. + event[0] = cur ? 'D' : 'U';
  2183. + event[1] = '\r';
  2184. + event[2] = '\n';
  2185. + }
  2186. + else
  2187. + goto try_again;
  2188. +
  2189. + dock->last = cur;
  2190. + err = copy_to_user(buffer, &event, 3);
  2191. + if (err) {
  2192. + return err;
  2193. + }
  2194. +
  2195. + return 3;
  2196. +}
  2197. +
  2198. +
  2199. +static int au1xxx_dock_open(struct inode *inode, struct file *filp)
  2200. +{
  2201. + struct au1xxx_dock *dock = &dock_info;
  2202. +
  2203. + MOD_INC_USE_COUNT;
  2204. +
  2205. + filp->private_data = dock;
  2206. +
  2207. + if (dock->open_count++ == 0) {
  2208. + dock_task.data = dock;
  2209. + cleanup_flag = 0;
  2210. + queue_task(&dock_task, &tq_timer);
  2211. + }
  2212. +
  2213. + return 0;
  2214. +}
  2215. +
  2216. +
  2217. +static unsigned int au1xxx_dock_poll(struct file *filp, poll_table *wait)
  2218. +{
  2219. + struct au1xxx_dock *dock = filp->private_data;
  2220. + int ret = 0;
  2221. +
  2222. + DPRINTK("start\n");
  2223. + poll_wait(filp, &dock->read_wait, wait);
  2224. + if (dock->current != dock->last) {
  2225. + ret = POLLIN | POLLRDNORM;
  2226. + }
  2227. + return ret;
  2228. +}
  2229. +
  2230. +
  2231. +static int au1xxx_dock_release(struct inode *inode, struct file *filp)
  2232. +{
  2233. + struct au1xxx_dock *dock = filp->private_data;
  2234. +
  2235. + DPRINTK("start\n");
  2236. +
  2237. + if (--dock->open_count == 0) {
  2238. + cleanup_flag = 1;
  2239. + sleep_on(&cleanup_wait_queue);
  2240. + }
  2241. + MOD_DEC_USE_COUNT;
  2242. +
  2243. + return 0;
  2244. +}
  2245. +
  2246. +
  2247. +
  2248. +static struct file_operations au1xxx_dock_fops = {
  2249. + owner: THIS_MODULE,
  2250. + read: au1xxx_dock_read,
  2251. + poll: au1xxx_dock_poll,
  2252. + open: au1xxx_dock_open,
  2253. + release: au1xxx_dock_release,
  2254. +};
  2255. +
  2256. +/*
  2257. + * The au1xxx dock is a misc device:
  2258. + * Major 10 char
  2259. + * Minor 22 /dev/dock
  2260. + *
  2261. + * This is /dev/misc/dock if devfs is used.
  2262. + */
  2263. +
  2264. +static struct miscdevice au1xxx_dock_dev = {
  2265. + minor: 23,
  2266. + name: "dock",
  2267. + fops: &au1xxx_dock_fops,
  2268. +};
  2269. +
  2270. +static int __init au1xxx_dock_init(void)
  2271. +{
  2272. + struct au1xxx_dock *dock = &dock_info;
  2273. + int ret;
  2274. +
  2275. + DPRINTK("Initializing dock driver\n");
  2276. + dock->open_count = 0;
  2277. + cleanup_flag = 0;
  2278. + init_waitqueue_head(&dock->read_wait);
  2279. +
  2280. +
  2281. + /* yamon configures GPIO pins for the dock
  2282. + * no initialization needed
  2283. + */
  2284. +
  2285. + ret = misc_register(&au1xxx_dock_dev);
  2286. +
  2287. + DPRINTK("dock driver fully initialized.\n");
  2288. +
  2289. + return ret;
  2290. +}
  2291. +
  2292. +
  2293. +static void __exit au1xxx_dock_exit(void)
  2294. +{
  2295. + DPRINTK("unloading dock driver\n");
  2296. + misc_deregister(&au1xxx_dock_dev);
  2297. +}
  2298. +
  2299. +
  2300. +module_init(au1xxx_dock_init);
  2301. +module_exit(au1xxx_dock_exit);
  2302. --- /dev/null
  2303. +++ b/arch/mips/au1000/ficmmp/board_setup.c
  2304. @@ -0,0 +1,226 @@
  2305. +/*
  2306. + *
  2307. + * BRIEF MODULE DESCRIPTION
  2308. + * Alchemy Pb1200 board setup.
  2309. + *
  2310. + * This program is free software; you can redistribute it and/or modify it
  2311. + * under the terms of the GNU General Public License as published by the
  2312. + * Free Software Foundation; either version 2 of the License, or (at your
  2313. + * option) any later version.
  2314. + *
  2315. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  2316. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  2317. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  2318. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  2319. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  2320. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  2321. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  2322. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  2323. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  2324. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2325. + *
  2326. + * You should have received a copy of the GNU General Public License along
  2327. + * with this program; if not, write to the Free Software Foundation, Inc.,
  2328. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  2329. + */
  2330. +#include <linux/config.h>
  2331. +#include <linux/init.h>
  2332. +#include <linux/sched.h>
  2333. +#include <linux/ioport.h>
  2334. +#include <linux/mm.h>
  2335. +#include <linux/console.h>
  2336. +#include <linux/mc146818rtc.h>
  2337. +#include <linux/delay.h>
  2338. +#include <linux/ide.h>
  2339. +
  2340. +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
  2341. +#include <linux/ide.h>
  2342. +#endif
  2343. +
  2344. +#include <asm/cpu.h>
  2345. +#include <asm/bootinfo.h>
  2346. +#include <asm/irq.h>
  2347. +#include <asm/keyboard.h>
  2348. +#include <asm/mipsregs.h>
  2349. +#include <asm/reboot.h>
  2350. +#include <asm/pgtable.h>
  2351. +#include <asm/au1000.h>
  2352. +#include <asm/ficmmp.h>
  2353. +#include <asm/au1xxx_dbdma.h>
  2354. +#include <asm/au1xxx_gpio.h>
  2355. +
  2356. +extern struct rtc_ops no_rtc_ops;
  2357. +
  2358. +/* value currently in the board configuration register */
  2359. +u16 ficmmp_config = 0;
  2360. +
  2361. +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
  2362. +extern struct ide_ops *ide_ops;
  2363. +extern struct ide_ops au1xxx_ide_ops;
  2364. +extern u32 au1xxx_ide_virtbase;
  2365. +extern u64 au1xxx_ide_physbase;
  2366. +extern int au1xxx_ide_irq;
  2367. +
  2368. +u32 led_base_addr;
  2369. +/* Ddma */
  2370. +chan_tab_t *ide_read_ch, *ide_write_ch;
  2371. +u32 au1xxx_ide_ddma_enable = 0, switch4ddma = 1; // PIO+ddma
  2372. +
  2373. +dbdev_tab_t new_dbdev_tab_element = { DSCR_CMD0_THROTTLE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 };
  2374. +#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX */
  2375. +
  2376. +void board_reset (void)
  2377. +{
  2378. + au_writel(0, 0xAD80001C);
  2379. +}
  2380. +
  2381. +void board_power_off (void)
  2382. +{
  2383. +}
  2384. +
  2385. +void __init board_setup(void)
  2386. +{
  2387. + char *argptr = NULL;
  2388. + u32 pin_func;
  2389. + rtc_ops = &no_rtc_ops;
  2390. +
  2391. + ficmmp_config_init(); //Initialize FIC control register
  2392. +
  2393. +#if 0
  2394. + /* Enable PSC1 SYNC for AC97. Normaly done in audio driver,
  2395. + * but it is board specific code, so put it here.
  2396. + */
  2397. + pin_func = au_readl(SYS_PINFUNC);
  2398. + au_sync();
  2399. + pin_func |= SYS_PF_MUST_BE_SET | SYS_PF_PSC1_S1;
  2400. + au_writel(pin_func, SYS_PINFUNC);
  2401. +
  2402. + au_writel(0, (u32)bcsr|0x10); /* turn off pcmcia power */
  2403. + au_sync();
  2404. +#endif
  2405. +
  2406. +#if defined( CONFIG_I2C_ALGO_AU1550 )
  2407. + {
  2408. + u32 freq0, clksrc;
  2409. +
  2410. + /* Select SMBUS in CPLD */
  2411. + /* bcsr->resets &= ~(BCSR_RESETS_PCS0MUX); */
  2412. +
  2413. + pin_func = au_readl(SYS_PINFUNC);
  2414. + au_sync();
  2415. + pin_func &= ~(3<<17 | 1<<4);
  2416. + /* Set GPIOs correctly */
  2417. + pin_func |= 2<<17;
  2418. + au_writel(pin_func, SYS_PINFUNC);
  2419. + au_sync();
  2420. +
  2421. + /* The i2c driver depends on 50Mhz clock */
  2422. + freq0 = au_readl(SYS_FREQCTRL0);
  2423. + au_sync();
  2424. + freq0 &= ~(SYS_FC_FRDIV1_MASK | SYS_FC_FS1 | SYS_FC_FE1);
  2425. + freq0 |= (3<<SYS_FC_FRDIV1_BIT);
  2426. + /* 396Mhz / (3+1)*2 == 49.5Mhz */
  2427. + au_writel(freq0, SYS_FREQCTRL0);
  2428. + au_sync();
  2429. + freq0 |= SYS_FC_FE1;
  2430. + au_writel(freq0, SYS_FREQCTRL0);
  2431. + au_sync();
  2432. +
  2433. + clksrc = au_readl(SYS_CLKSRC);
  2434. + au_sync();
  2435. + clksrc &= ~0x01f00000;
  2436. + /* bit 22 is EXTCLK0 for PSC0 */
  2437. + clksrc |= (0x3 << 22);
  2438. + au_writel(clksrc, SYS_CLKSRC);
  2439. + au_sync();
  2440. + }
  2441. +#endif
  2442. +
  2443. +#ifdef CONFIG_FB_AU1200
  2444. + argptr = prom_getcmdline();
  2445. + strcat(argptr, " video=au1200fb:");
  2446. +#endif
  2447. +
  2448. +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
  2449. + /*
  2450. + * Iniz IDE parameters
  2451. + */
  2452. + ide_ops = &au1xxx_ide_ops;
  2453. + au1xxx_ide_irq = FICMMP_IDE_INT;
  2454. + au1xxx_ide_physbase = AU1XXX_ATA_PHYS_ADDR;
  2455. + au1xxx_ide_virtbase = KSEG1ADDR(AU1XXX_ATA_PHYS_ADDR);
  2456. + switch4ddma = 0;
  2457. + /*
  2458. + ide_ops = &au1xxx_ide_ops;
  2459. + au1xxx_ide_irq = FICMMP_IDE_INT;
  2460. + au1xxx_ide_base = KSEG1ADDR(AU1XXX_ATA_BASE);
  2461. + */
  2462. + au1xxx_gpio_write(9, 1);
  2463. + printk("B4001010: %X\n", *((u32*)0xB4001010));
  2464. + printk("B4001014: %X\n", *((u32*)0xB4001014));
  2465. + printk("B4001018: %X\n", *((u32*)0xB4001018));
  2466. + printk("B1900100: %X\n", *((u32*)0xB1900100));
  2467. +
  2468. +#if 0
  2469. + ficmmp_config_clear(FICMMP_CONFIG_IDERST);
  2470. + mdelay(100);
  2471. + ficmmp_config_set(FICMMP_CONFIG_IDERST);
  2472. + mdelay(100);
  2473. +#endif
  2474. + /*
  2475. + * change PIO or PIO+Ddma
  2476. + * check the GPIO-5 pin condition. pb1200:s18_dot
  2477. + */
  2478. +/* switch4ddma = 0; //(au_readl(SYS_PINSTATERD) & (1 << 5)) ? 1 : 0; */
  2479. +#endif
  2480. +
  2481. + /* The Pb1200 development board uses external MUX for PSC0 to
  2482. + support SMB/SPI. bcsr->resets bit 12: 0=SMB 1=SPI
  2483. + */
  2484. +#if defined(CONFIG_AU1550_PSC_SPI) && defined(CONFIG_I2C_ALGO_AU1550)
  2485. + #error I2C and SPI are mutually exclusive. Both are physically connected to PSC0.\
  2486. + Refer to Pb1200 documentation.
  2487. +#elif defined( CONFIG_AU1550_PSC_SPI )
  2488. + //bcsr->resets |= BCSR_RESETS_PCS0MUX;
  2489. +#elif defined( CONFIG_I2C_ALGO_AU1550 )
  2490. + //bcsr->resets &= (~BCSR_RESETS_PCS0MUX);
  2491. +#endif
  2492. + au_sync();
  2493. +
  2494. + printk("FIC Multimedia Player Board\n");
  2495. + au1xxx_gpio_tristate(5);
  2496. + printk("B1900100: %X\n", *((volatile u32*)0xB1900100));
  2497. + printk("B190002C: %X\n", *((volatile u32*)0xB190002C));
  2498. +}
  2499. +
  2500. +int
  2501. +board_au1200fb_panel (void)
  2502. +{
  2503. + au1xxx_gpio_tristate(6);
  2504. +
  2505. + if (au1xxx_gpio_read(12) == 0)
  2506. + return 9; /* FS453_640x480 (Composite/S-Video) */
  2507. + else
  2508. + return 7; /* Sharp 320x240 TFT */
  2509. +}
  2510. +
  2511. +int
  2512. +board_au1200fb_panel_init (void)
  2513. +{
  2514. + /*Enable data buffers*/
  2515. + ficmmp_config_clear(FICMMP_CONFIG_LCMDATAOUT);
  2516. + /*Take LCD out of reset*/
  2517. + ficmmp_config_set(FICMMP_CONFIG_LCMPWREN | FICMMP_CONFIG_LCMEN);
  2518. + return 0;
  2519. +}
  2520. +
  2521. +int
  2522. +board_au1200fb_panel_shutdown (void)
  2523. +{
  2524. + /*Disable data buffers*/
  2525. + ficmmp_config_set(FICMMP_CONFIG_LCMDATAOUT);
  2526. + /*Put LCD in reset, remove power*/
  2527. + ficmmp_config_clear(FICMMP_CONFIG_LCMEN | FICMMP_CONFIG_LCMPWREN);
  2528. + return 0;
  2529. +}
  2530. +
  2531. --- /dev/null
  2532. +++ b/arch/mips/au1000/ficmmp/init.c
  2533. @@ -0,0 +1,76 @@
  2534. +/*
  2535. + *
  2536. + * BRIEF MODULE DESCRIPTION
  2537. + * PB1200 board setup
  2538. + *
  2539. + * This program is free software; you can redistribute it and/or modify it
  2540. + * under the terms of the GNU General Public License as published by the
  2541. + * Free Software Foundation; either version 2 of the License, or (at your
  2542. + * option) any later version.
  2543. + *
  2544. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  2545. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  2546. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  2547. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  2548. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  2549. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  2550. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  2551. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  2552. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  2553. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2554. + *
  2555. + * You should have received a copy of the GNU General Public License along
  2556. + * with this program; if not, write to the Free Software Foundation, Inc.,
  2557. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  2558. + */
  2559. +
  2560. +#include <linux/init.h>
  2561. +#include <linux/mm.h>
  2562. +#include <linux/sched.h>
  2563. +#include <linux/bootmem.h>
  2564. +#include <asm/addrspace.h>
  2565. +#include <asm/bootinfo.h>
  2566. +#include <linux/config.h>
  2567. +#include <linux/string.h>
  2568. +#include <linux/kernel.h>
  2569. +#include <linux/sched.h>
  2570. +
  2571. +int prom_argc;
  2572. +char **prom_argv, **prom_envp;
  2573. +extern void __init prom_init_cmdline(void);
  2574. +extern char *prom_getenv(char *envname);
  2575. +
  2576. +const char *get_system_type(void)
  2577. +{
  2578. + return "FIC Multimedia Player (Au1200)";
  2579. +}
  2580. +
  2581. +u32 mae_memsize = 0;
  2582. +
  2583. +int __init prom_init(int argc, char **argv, char **envp, int *prom_vec)
  2584. +{
  2585. + unsigned char *memsize_str;
  2586. + unsigned long memsize;
  2587. +
  2588. + prom_argc = argc;
  2589. + prom_argv = argv;
  2590. + prom_envp = envp;
  2591. +
  2592. + mips_machgroup = MACH_GROUP_ALCHEMY;
  2593. + mips_machtype = MACH_PB1000; /* set the platform # */
  2594. + prom_init_cmdline();
  2595. +
  2596. + memsize_str = prom_getenv("memsize");
  2597. + if (!memsize_str) {
  2598. + memsize = 0x08000000;
  2599. + } else {
  2600. + memsize = simple_strtol(memsize_str, NULL, 0);
  2601. + }
  2602. +
  2603. + /* reserved 32MB for MAE driver */
  2604. + memsize -= (32 * 1024 * 1024);
  2605. + add_memory_region(0, memsize, BOOT_MEM_RAM);
  2606. + mae_memsize = memsize; /* for drivers/char/au1xxx_mae.c */
  2607. + return 0;
  2608. +}
  2609. +
  2610. --- /dev/null
  2611. +++ b/arch/mips/au1000/ficmmp/irqmap.c
  2612. @@ -0,0 +1,61 @@
  2613. +/*
  2614. + * BRIEF MODULE DESCRIPTION
  2615. + * Au1xxx irq map table
  2616. + *
  2617. + * This program is free software; you can redistribute it and/or modify it
  2618. + * under the terms of the GNU General Public License as published by the
  2619. + * Free Software Foundation; either version 2 of the License, or (at your
  2620. + * option) any later version.
  2621. + *
  2622. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  2623. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  2624. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  2625. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  2626. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  2627. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  2628. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  2629. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  2630. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  2631. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2632. + *
  2633. + * You should have received a copy of the GNU General Public License along
  2634. + * with this program; if not, write to the Free Software Foundation, Inc.,
  2635. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  2636. + */
  2637. +#include <linux/errno.h>
  2638. +#include <linux/init.h>
  2639. +#include <linux/irq.h>
  2640. +#include <linux/kernel_stat.h>
  2641. +#include <linux/module.h>
  2642. +#include <linux/signal.h>
  2643. +#include <linux/sched.h>
  2644. +#include <linux/types.h>
  2645. +#include <linux/interrupt.h>
  2646. +#include <linux/ioport.h>
  2647. +#include <linux/timex.h>
  2648. +#include <linux/slab.h>
  2649. +#include <linux/random.h>
  2650. +#include <linux/delay.h>
  2651. +
  2652. +#include <asm/bitops.h>
  2653. +#include <asm/bootinfo.h>
  2654. +#include <asm/io.h>
  2655. +#include <asm/mipsregs.h>
  2656. +#include <asm/system.h>
  2657. +#include <asm/au1000.h>
  2658. +#include <asm/ficmmp.h>
  2659. +
  2660. +au1xxx_irq_map_t au1xxx_irq_map[] = {
  2661. + { FICMMP_IDE_INT, INTC_INT_HIGH_LEVEL, 0 },
  2662. + { AU1XXX_SMC91111_IRQ, INTC_INT_HIGH_LEVEL, 0 },
  2663. + { AU1000_GPIO_1 , INTC_INT_FALL_EDGE, 0 }, // main button
  2664. + { AU1000_GPIO_6 , INTC_INT_RISE_EDGE, 0 }, // select button
  2665. + { AU1000_GPIO_12, INTC_INT_FALL_EDGE, 0 }, // guide button
  2666. + { AU1000_GPIO_17, INTC_INT_RISE_EDGE, 0 }, // down button
  2667. + { AU1000_GPIO_19, INTC_INT_RISE_EDGE, 0 }, // left button
  2668. + { AU1000_GPIO_26, INTC_INT_RISE_EDGE, 0 }, // right button
  2669. + { AU1000_GPIO_28, INTC_INT_RISE_EDGE, 0 }, // up button
  2670. +};
  2671. +
  2672. +int au1xxx_nr_irqs = sizeof(au1xxx_irq_map)/sizeof(au1xxx_irq_map_t);
  2673. +
  2674. --- /dev/null
  2675. +++ b/arch/mips/au1000/ficmmp/Makefile
  2676. @@ -0,0 +1,25 @@
  2677. +#
  2678. +# Copyright 2000 MontaVista Software Inc.
  2679. +# Author: MontaVista Software, Inc.
  2680. +# [email protected] or [email protected]
  2681. +#
  2682. +# Makefile for the Alchemy Semiconductor FIC board.
  2683. +#
  2684. +# Note! Dependencies are done automagically by 'make dep', which also
  2685. +# removes any old dependencies. DON'T put your own dependencies here
  2686. +# unless it's something special (ie not a .c file).
  2687. +#
  2688. +
  2689. +USE_STANDARD_AS_RULE := true
  2690. +
  2691. +O_TARGET := ficmmp.o
  2692. +
  2693. +obj-y := init.o board_setup.o irqmap.o au1200_ibutton.o au1xxx_dock.o
  2694. +
  2695. +ifdef CONFIG_MMC
  2696. +obj-y += mmc_support.o
  2697. +export-objs +=mmc_support.o
  2698. +endif
  2699. +
  2700. +
  2701. +include $(TOPDIR)/Rules.make
  2702. --- a/arch/mips/au1000/hydrogen3/board_setup.c
  2703. +++ b/arch/mips/au1000/hydrogen3/board_setup.c
  2704. @@ -51,12 +51,19 @@ void board_reset (void)
  2705. {
  2706. }
  2707. +void board_power_off (void)
  2708. +{
  2709. +}
  2710. +
  2711. void __init board_setup(void)
  2712. {
  2713. u32 pin_func;
  2714. rtc_ops = &no_rtc_ops;
  2715. + /* Set GPIO14 high to make CD/DAT1 high for MMC to work */
  2716. + au_writel(1<<14, SYS_OUTPUTSET);
  2717. +
  2718. #ifdef CONFIG_AU1X00_USB_DEVICE
  2719. // 2nd USB port is USB device
  2720. pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x8000);
  2721. --- /dev/null
  2722. +++ b/arch/mips/au1000/hydrogen3/buttons.c
  2723. @@ -0,0 +1,308 @@
  2724. +/*
  2725. + * Copyright (C) 2003 Metrowerks, All Rights Reserved.
  2726. + *
  2727. + * This program is free software; you can redistribute it and/or modify
  2728. + * it under the terms of the GNU General Public License version 2 as
  2729. + * published by the Free Software Foundation.
  2730. + */
  2731. +
  2732. +#include <linux/config.h>
  2733. +#include <linux/module.h>
  2734. +#include <linux/init.h>
  2735. +#include <linux/fs.h>
  2736. +#include <linux/sched.h>
  2737. +#include <linux/miscdevice.h>
  2738. +#include <linux/errno.h>
  2739. +#include <linux/poll.h>
  2740. +#include <asm/au1000.h>
  2741. +#include <asm/uaccess.h>
  2742. +
  2743. +#define BUTTON_SELECT (1<<1)
  2744. +#define BUTTON_1 (1<<2)
  2745. +#define BUTTON_2 (1<<3)
  2746. +#define BUTTON_ONOFF (1<<6)
  2747. +#define BUTTON_3 (1<<7)
  2748. +#define BUTTON_4 (1<<8)
  2749. +#define BUTTON_LEFT (1<<9)
  2750. +#define BUTTON_DOWN (1<<10)
  2751. +#define BUTTON_RIGHT (1<<11)
  2752. +#define BUTTON_UP (1<<12)
  2753. +
  2754. +#define BUTTON_MASK (\
  2755. + BUTTON_SELECT \
  2756. + | BUTTON_1 \
  2757. + | BUTTON_2 \
  2758. + | BUTTON_ONOFF \
  2759. + | BUTTON_3 \
  2760. + | BUTTON_4 \
  2761. + | BUTTON_LEFT \
  2762. + | BUTTON_DOWN \
  2763. + | BUTTON_RIGHT \
  2764. + | BUTTON_UP \
  2765. + )
  2766. +
  2767. +#define BUTTON_INVERT (\
  2768. + BUTTON_SELECT \
  2769. + | BUTTON_1 \
  2770. + | BUTTON_2 \
  2771. + | BUTTON_3 \
  2772. + | BUTTON_4 \
  2773. + | BUTTON_LEFT \
  2774. + | BUTTON_DOWN \
  2775. + | BUTTON_RIGHT \
  2776. + | BUTTON_UP \
  2777. + )
  2778. +
  2779. +
  2780. +
  2781. +#define MAKE_FLAG 0x20
  2782. +
  2783. +#undef DEBUG
  2784. +
  2785. +#define DEBUG 0
  2786. +//#define DEBUG 1
  2787. +
  2788. +#if DEBUG
  2789. +#define DPRINTK(format, args...) printk(__FUNCTION__ ": " format, ## args)
  2790. +#else
  2791. +#define DPRINTK(format, args...) do { } while (0)
  2792. +#endif
  2793. +
  2794. +/* Please note that this driver is based on a timer and is not interrupt
  2795. + * driven. If you are going to make use of this driver, you will need to have
  2796. + * your application open the buttons listing from the /dev directory first.
  2797. + */
  2798. +
  2799. +struct hydrogen3_buttons {
  2800. + struct fasync_struct *fasync;
  2801. + wait_queue_head_t read_wait;
  2802. + int open_count;
  2803. + unsigned int debounce;
  2804. + unsigned int current;
  2805. + unsigned int last;
  2806. +};
  2807. +
  2808. +static struct hydrogen3_buttons buttons_info;
  2809. +
  2810. +
  2811. +static void button_timer_periodic(void *data);
  2812. +
  2813. +static struct tq_struct button_task = {
  2814. + routine: button_timer_periodic,
  2815. + data: NULL
  2816. +};
  2817. +
  2818. +static int cleanup_flag = 0;
  2819. +static DECLARE_WAIT_QUEUE_HEAD(cleanup_wait_queue);
  2820. +
  2821. +
  2822. +static unsigned int read_button_state(void)
  2823. +{
  2824. + unsigned long state;
  2825. +
  2826. + state = inl(SYS_PINSTATERD) & BUTTON_MASK;
  2827. + state ^= BUTTON_INVERT;
  2828. +
  2829. + DPRINTK( "Current Button State: %d\n", state );
  2830. +
  2831. + return state;
  2832. +}
  2833. +
  2834. +
  2835. +static void button_timer_periodic(void *data)
  2836. +{
  2837. + struct hydrogen3_buttons *buttons = (struct hydrogen3_buttons *)data;
  2838. + unsigned long button_state;
  2839. +
  2840. + // If cleanup wants us to die
  2841. + if (cleanup_flag) {
  2842. + wake_up(&cleanup_wait_queue); // now cleanup_module can return
  2843. + } else {
  2844. + queue_task(&button_task, &tq_timer); // put ourselves back in the task queue
  2845. + }
  2846. +
  2847. + // read current buttons
  2848. + button_state = read_button_state();
  2849. +
  2850. + // if no buttons are down and nothing to do then
  2851. + // save time and be done.
  2852. + if ((button_state == 0) && (buttons->current == 0)) {
  2853. + return;
  2854. + }
  2855. +
  2856. + if (button_state == buttons->debounce) {
  2857. + buttons->current = button_state;
  2858. + } else {
  2859. + buttons->debounce = button_state;
  2860. + }
  2861. +// printk("0x%04x\n", button_state);
  2862. + if (buttons->current != buttons->last) {
  2863. + if (waitqueue_active(&buttons->read_wait)) {
  2864. + wake_up_interruptible(&buttons->read_wait);
  2865. + }
  2866. + }
  2867. +}
  2868. +
  2869. +
  2870. +static ssize_t hydrogen3_buttons_read(struct file *filp, char *buffer, size_t count, loff_t *ppos)
  2871. +{
  2872. + struct hydrogen3_buttons *buttons = filp->private_data;
  2873. + char events[16];
  2874. + int index;
  2875. + int last;
  2876. + int cur;
  2877. + int bit;
  2878. + int bit_mask;
  2879. + int err;
  2880. +
  2881. + DPRINTK("start\n");
  2882. +
  2883. +try_again:
  2884. +
  2885. + while (buttons->current == buttons->last) {
  2886. + if (filp->f_flags & O_NONBLOCK) {
  2887. + return -EAGAIN;
  2888. + }
  2889. + interruptible_sleep_on(&buttons->read_wait);
  2890. + if (signal_pending(current)) {
  2891. + return -ERESTARTSYS;
  2892. + }
  2893. + }
  2894. +
  2895. + cur = buttons->current;
  2896. + last = buttons->last;
  2897. +
  2898. + index = 0;
  2899. + bit_mask = 1;
  2900. + for (bit = 0; (bit < 16) && count; bit++) {
  2901. + if ((cur ^ last) & bit_mask) {
  2902. + if (cur & bit_mask) {
  2903. + events[index] = (bit | MAKE_FLAG) + 'A';
  2904. + last |= bit_mask;
  2905. + } else {
  2906. + events[index] = bit + 'A';
  2907. + last &= ~bit_mask;
  2908. + }
  2909. + index++;
  2910. + count--;
  2911. + }
  2912. + bit_mask <<= 1;
  2913. + }
  2914. + buttons->last = last;
  2915. +
  2916. + if (index == 0) {
  2917. + goto try_again;
  2918. + }
  2919. +
  2920. + err = copy_to_user(buffer, events, index);
  2921. + if (err) {
  2922. + return err;
  2923. + }
  2924. +
  2925. + return index;
  2926. +}
  2927. +
  2928. +
  2929. +static int hydrogen3_buttons_open(struct inode *inode, struct file *filp)
  2930. +{
  2931. + struct hydrogen3_buttons *buttons = &buttons_info;
  2932. +
  2933. + DPRINTK("start\n");
  2934. + MOD_INC_USE_COUNT;
  2935. +
  2936. + filp->private_data = buttons;
  2937. +
  2938. + if (buttons->open_count++ == 0) {
  2939. + button_task.data = buttons;
  2940. + cleanup_flag = 0;
  2941. + queue_task(&button_task, &tq_timer);
  2942. + }
  2943. +
  2944. + return 0;
  2945. +}
  2946. +
  2947. +
  2948. +static unsigned int hydrogen3_buttons_poll(struct file *filp, poll_table *wait)
  2949. +{
  2950. + struct hydrogen3_buttons *buttons = filp->private_data;
  2951. + int ret = 0;
  2952. +
  2953. + DPRINTK("start\n");
  2954. + poll_wait(filp, &buttons->read_wait, wait);
  2955. + if (buttons->current != buttons->last) {
  2956. + ret = POLLIN | POLLRDNORM;
  2957. + }
  2958. + return ret;
  2959. +}
  2960. +
  2961. +
  2962. +static int hydrogen3_buttons_release(struct inode *inode, struct file *filp)
  2963. +{
  2964. + struct hydrogen3_buttons *buttons = filp->private_data;
  2965. +
  2966. + DPRINTK("start\n");
  2967. +
  2968. + if (--buttons->open_count == 0) {
  2969. + cleanup_flag = 1;
  2970. + sleep_on(&cleanup_wait_queue);
  2971. + }
  2972. + MOD_DEC_USE_COUNT;
  2973. +
  2974. + return 0;
  2975. +}
  2976. +
  2977. +
  2978. +
  2979. +static struct file_operations hydrogen3_buttons_fops = {
  2980. + owner: THIS_MODULE,
  2981. + read: hydrogen3_buttons_read,
  2982. + poll: hydrogen3_buttons_poll,
  2983. + open: hydrogen3_buttons_open,
  2984. + release: hydrogen3_buttons_release,
  2985. +};
  2986. +
  2987. +/*
  2988. + * The hydrogen3 buttons is a misc device:
  2989. + * Major 10 char
  2990. + * Minor 22 /dev/buttons
  2991. + *
  2992. + * This is /dev/misc/buttons if devfs is used.
  2993. + */
  2994. +
  2995. +static struct miscdevice hydrogen3_buttons_dev = {
  2996. + minor: 22,
  2997. + name: "buttons",
  2998. + fops: &hydrogen3_buttons_fops,
  2999. +};
  3000. +
  3001. +static int __init hydrogen3_buttons_init(void)
  3002. +{
  3003. + struct hydrogen3_buttons *buttons = &buttons_info;
  3004. + int ret;
  3005. +
  3006. + DPRINTK("Initializing buttons driver\n");
  3007. + buttons->open_count = 0;
  3008. + cleanup_flag = 0;
  3009. + init_waitqueue_head(&buttons->read_wait);
  3010. +
  3011. +
  3012. + // yamon configures GPIO pins for the buttons
  3013. + // no initialization needed
  3014. +
  3015. + ret = misc_register(&hydrogen3_buttons_dev);
  3016. +
  3017. + DPRINTK("Buttons driver fully initialized.\n");
  3018. +
  3019. + return ret;
  3020. +}
  3021. +
  3022. +
  3023. +static void __exit hydrogen3_buttons_exit(void)
  3024. +{
  3025. + DPRINTK("unloading buttons driver\n");
  3026. + misc_deregister(&hydrogen3_buttons_dev);
  3027. +}
  3028. +
  3029. +
  3030. +module_init(hydrogen3_buttons_init);
  3031. +module_exit(hydrogen3_buttons_exit);
  3032. --- a/arch/mips/au1000/hydrogen3/Makefile
  3033. +++ b/arch/mips/au1000/hydrogen3/Makefile
  3034. @@ -14,6 +14,11 @@ USE_STANDARD_AS_RULE := true
  3035. O_TARGET := hydrogen3.o
  3036. -obj-y := init.o board_setup.o irqmap.o
  3037. +obj-y := init.o board_setup.o irqmap.o buttons.o
  3038. +
  3039. +ifdef CONFIG_MMC
  3040. +obj-y += mmc_support.o
  3041. +export-objs +=mmc_support.o
  3042. +endif
  3043. include $(TOPDIR)/Rules.make
  3044. --- /dev/null
  3045. +++ b/arch/mips/au1000/hydrogen3/mmc_support.c
  3046. @@ -0,0 +1,89 @@
  3047. +/*
  3048. + * BRIEF MODULE DESCRIPTION
  3049. + *
  3050. + * MMC support routines for Hydrogen3.
  3051. + *
  3052. + *
  3053. + * Copyright (c) 2003-2004 Embedded Edge, LLC.
  3054. + * Author: Embedded Edge, LLC.
  3055. + * Contact: [email protected]
  3056. + *
  3057. + * This program is free software; you can redistribute it and/or modify it
  3058. + * under the terms of the GNU General Public License as published by the
  3059. + * Free Software Foundation; either version 2 of the License, or (at your
  3060. + * option) any later version.
  3061. + *
  3062. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  3063. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  3064. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  3065. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  3066. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  3067. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  3068. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  3069. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  3070. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  3071. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3072. + *
  3073. + * You should have received a copy of the GNU General Public License along
  3074. + * with this program; if not, write to the Free Software Foundation, Inc.,
  3075. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  3076. + *
  3077. + */
  3078. +
  3079. +
  3080. +#include <linux/config.h>
  3081. +#include <linux/kernel.h>
  3082. +#include <linux/module.h>
  3083. +#include <linux/init.h>
  3084. +
  3085. +#include <asm/irq.h>
  3086. +#include <asm/au1000.h>
  3087. +#include <asm/au1100_mmc.h>
  3088. +
  3089. +#define GPIO_17_WP 0x20000
  3090. +
  3091. +/* SD/MMC controller support functions */
  3092. +
  3093. +/*
  3094. + * Detect card.
  3095. + */
  3096. +void mmc_card_inserted(int _n_, int *_res_)
  3097. +{
  3098. + u32 gpios = au_readl(SYS_PINSTATERD);
  3099. + u32 emptybit = (1<<16);
  3100. + *_res_ = ((gpios & emptybit) == 0);
  3101. +}
  3102. +
  3103. +/*
  3104. + * Check card write protection.
  3105. + */
  3106. +void mmc_card_writable(int _n_, int *_res_)
  3107. +{
  3108. + unsigned long mmc_wp, board_specific;
  3109. + board_specific = au_readl(SYS_OUTPUTSET);
  3110. + mmc_wp=GPIO_17_WP;
  3111. + if (!(board_specific & mmc_wp)) {/* low means card writable */
  3112. + *_res_ = 1;
  3113. + } else {
  3114. + *_res_ = 0;
  3115. + }
  3116. +}
  3117. +/*
  3118. + * Apply power to card slot.
  3119. + */
  3120. +void mmc_power_on(int _n_)
  3121. +{
  3122. +}
  3123. +
  3124. +/*
  3125. + * Remove power from card slot.
  3126. + */
  3127. +void mmc_power_off(int _n_)
  3128. +{
  3129. +}
  3130. +
  3131. +EXPORT_SYMBOL(mmc_card_inserted);
  3132. +EXPORT_SYMBOL(mmc_card_writable);
  3133. +EXPORT_SYMBOL(mmc_power_on);
  3134. +EXPORT_SYMBOL(mmc_power_off);
  3135. +
  3136. --- a/arch/mips/au1000/mtx-1/board_setup.c
  3137. +++ b/arch/mips/au1000/mtx-1/board_setup.c
  3138. @@ -48,6 +48,12 @@
  3139. extern struct rtc_ops no_rtc_ops;
  3140. +void board_reset (void)
  3141. +{
  3142. + /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
  3143. + au_writel(0x00000000, 0xAE00001C);
  3144. +}
  3145. +
  3146. void __init board_setup(void)
  3147. {
  3148. rtc_ops = &no_rtc_ops;
  3149. --- a/arch/mips/au1000/mtx-1/irqmap.c
  3150. +++ b/arch/mips/au1000/mtx-1/irqmap.c
  3151. @@ -72,10 +72,10 @@ au1xxx_pci_irqmap(struct pci_dev *dev, u
  3152. * A B C D
  3153. */
  3154. {
  3155. - {INTA, INTB, INTC, INTD}, /* IDSEL 0 */
  3156. - {INTA, INTB, INTC, INTD}, /* IDSEL 1 */
  3157. - {INTA, INTB, INTC, INTD}, /* IDSEL 2 */
  3158. - {INTA, INTB, INTC, INTD}, /* IDSEL 3 */
  3159. + {INTA, INTB, INTX, INTX}, /* IDSEL 0 */
  3160. + {INTB, INTA, INTX, INTX}, /* IDSEL 1 */
  3161. + {INTC, INTD, INTX, INTX}, /* IDSEL 2 */
  3162. + {INTD, INTC, INTX, INTX}, /* IDSEL 3 */
  3163. };
  3164. const long min_idsel = 0, max_idsel = 3, irqs_per_slot = 4;
  3165. return PCI_IRQ_TABLE_LOOKUP;
  3166. --- a/arch/mips/au1000/pb1000/board_setup.c
  3167. +++ b/arch/mips/au1000/pb1000/board_setup.c
  3168. @@ -58,6 +58,10 @@ void board_reset (void)
  3169. {
  3170. }
  3171. +void board_power_off (void)
  3172. +{
  3173. +}
  3174. +
  3175. void __init board_setup(void)
  3176. {
  3177. u32 pin_func, static_cfg0;
  3178. --- a/arch/mips/au1000/pb1100/board_setup.c
  3179. +++ b/arch/mips/au1000/pb1100/board_setup.c
  3180. @@ -62,6 +62,10 @@ void board_reset (void)
  3181. au_writel(0x00000000, 0xAE00001C);
  3182. }
  3183. +void board_power_off (void)
  3184. +{
  3185. +}
  3186. +
  3187. void __init board_setup(void)
  3188. {
  3189. u32 pin_func;
  3190. --- a/arch/mips/au1000/pb1100/Makefile
  3191. +++ b/arch/mips/au1000/pb1100/Makefile
  3192. @@ -16,4 +16,10 @@ O_TARGET := pb1100.o
  3193. obj-y := init.o board_setup.o irqmap.o
  3194. +
  3195. +ifdef CONFIG_MMC
  3196. +obj-y += mmc_support.o
  3197. +export-objs += mmc_support.o
  3198. +endif
  3199. +
  3200. include $(TOPDIR)/Rules.make
  3201. --- /dev/null
  3202. +++ b/arch/mips/au1000/pb1100/mmc_support.c
  3203. @@ -0,0 +1,126 @@
  3204. +/*
  3205. + * BRIEF MODULE DESCRIPTION
  3206. + *
  3207. + * MMC support routines for PB1100.
  3208. + *
  3209. + *
  3210. + * Copyright (c) 2003-2004 Embedded Edge, LLC.
  3211. + * Author: Embedded Edge, LLC.
  3212. + * Contact: [email protected]
  3213. + *
  3214. + * This program is free software; you can redistribute it and/or modify it
  3215. + * under the terms of the GNU General Public License as published by the
  3216. + * Free Software Foundation; either version 2 of the License, or (at your
  3217. + * option) any later version.
  3218. + *
  3219. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  3220. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  3221. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  3222. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  3223. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  3224. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  3225. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  3226. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  3227. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  3228. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3229. + *
  3230. + * You should have received a copy of the GNU General Public License along
  3231. + * with this program; if not, write to the Free Software Foundation, Inc.,
  3232. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  3233. + *
  3234. + */
  3235. +
  3236. +
  3237. +#include <linux/config.h>
  3238. +#include <linux/kernel.h>
  3239. +#include <linux/module.h>
  3240. +#include <linux/init.h>
  3241. +
  3242. +#include <asm/irq.h>
  3243. +#include <asm/au1000.h>
  3244. +#include <asm/au1100_mmc.h>
  3245. +#include <asm/pb1100.h>
  3246. +
  3247. +
  3248. +/* SD/MMC controller support functions */
  3249. +
  3250. +/*
  3251. + * Detect card.
  3252. + */
  3253. +void mmc_card_inserted(int _n_, int *_res_)
  3254. +{
  3255. + u32 gpios = au_readl(SYS_PINSTATERD);
  3256. + u32 emptybit = (_n_) ? (1<<15) : (1<<14);
  3257. + *_res_ = ((gpios & emptybit) == 0);
  3258. +}
  3259. +
  3260. +/*
  3261. + * Check card write protection.
  3262. + */
  3263. +void mmc_card_writable(int _n_, int *_res_)
  3264. +{
  3265. + BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  3266. + unsigned long mmc_wp, board_specific;
  3267. +
  3268. + if (_n_) {
  3269. + mmc_wp = BCSR_PCMCIA_SD1_WP;
  3270. + } else {
  3271. + mmc_wp = BCSR_PCMCIA_SD0_WP;
  3272. + }
  3273. +
  3274. + board_specific = au_readl((unsigned long)(&bcsr->pcmcia));
  3275. +
  3276. + if (!(board_specific & mmc_wp)) {/* low means card writable */
  3277. + *_res_ = 1;
  3278. + } else {
  3279. + *_res_ = 0;
  3280. + }
  3281. +}
  3282. +
  3283. +/*
  3284. + * Apply power to card slot.
  3285. + */
  3286. +void mmc_power_on(int _n_)
  3287. +{
  3288. + BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  3289. + unsigned long mmc_pwr, board_specific;
  3290. +
  3291. + if (_n_) {
  3292. + mmc_pwr = BCSR_PCMCIA_SD1_PWR;
  3293. + } else {
  3294. + mmc_pwr = BCSR_PCMCIA_SD0_PWR;
  3295. + }
  3296. +
  3297. + board_specific = au_readl((unsigned long)(&bcsr->pcmcia));
  3298. + board_specific |= mmc_pwr;
  3299. +
  3300. + au_writel(board_specific, (int)(&bcsr->pcmcia));
  3301. + au_sync_delay(1);
  3302. +}
  3303. +
  3304. +/*
  3305. + * Remove power from card slot.
  3306. + */
  3307. +void mmc_power_off(int _n_)
  3308. +{
  3309. + BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  3310. + unsigned long mmc_pwr, board_specific;
  3311. +
  3312. + if (_n_) {
  3313. + mmc_pwr = BCSR_PCMCIA_SD1_PWR;
  3314. + } else {
  3315. + mmc_pwr = BCSR_PCMCIA_SD0_PWR;
  3316. + }
  3317. +
  3318. + board_specific = au_readl((unsigned long)(&bcsr->pcmcia));
  3319. + board_specific &= ~mmc_pwr;
  3320. +
  3321. + au_writel(board_specific, (int)(&bcsr->pcmcia));
  3322. + au_sync_delay(1);
  3323. +}
  3324. +
  3325. +EXPORT_SYMBOL(mmc_card_inserted);
  3326. +EXPORT_SYMBOL(mmc_card_writable);
  3327. +EXPORT_SYMBOL(mmc_power_on);
  3328. +EXPORT_SYMBOL(mmc_power_off);
  3329. +
  3330. --- /dev/null
  3331. +++ b/arch/mips/au1000/pb1200/board_setup.c
  3332. @@ -0,0 +1,221 @@
  3333. +/*
  3334. + *
  3335. + * BRIEF MODULE DESCRIPTION
  3336. + * Alchemy Pb1200 board setup.
  3337. + *
  3338. + * This program is free software; you can redistribute it and/or modify it
  3339. + * under the terms of the GNU General Public License as published by the
  3340. + * Free Software Foundation; either version 2 of the License, or (at your
  3341. + * option) any later version.
  3342. + *
  3343. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  3344. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  3345. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  3346. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  3347. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  3348. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  3349. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  3350. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  3351. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  3352. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3353. + *
  3354. + * You should have received a copy of the GNU General Public License along
  3355. + * with this program; if not, write to the Free Software Foundation, Inc.,
  3356. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  3357. + */
  3358. +#include <linux/config.h>
  3359. +#include <linux/init.h>
  3360. +#include <linux/sched.h>
  3361. +#include <linux/ioport.h>
  3362. +#include <linux/mm.h>
  3363. +#include <linux/console.h>
  3364. +#include <linux/mc146818rtc.h>
  3365. +#include <linux/delay.h>
  3366. +
  3367. +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
  3368. +#include <linux/ide.h>
  3369. +#endif
  3370. +
  3371. +#include <asm/cpu.h>
  3372. +#include <asm/bootinfo.h>
  3373. +#include <asm/irq.h>
  3374. +#include <asm/keyboard.h>
  3375. +#include <asm/mipsregs.h>
  3376. +#include <asm/reboot.h>
  3377. +#include <asm/pgtable.h>
  3378. +#include <asm/au1000.h>
  3379. +#include <asm/au1xxx_dbdma.h>
  3380. +
  3381. +#ifdef CONFIG_MIPS_PB1200
  3382. +#include <asm/pb1200.h>
  3383. +#endif
  3384. +
  3385. +#ifdef CONFIG_MIPS_DB1200
  3386. +#include <asm/db1200.h>
  3387. +#define PB1200_ETH_INT DB1200_ETH_INT
  3388. +#define PB1200_IDE_INT DB1200_IDE_INT
  3389. +#endif
  3390. +
  3391. +extern struct rtc_ops no_rtc_ops;
  3392. +
  3393. +extern void _board_init_irq(void);
  3394. +extern void (*board_init_irq)(void);
  3395. +
  3396. +#ifdef CONFIG_BLK_DEV_IDE_AU1XXX
  3397. +extern struct ide_ops *ide_ops;
  3398. +extern struct ide_ops au1xxx_ide_ops;
  3399. +extern u32 au1xxx_ide_virtbase;
  3400. +extern u64 au1xxx_ide_physbase;
  3401. +extern int au1xxx_ide_irq;
  3402. +
  3403. +u32 led_base_addr;
  3404. +/* Ddma */
  3405. +chan_tab_t *ide_read_ch, *ide_write_ch;
  3406. +u32 au1xxx_ide_ddma_enable = 0, switch4ddma = 1; // PIO+ddma
  3407. +
  3408. +dbdev_tab_t new_dbdev_tab_element = { DSCR_CMD0_THROTTLE, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 };
  3409. +#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX */
  3410. +
  3411. +void board_reset (void)
  3412. +{
  3413. + bcsr->resets = 0;
  3414. +}
  3415. +
  3416. +void board_power_off (void)
  3417. +{
  3418. + bcsr->resets = 0xC000;
  3419. +}
  3420. +
  3421. +void __init board_setup(void)
  3422. +{
  3423. + char *argptr = NULL;
  3424. + u32 pin_func;
  3425. + rtc_ops = &no_rtc_ops;
  3426. +
  3427. +#if 0
  3428. + /* Enable PSC1 SYNC for AC97. Normaly done in audio driver,
  3429. + * but it is board specific code, so put it here.
  3430. + */
  3431. + pin_func = au_readl(SYS_PINFUNC);
  3432. + au_sync();
  3433. + pin_func |= SYS_PF_MUST_BE_SET | SYS_PF_PSC1_S1;
  3434. + au_writel(pin_func, SYS_PINFUNC);
  3435. +
  3436. + au_writel(0, (u32)bcsr|0x10); /* turn off pcmcia power */
  3437. + au_sync();
  3438. +#endif
  3439. +
  3440. +#if defined( CONFIG_I2C_ALGO_AU1550 )
  3441. + {
  3442. + u32 freq0, clksrc;
  3443. +
  3444. + /* Select SMBUS in CPLD */
  3445. + bcsr->resets &= ~(BCSR_RESETS_PCS0MUX);
  3446. +
  3447. + pin_func = au_readl(SYS_PINFUNC);
  3448. + au_sync();
  3449. + pin_func &= ~(3<<17 | 1<<4);
  3450. + /* Set GPIOs correctly */
  3451. + pin_func |= 2<<17;
  3452. + au_writel(pin_func, SYS_PINFUNC);
  3453. + au_sync();
  3454. +
  3455. + /* The i2c driver depends on 50Mhz clock */
  3456. + freq0 = au_readl(SYS_FREQCTRL0);
  3457. + au_sync();
  3458. + freq0 &= ~(SYS_FC_FRDIV1_MASK | SYS_FC_FS1 | SYS_FC_FE1);
  3459. + freq0 |= (3<<SYS_FC_FRDIV1_BIT);
  3460. + /* 396Mhz / (3+1)*2 == 49.5Mhz */
  3461. + au_writel(freq0, SYS_FREQCTRL0);
  3462. + au_sync();
  3463. + freq0 |= SYS_FC_FE1;
  3464. + au_writel(freq0, SYS_FREQCTRL0);
  3465. + au_sync();
  3466. +
  3467. + clksrc = au_readl(SYS_CLKSRC);
  3468. + au_sync();
  3469. + clksrc &= ~0x01f00000;
  3470. + /* bit 22 is EXTCLK0 for PSC0 */
  3471. + clksrc |= (0x3 << 22);
  3472. + au_writel(clksrc, SYS_CLKSRC);
  3473. + au_sync();
  3474. + }
  3475. +#endif
  3476. +
  3477. +#ifdef CONFIG_FB_AU1200
  3478. + argptr = prom_getcmdline();
  3479. + strcat(argptr, " video=au1200fb:");
  3480. +#endif
  3481. +
  3482. +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
  3483. + /*
  3484. + * Iniz IDE parameters
  3485. + */
  3486. + ide_ops = &au1xxx_ide_ops;
  3487. + au1xxx_ide_irq = PB1200_IDE_INT;
  3488. + au1xxx_ide_physbase = AU1XXX_ATA_PHYS_ADDR;
  3489. + au1xxx_ide_virtbase = KSEG1ADDR(AU1XXX_ATA_PHYS_ADDR);
  3490. + /*
  3491. + * change PIO or PIO+Ddma
  3492. + * check the GPIO-5 pin condition. pb1200:s18_dot */
  3493. + switch4ddma = (au_readl(SYS_PINSTATERD) & (1 << 5)) ? 1 : 0;
  3494. +#endif
  3495. +
  3496. + /* The Pb1200 development board uses external MUX for PSC0 to
  3497. + support SMB/SPI. bcsr->resets bit 12: 0=SMB 1=SPI
  3498. + */
  3499. +#if defined(CONFIG_AU1550_PSC_SPI) && defined(CONFIG_I2C_ALGO_AU1550)
  3500. + #error I2C and SPI are mutually exclusive. Both are physically connected to PSC0.\
  3501. + Refer to Pb1200/Db1200 documentation.
  3502. +#elif defined( CONFIG_AU1550_PSC_SPI )
  3503. + bcsr->resets |= BCSR_RESETS_PCS0MUX;
  3504. +#elif defined( CONFIG_I2C_ALGO_AU1550 )
  3505. + bcsr->resets &= (~BCSR_RESETS_PCS0MUX);
  3506. +#endif
  3507. + au_sync();
  3508. +
  3509. +#ifdef CONFIG_MIPS_PB1200
  3510. + printk("AMD Alchemy Pb1200 Board\n");
  3511. +#endif
  3512. +#ifdef CONFIG_MIPS_DB1200
  3513. + printk("AMD Alchemy Db1200 Board\n");
  3514. +#endif
  3515. +
  3516. + /* Setup Pb1200 External Interrupt Controller */
  3517. + {
  3518. + extern void (*board_init_irq)(void);
  3519. + extern void _board_init_irq(void);
  3520. + board_init_irq = _board_init_irq;
  3521. + }
  3522. +}
  3523. +
  3524. +int
  3525. +board_au1200fb_panel (void)
  3526. +{
  3527. + BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  3528. + int p;
  3529. +
  3530. + p = bcsr->switches;
  3531. + p >>= 8;
  3532. + p &= 0x0F;
  3533. + return p;
  3534. +}
  3535. +
  3536. +int
  3537. +board_au1200fb_panel_init (void)
  3538. +{
  3539. + /* Apply power */
  3540. + BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  3541. + bcsr->board |= (BCSR_BOARD_LCDVEE | BCSR_BOARD_LCDVDD | BCSR_BOARD_LCDBL);
  3542. + return 0;
  3543. +}
  3544. +
  3545. +int
  3546. +board_au1200fb_panel_shutdown (void)
  3547. +{
  3548. + /* Remove power */
  3549. + BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  3550. + bcsr->board &= ~(BCSR_BOARD_LCDVEE | BCSR_BOARD_LCDVDD | BCSR_BOARD_LCDBL);
  3551. + return 0;
  3552. +}
  3553. +
  3554. --- /dev/null
  3555. +++ b/arch/mips/au1000/pb1200/init.c
  3556. @@ -0,0 +1,72 @@
  3557. +/*
  3558. + *
  3559. + * BRIEF MODULE DESCRIPTION
  3560. + * PB1200 board setup
  3561. + *
  3562. + * This program is free software; you can redistribute it and/or modify it
  3563. + * under the terms of the GNU General Public License as published by the
  3564. + * Free Software Foundation; either version 2 of the License, or (at your
  3565. + * option) any later version.
  3566. + *
  3567. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  3568. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  3569. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  3570. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  3571. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  3572. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  3573. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  3574. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  3575. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  3576. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3577. + *
  3578. + * You should have received a copy of the GNU General Public License along
  3579. + * with this program; if not, write to the Free Software Foundation, Inc.,
  3580. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  3581. + */
  3582. +
  3583. +#include <linux/init.h>
  3584. +#include <linux/mm.h>
  3585. +#include <linux/sched.h>
  3586. +#include <linux/bootmem.h>
  3587. +#include <asm/addrspace.h>
  3588. +#include <asm/bootinfo.h>
  3589. +#include <linux/config.h>
  3590. +#include <linux/string.h>
  3591. +#include <linux/kernel.h>
  3592. +#include <linux/sched.h>
  3593. +
  3594. +int prom_argc;
  3595. +char **prom_argv, **prom_envp;
  3596. +extern void __init prom_init_cmdline(void);
  3597. +extern char *prom_getenv(char *envname);
  3598. +
  3599. +const char *get_system_type(void)
  3600. +{
  3601. + return "AMD Alchemy Au1200/Pb1200";
  3602. +}
  3603. +
  3604. +u32 mae_memsize = 0;
  3605. +
  3606. +int __init prom_init(int argc, char **argv, char **envp, int *prom_vec)
  3607. +{
  3608. + unsigned char *memsize_str;
  3609. + unsigned long memsize;
  3610. +
  3611. + prom_argc = argc;
  3612. + prom_argv = argv;
  3613. + prom_envp = envp;
  3614. +
  3615. + mips_machgroup = MACH_GROUP_ALCHEMY;
  3616. + mips_machtype = MACH_PB1000; /* set the platform # */
  3617. + prom_init_cmdline();
  3618. +
  3619. + memsize_str = prom_getenv("memsize");
  3620. + if (!memsize_str) {
  3621. + memsize = 0x08000000;
  3622. + } else {
  3623. + memsize = simple_strtol(memsize_str, NULL, 0);
  3624. + }
  3625. + add_memory_region(0, memsize, BOOT_MEM_RAM);
  3626. + return 0;
  3627. +}
  3628. +
  3629. --- /dev/null
  3630. +++ b/arch/mips/au1000/pb1200/irqmap.c
  3631. @@ -0,0 +1,180 @@
  3632. +/*
  3633. + * BRIEF MODULE DESCRIPTION
  3634. + * Au1xxx irq map table
  3635. + *
  3636. + * This program is free software; you can redistribute it and/or modify it
  3637. + * under the terms of the GNU General Public License as published by the
  3638. + * Free Software Foundation; either version 2 of the License, or (at your
  3639. + * option) any later version.
  3640. + *
  3641. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  3642. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  3643. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  3644. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  3645. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  3646. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  3647. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  3648. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  3649. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  3650. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3651. + *
  3652. + * You should have received a copy of the GNU General Public License along
  3653. + * with this program; if not, write to the Free Software Foundation, Inc.,
  3654. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  3655. + */
  3656. +#include <linux/errno.h>
  3657. +#include <linux/init.h>
  3658. +#include <linux/irq.h>
  3659. +#include <linux/kernel_stat.h>
  3660. +#include <linux/module.h>
  3661. +#include <linux/signal.h>
  3662. +#include <linux/sched.h>
  3663. +#include <linux/types.h>
  3664. +#include <linux/interrupt.h>
  3665. +#include <linux/ioport.h>
  3666. +#include <linux/timex.h>
  3667. +#include <linux/slab.h>
  3668. +#include <linux/random.h>
  3669. +#include <linux/delay.h>
  3670. +
  3671. +#include <asm/bitops.h>
  3672. +#include <asm/bootinfo.h>
  3673. +#include <asm/io.h>
  3674. +#include <asm/mipsregs.h>
  3675. +#include <asm/system.h>
  3676. +#include <asm/au1000.h>
  3677. +
  3678. +#ifdef CONFIG_MIPS_PB1200
  3679. +#include <asm/pb1200.h>
  3680. +#endif
  3681. +
  3682. +#ifdef CONFIG_MIPS_DB1200
  3683. +#include <asm/db1200.h>
  3684. +#define PB1200_INT_BEGIN DB1200_INT_BEGIN
  3685. +#define PB1200_INT_END DB1200_INT_END
  3686. +#endif
  3687. +
  3688. +au1xxx_irq_map_t au1xxx_irq_map[] = {
  3689. + { AU1000_GPIO_7, INTC_INT_LOW_LEVEL, 0 }, // This is exteranl interrupt cascade
  3690. +};
  3691. +
  3692. +int au1xxx_nr_irqs = sizeof(au1xxx_irq_map)/sizeof(au1xxx_irq_map_t);
  3693. +
  3694. +/*
  3695. + * Support for External interrupts on the PbAu1200 Development platform.
  3696. + */
  3697. +static volatile int pb1200_cascade_en=0;
  3698. +
  3699. +void pb1200_cascade_handler( int irq, void *dev_id, struct pt_regs *regs)
  3700. +{
  3701. + unsigned short bisr = bcsr->int_status;
  3702. + int extirq_nr = 0;
  3703. +
  3704. + /* Clear all the edge interrupts. This has no effect on level */
  3705. + bcsr->int_status = bisr;
  3706. + for( ; bisr; bisr &= (bisr-1) )
  3707. + {
  3708. + extirq_nr = (PB1200_INT_BEGIN-1) + au_ffs(bisr);
  3709. + /* Ack and dispatch IRQ */
  3710. + do_IRQ(extirq_nr,regs);
  3711. + }
  3712. +}
  3713. +
  3714. +inline void pb1200_enable_irq(unsigned int irq_nr)
  3715. +{
  3716. + bcsr->intset_mask = 1<<(irq_nr - PB1200_INT_BEGIN);
  3717. + bcsr->intset = 1<<(irq_nr - PB1200_INT_BEGIN);
  3718. +}
  3719. +
  3720. +inline void pb1200_disable_irq(unsigned int irq_nr)
  3721. +{
  3722. + bcsr->intclr_mask = 1<<(irq_nr - PB1200_INT_BEGIN);
  3723. + bcsr->intclr = 1<<(irq_nr - PB1200_INT_BEGIN);
  3724. +}
  3725. +
  3726. +static unsigned int pb1200_startup_irq( unsigned int irq_nr )
  3727. +{
  3728. + if (++pb1200_cascade_en == 1)
  3729. + {
  3730. + request_irq(AU1000_GPIO_7, &pb1200_cascade_handler,
  3731. + 0, "Pb1200 Cascade", &pb1200_cascade_handler );
  3732. +#ifdef CONFIG_MIPS_PB1200
  3733. + /* We have a problem with CPLD rev3. Enable a workaround */
  3734. + if( ((bcsr->whoami & BCSR_WHOAMI_CPLD)>>4) <= 3)
  3735. + {
  3736. + printk("\nWARNING!!!\n");
  3737. + printk("\nWARNING!!!\n");
  3738. + printk("\nWARNING!!!\n");
  3739. + printk("\nWARNING!!!\n");
  3740. + printk("\nWARNING!!!\n");
  3741. + printk("\nWARNING!!!\n");
  3742. + printk("Pb1200 must be at CPLD rev4. Please have Pb1200\n");
  3743. + printk("updated to latest revision. This software will not\n");
  3744. + printk("work on anything less than CPLD rev4\n");
  3745. + printk("\nWARNING!!!\n");
  3746. + printk("\nWARNING!!!\n");
  3747. + printk("\nWARNING!!!\n");
  3748. + printk("\nWARNING!!!\n");
  3749. + printk("\nWARNING!!!\n");
  3750. + printk("\nWARNING!!!\n");
  3751. + while(1);
  3752. + }
  3753. +#endif
  3754. + }
  3755. + pb1200_enable_irq(irq_nr);
  3756. + return 0;
  3757. +}
  3758. +
  3759. +static void pb1200_shutdown_irq( unsigned int irq_nr )
  3760. +{
  3761. + pb1200_disable_irq(irq_nr);
  3762. + if (--pb1200_cascade_en == 0)
  3763. + {
  3764. + free_irq(AU1000_GPIO_7,&pb1200_cascade_handler );
  3765. + }
  3766. + return;
  3767. +}
  3768. +
  3769. +static inline void pb1200_mask_and_ack_irq(unsigned int irq_nr)
  3770. +{
  3771. + pb1200_disable_irq( irq_nr );
  3772. +}
  3773. +
  3774. +static void pb1200_end_irq(unsigned int irq_nr)
  3775. +{
  3776. + if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))) {
  3777. + pb1200_enable_irq(irq_nr);
  3778. + }
  3779. +}
  3780. +
  3781. +static struct hw_interrupt_type external_irq_type =
  3782. +{
  3783. +#ifdef CONFIG_MIPS_PB1200
  3784. + "Pb1200 Ext",
  3785. +#endif
  3786. +#ifdef CONFIG_MIPS_DB1200
  3787. + "Db1200 Ext",
  3788. +#endif
  3789. + pb1200_startup_irq,
  3790. + pb1200_shutdown_irq,
  3791. + pb1200_enable_irq,
  3792. + pb1200_disable_irq,
  3793. + pb1200_mask_and_ack_irq,
  3794. + pb1200_end_irq,
  3795. + NULL
  3796. +};
  3797. +
  3798. +void _board_init_irq(void)
  3799. +{
  3800. + int irq_nr;
  3801. +
  3802. + for (irq_nr = PB1200_INT_BEGIN; irq_nr <= PB1200_INT_END; irq_nr++)
  3803. + {
  3804. + irq_desc[irq_nr].handler = &external_irq_type;
  3805. + pb1200_disable_irq(irq_nr);
  3806. + }
  3807. +
  3808. + /* GPIO_7 can not be hooked here, so it is hooked upon first
  3809. + request of any source attached to the cascade */
  3810. +}
  3811. +
  3812. --- /dev/null
  3813. +++ b/arch/mips/au1000/pb1200/Makefile
  3814. @@ -0,0 +1,25 @@
  3815. +#
  3816. +# Copyright 2000 MontaVista Software Inc.
  3817. +# Author: MontaVista Software, Inc.
  3818. +# [email protected] or [email protected]
  3819. +#
  3820. +# Makefile for the Alchemy Semiconductor PB1000 board.
  3821. +#
  3822. +# Note! Dependencies are done automagically by 'make dep', which also
  3823. +# removes any old dependencies. DON'T put your own dependencies here
  3824. +# unless it's something special (ie not a .c file).
  3825. +#
  3826. +
  3827. +USE_STANDARD_AS_RULE := true
  3828. +
  3829. +O_TARGET := pb1200.o
  3830. +
  3831. +obj-y := init.o board_setup.o irqmap.o
  3832. +
  3833. +ifdef CONFIG_MMC
  3834. +obj-y += mmc_support.o
  3835. +export-objs +=mmc_support.o
  3836. +endif
  3837. +
  3838. +
  3839. +include $(TOPDIR)/Rules.make
  3840. --- /dev/null
  3841. +++ b/arch/mips/au1000/pb1200/mmc_support.c
  3842. @@ -0,0 +1,141 @@
  3843. +/*
  3844. + * BRIEF MODULE DESCRIPTION
  3845. + *
  3846. + * MMC support routines for PB1200.
  3847. + *
  3848. + *
  3849. + * Copyright (c) 2003-2004 Embedded Edge, LLC.
  3850. + * Author: Embedded Edge, LLC.
  3851. + * Contact: [email protected]
  3852. + *
  3853. + * This program is free software; you can redistribute it and/or modify it
  3854. + * under the terms of the GNU General Public License as published by the
  3855. + * Free Software Foundation; either version 2 of the License, or (at your
  3856. + * option) any later version.
  3857. + *
  3858. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  3859. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  3860. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  3861. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  3862. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  3863. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  3864. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  3865. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  3866. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  3867. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  3868. + *
  3869. + * You should have received a copy of the GNU General Public License along
  3870. + * with this program; if not, write to the Free Software Foundation, Inc.,
  3871. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  3872. + *
  3873. + */
  3874. +
  3875. +
  3876. +#include <linux/config.h>
  3877. +#include <linux/kernel.h>
  3878. +#include <linux/module.h>
  3879. +#include <linux/init.h>
  3880. +
  3881. +#include <asm/irq.h>
  3882. +#include <asm/au1000.h>
  3883. +#include <asm/au1100_mmc.h>
  3884. +
  3885. +#ifdef CONFIG_MIPS_PB1200
  3886. +#include <asm/pb1200.h>
  3887. +#endif
  3888. +
  3889. +#ifdef CONFIG_MIPS_DB1200
  3890. +/* NOTE: DB1200 only has SD0 pinned out and usable */
  3891. +#include <asm/db1200.h>
  3892. +#endif
  3893. +
  3894. +/* SD/MMC controller support functions */
  3895. +
  3896. +/*
  3897. + * Detect card.
  3898. + */
  3899. +void mmc_card_inserted(int socket, int *result)
  3900. +{
  3901. + u16 mask;
  3902. +
  3903. + if (socket)
  3904. +#ifdef CONFIG_MIPS_DB1200
  3905. + mask = 0;
  3906. +#else
  3907. + mask = BCSR_INT_SD1INSERT;
  3908. +#endif
  3909. + else
  3910. + mask = BCSR_INT_SD0INSERT;
  3911. +
  3912. + *result = ((bcsr->sig_status & mask) != 0);
  3913. +}
  3914. +
  3915. +/*
  3916. + * Check card write protection.
  3917. + */
  3918. +void mmc_card_writable(int socket, int *result)
  3919. +{
  3920. + u16 mask;
  3921. +
  3922. + if (socket)
  3923. +#ifdef CONFIG_MIPS_DB1200
  3924. + mask = 0;
  3925. +#else
  3926. + mask = BCSR_STATUS_SD1WP;
  3927. +#endif
  3928. + else
  3929. + mask = BCSR_STATUS_SD0WP;
  3930. +
  3931. + /* low means card writable */
  3932. + if (!(bcsr->status & mask)) {
  3933. + *result = 1;
  3934. + } else {
  3935. + *result = 0;
  3936. + }
  3937. +}
  3938. +
  3939. +/*
  3940. + * Apply power to card slot.
  3941. + */
  3942. +void mmc_power_on(int socket)
  3943. +{
  3944. + u16 mask;
  3945. +
  3946. + if (socket)
  3947. +#ifdef CONFIG_MIPS_DB1200
  3948. + mask = 0;
  3949. +#else
  3950. + mask = BCSR_BOARD_SD1PWR;
  3951. +#endif
  3952. + else
  3953. + mask = BCSR_BOARD_SD0PWR;
  3954. +
  3955. + bcsr->board |= mask;
  3956. + au_sync_delay(1);
  3957. +}
  3958. +
  3959. +/*
  3960. + * Remove power from card slot.
  3961. + */
  3962. +void mmc_power_off(int socket)
  3963. +{
  3964. + u16 mask;
  3965. +
  3966. + if (socket)
  3967. +#ifdef CONFIG_MIPS_DB1200
  3968. + mask = 0;
  3969. +#else
  3970. + mask = BCSR_BOARD_SD1PWR;
  3971. +#endif
  3972. + else
  3973. + mask = BCSR_BOARD_SD0PWR;
  3974. +
  3975. + bcsr->board &= ~mask;
  3976. + au_sync_delay(1);
  3977. +}
  3978. +
  3979. +EXPORT_SYMBOL(mmc_card_inserted);
  3980. +EXPORT_SYMBOL(mmc_card_writable);
  3981. +EXPORT_SYMBOL(mmc_power_on);
  3982. +EXPORT_SYMBOL(mmc_power_off);
  3983. +
  3984. --- a/arch/mips/au1000/pb1500/board_setup.c
  3985. +++ b/arch/mips/au1000/pb1500/board_setup.c
  3986. @@ -62,6 +62,10 @@ void board_reset (void)
  3987. au_writel(0x00000000, 0xAE00001C);
  3988. }
  3989. +void board_power_off (void)
  3990. +{
  3991. +}
  3992. +
  3993. void __init board_setup(void)
  3994. {
  3995. u32 pin_func;
  3996. --- a/arch/mips/au1000/pb1550/board_setup.c
  3997. +++ b/arch/mips/au1000/pb1550/board_setup.c
  3998. @@ -48,12 +48,31 @@
  3999. extern struct rtc_ops no_rtc_ops;
  4000. +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
  4001. +extern struct ide_ops *ide_ops;
  4002. +extern struct ide_ops au1xxx_ide_ops;
  4003. +extern u32 au1xxx_ide_virtbase;
  4004. +extern u64 au1xxx_ide_physbase;
  4005. +extern unsigned int au1xxx_ide_irq;
  4006. +
  4007. +u32 au1xxx_ide_ddma_enable = 0, switch4ddma = 1; // PIO+ddma
  4008. +#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX */
  4009. +
  4010. void board_reset (void)
  4011. {
  4012. /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
  4013. au_writew(au_readw(0xAF00001C) & ~(1<<15), 0xAF00001C);
  4014. }
  4015. +void board_power_off (void)
  4016. +{
  4017. + /* power off system */
  4018. + printk("\n** Powering off Pb1550\n");
  4019. + au_writew(au_readw(0xAF00001C) | (3<<14), 0xAF00001C);
  4020. + au_sync();
  4021. + while(1); /* should not get here */
  4022. +}
  4023. +
  4024. void __init board_setup(void)
  4025. {
  4026. u32 pin_func;
  4027. @@ -78,5 +97,36 @@ void __init board_setup(void)
  4028. au_writel(0, (u32)bcsr|0x10); /* turn off pcmcia power */
  4029. au_sync();
  4030. +#if defined(CONFIG_AU1XXX_SMC91111)
  4031. +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
  4032. +#error "Resource conflict occured. Disable either Ethernet or IDE daughter card."
  4033. +#else
  4034. +#define CPLD_CONTROL (0xAF00000C)
  4035. + {
  4036. + /* set up the Static Bus timing */
  4037. + /* only 396Mhz */
  4038. + /* reset the DC */
  4039. + au_writew(au_readw(CPLD_CONTROL) | 0x0f, CPLD_CONTROL);
  4040. + au_writel(0x00010003, MEM_STCFG0);
  4041. + au_writel(0x000c00c0, MEM_STCFG2);
  4042. + au_writel(0x85E1900D, MEM_STTIME2);
  4043. + }
  4044. +#endif
  4045. +#endif /* end CONFIG_SMC91111 */
  4046. +
  4047. +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX)
  4048. + /*
  4049. + * Iniz IDE parameters
  4050. + */
  4051. + ide_ops = &au1xxx_ide_ops;
  4052. + au1xxx_ide_irq = DAUGHTER_CARD_IRQ;;
  4053. + au1xxx_ide_physbase = AU1XXX_ATA_PHYS_ADDR;
  4054. + au1xxx_ide_virtbase = KSEG1ADDR(AU1XXX_ATA_PHYS_ADDR);
  4055. + /*
  4056. + * change PIO or PIO+Ddma
  4057. + * check the GPIO-6 pin condition. pb1550:s15_dot
  4058. + */
  4059. + switch4ddma = (au_readl(SYS_PINSTATERD) & (1 << 6)) ? 1 : 0;
  4060. +#endif
  4061. printk("AMD Alchemy Pb1550 Board\n");
  4062. }
  4063. --- a/arch/mips/au1000/pb1550/irqmap.c
  4064. +++ b/arch/mips/au1000/pb1550/irqmap.c
  4065. @@ -50,6 +50,9 @@
  4066. au1xxx_irq_map_t au1xxx_irq_map[] = {
  4067. { AU1000_GPIO_0, INTC_INT_LOW_LEVEL, 0 },
  4068. { AU1000_GPIO_1, INTC_INT_LOW_LEVEL, 0 },
  4069. +#ifdef CONFIG_AU1XXX_SMC91111
  4070. + { AU1000_GPIO_3, INTC_INT_LOW_LEVEL, 0 },
  4071. +#endif
  4072. };
  4073. int au1xxx_nr_irqs = sizeof(au1xxx_irq_map)/sizeof(au1xxx_irq_map_t);
  4074. --- a/arch/mips/config-shared.in
  4075. +++ b/arch/mips/config-shared.in
  4076. @@ -21,16 +21,19 @@ mainmenu_option next_comment
  4077. comment 'Machine selection'
  4078. dep_bool 'Support for Acer PICA 1 chipset (EXPERIMENTAL)' CONFIG_ACER_PICA_61 $CONFIG_EXPERIMENTAL
  4079. dep_bool 'Support for Alchemy Bosporus board' CONFIG_MIPS_BOSPORUS $CONFIG_MIPS32
  4080. +dep_bool 'Support for FIC Multimedia Player board' CONFIG_MIPS_FICMMP $CONFIG_MIPS32
  4081. dep_bool 'Support for Alchemy Mirage board' CONFIG_MIPS_MIRAGE $CONFIG_MIPS32
  4082. dep_bool 'Support for Alchemy Db1000 board' CONFIG_MIPS_DB1000 $CONFIG_MIPS32
  4083. dep_bool 'Support for Alchemy Db1100 board' CONFIG_MIPS_DB1100 $CONFIG_MIPS32
  4084. dep_bool 'Support for Alchemy Db1500 board' CONFIG_MIPS_DB1500 $CONFIG_MIPS32
  4085. dep_bool 'Support for Alchemy Db1550 board' CONFIG_MIPS_DB1550 $CONFIG_MIPS32
  4086. +dep_bool 'Support for Alchemy Db1200 board' CONFIG_MIPS_DB1200 $CONFIG_MIPS32
  4087. dep_bool 'Support for Alchemy PB1000 board' CONFIG_MIPS_PB1000 $CONFIG_MIPS32
  4088. dep_bool 'Support for Alchemy PB1100 board' CONFIG_MIPS_PB1100 $CONFIG_MIPS32
  4089. dep_bool 'Support for Alchemy PB1500 board' CONFIG_MIPS_PB1500 $CONFIG_MIPS32
  4090. -dep_bool 'Support for Alchemy Hydrogen3 board' CONFIG_MIPS_HYDROGEN3 $CONFIG_MIPS32
  4091. dep_bool 'Support for Alchemy PB1550 board' CONFIG_MIPS_PB1550 $CONFIG_MIPS32
  4092. +dep_bool 'Support for Alchemy PB1200 board' CONFIG_MIPS_PB1200 $CONFIG_MIPS32
  4093. +dep_bool 'Support for Alchemy Hydrogen3 board' CONFIG_MIPS_HYDROGEN3 $CONFIG_MIPS32
  4094. dep_bool 'Support for MyCable XXS1500 board' CONFIG_MIPS_XXS1500 $CONFIG_MIPS32
  4095. dep_bool 'Support for 4G Systems MTX-1 board' CONFIG_MIPS_MTX1 $CONFIG_MIPS32
  4096. dep_bool 'Support for Cogent CSB250 board' CONFIG_COGENT_CSB250 $CONFIG_MIPS32
  4097. @@ -249,6 +252,12 @@ if [ "$CONFIG_MIPS_MIRAGE" = "y" ]; then
  4098. define_bool CONFIG_PC_KEYB y
  4099. define_bool CONFIG_NONCOHERENT_IO y
  4100. fi
  4101. +if [ "$CONFIG_MIPS_FICMMP" = "y" ]; then
  4102. + define_bool CONFIG_SOC_AU1X00 y
  4103. + define_bool CONFIG_SOC_AU1200 y
  4104. + define_bool CONFIG_NONCOHERENT_IO y
  4105. + define_bool CONFIG_PC_KEYB y
  4106. +fi
  4107. if [ "$CONFIG_MIPS_BOSPORUS" = "y" ]; then
  4108. define_bool CONFIG_SOC_AU1X00 y
  4109. define_bool CONFIG_SOC_AU1500 y
  4110. @@ -263,6 +272,12 @@ if [ "$CONFIG_MIPS_PB1000" = "y" ]; then
  4111. define_bool CONFIG_SWAP_IO_SPACE_W y
  4112. define_bool CONFIG_SWAP_IO_SPACE_L y
  4113. fi
  4114. +if [ "$CONFIG_MIPS_PB1500" = "y" ]; then
  4115. + define_bool CONFIG_SOC_AU1X00 y
  4116. + define_bool CONFIG_SOC_AU1500 y
  4117. + define_bool CONFIG_NONCOHERENT_IO y
  4118. + define_bool CONFIG_PC_KEYB y
  4119. +fi
  4120. if [ "$CONFIG_MIPS_PB1100" = "y" ]; then
  4121. define_bool CONFIG_SOC_AU1X00 y
  4122. define_bool CONFIG_SOC_AU1100 y
  4123. @@ -271,9 +286,15 @@ if [ "$CONFIG_MIPS_PB1100" = "y" ]; then
  4124. define_bool CONFIG_SWAP_IO_SPACE_W y
  4125. define_bool CONFIG_SWAP_IO_SPACE_L y
  4126. fi
  4127. -if [ "$CONFIG_MIPS_PB1500" = "y" ]; then
  4128. +if [ "$CONFIG_MIPS_PB1550" = "y" ]; then
  4129. define_bool CONFIG_SOC_AU1X00 y
  4130. - define_bool CONFIG_SOC_AU1500 y
  4131. + define_bool CONFIG_SOC_AU1550 y
  4132. + define_bool CONFIG_NONCOHERENT_IO n
  4133. + define_bool CONFIG_PC_KEYB y
  4134. +fi
  4135. +if [ "$CONFIG_MIPS_PB1200" = "y" ]; then
  4136. + define_bool CONFIG_SOC_AU1X00 y
  4137. + define_bool CONFIG_SOC_AU1200 y
  4138. define_bool CONFIG_NONCOHERENT_IO y
  4139. define_bool CONFIG_PC_KEYB y
  4140. fi
  4141. @@ -290,18 +311,24 @@ if [ "$CONFIG_MIPS_DB1500" = "y" ]; then
  4142. define_bool CONFIG_NONCOHERENT_IO y
  4143. define_bool CONFIG_PC_KEYB y
  4144. fi
  4145. +if [ "$CONFIG_MIPS_DB1100" = "y" ]; then
  4146. + define_bool CONFIG_SOC_AU1X00 y
  4147. + define_bool CONFIG_SOC_AU1100 y
  4148. + define_bool CONFIG_NONCOHERENT_IO y
  4149. + define_bool CONFIG_PC_KEYB y
  4150. + define_bool CONFIG_SWAP_IO_SPACE y
  4151. +fi
  4152. if [ "$CONFIG_MIPS_DB1550" = "y" ]; then
  4153. define_bool CONFIG_SOC_AU1X00 y
  4154. define_bool CONFIG_SOC_AU1550 y
  4155. define_bool CONFIG_NONCOHERENT_IO y
  4156. define_bool CONFIG_PC_KEYB y
  4157. fi
  4158. -if [ "$CONFIG_MIPS_DB1100" = "y" ]; then
  4159. +if [ "$CONFIG_MIPS_DB1200" = "y" ]; then
  4160. define_bool CONFIG_SOC_AU1X00 y
  4161. - define_bool CONFIG_SOC_AU1100 y
  4162. + define_bool CONFIG_SOC_AU1200 y
  4163. define_bool CONFIG_NONCOHERENT_IO y
  4164. define_bool CONFIG_PC_KEYB y
  4165. - define_bool CONFIG_SWAP_IO_SPACE y
  4166. fi
  4167. if [ "$CONFIG_MIPS_HYDROGEN3" = "y" ]; then
  4168. define_bool CONFIG_SOC_AU1X00 y
  4169. @@ -327,12 +354,6 @@ if [ "$CONFIG_COGENT_CSB250" = "y" ]; th
  4170. define_bool CONFIG_NONCOHERENT_IO y
  4171. define_bool CONFIG_PC_KEYB y
  4172. fi
  4173. -if [ "$CONFIG_MIPS_PB1550" = "y" ]; then
  4174. - define_bool CONFIG_SOC_AU1X00 y
  4175. - define_bool CONFIG_SOC_AU1550 y
  4176. - define_bool CONFIG_NONCOHERENT_IO n
  4177. - define_bool CONFIG_PC_KEYB y
  4178. -fi
  4179. if [ "$CONFIG_MIPS_COBALT" = "y" ]; then
  4180. define_bool CONFIG_BOOT_ELF32 y
  4181. define_bool CONFIG_COBALT_LCD y
  4182. @@ -729,6 +750,13 @@ if [ "$CONFIG_ACER_PICA_61" = "y" -o \
  4183. "$CONFIG_MIPS_PB1000" = "y" -o \
  4184. "$CONFIG_MIPS_PB1100" = "y" -o \
  4185. "$CONFIG_MIPS_PB1500" = "y" -o \
  4186. + "$CONFIG_MIPS_PB1550" = "y" -o \
  4187. + "$CONFIG_MIPS_PB1200" = "y" -o \
  4188. + "$CONFIG_MIPS_DB1000" = "y" -o \
  4189. + "$CONFIG_MIPS_DB1100" = "y" -o \
  4190. + "$CONFIG_MIPS_DB1500" = "y" -o \
  4191. + "$CONFIG_MIPS_DB1550" = "y" -o \
  4192. + "$CONFIG_MIPS_DB1200" = "y" -o \
  4193. "$CONFIG_NEC_OSPREY" = "y" -o \
  4194. "$CONFIG_NEC_EAGLE" = "y" -o \
  4195. "$CONFIG_NINO" = "y" -o \
  4196. --- a/arch/mips/defconfig
  4197. +++ b/arch/mips/defconfig
  4198. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  4199. # CONFIG_MIPS_PB1000 is not set
  4200. # CONFIG_MIPS_PB1100 is not set
  4201. # CONFIG_MIPS_PB1500 is not set
  4202. -# CONFIG_MIPS_HYDROGEN3 is not set
  4203. # CONFIG_MIPS_PB1550 is not set
  4204. +# CONFIG_MIPS_HYDROGEN3 is not set
  4205. # CONFIG_MIPS_XXS1500 is not set
  4206. # CONFIG_MIPS_MTX1 is not set
  4207. # CONFIG_COGENT_CSB250 is not set
  4208. @@ -235,11 +235,6 @@ CONFIG_IP_PNP_BOOTP=y
  4209. #
  4210. # CONFIG_IPX is not set
  4211. # CONFIG_ATALK is not set
  4212. -
  4213. -#
  4214. -# Appletalk devices
  4215. -#
  4216. -# CONFIG_DEV_APPLETALK is not set
  4217. # CONFIG_DECNET is not set
  4218. # CONFIG_BRIDGE is not set
  4219. # CONFIG_X25 is not set
  4220. @@ -319,9 +314,11 @@ CONFIG_SGIWD93_SCSI=y
  4221. # CONFIG_SCSI_MEGARAID is not set
  4222. # CONFIG_SCSI_MEGARAID2 is not set
  4223. # CONFIG_SCSI_SATA is not set
  4224. +# CONFIG_SCSI_SATA_AHCI is not set
  4225. # CONFIG_SCSI_SATA_SVW is not set
  4226. # CONFIG_SCSI_ATA_PIIX is not set
  4227. # CONFIG_SCSI_SATA_NV is not set
  4228. +# CONFIG_SCSI_SATA_QSTOR is not set
  4229. # CONFIG_SCSI_SATA_PROMISE is not set
  4230. # CONFIG_SCSI_SATA_SX4 is not set
  4231. # CONFIG_SCSI_SATA_SIL is not set
  4232. @@ -465,7 +462,6 @@ CONFIG_VT_CONSOLE=y
  4233. # CONFIG_SERIAL is not set
  4234. # CONFIG_SERIAL_EXTENDED is not set
  4235. # CONFIG_SERIAL_NONSTANDARD is not set
  4236. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  4237. CONFIG_UNIX98_PTYS=y
  4238. CONFIG_UNIX98_PTY_COUNT=256
  4239. --- a/arch/mips/defconfig-atlas
  4240. +++ b/arch/mips/defconfig-atlas
  4241. @@ -28,8 +28,8 @@ CONFIG_EXPERIMENTAL=y
  4242. # CONFIG_MIPS_PB1000 is not set
  4243. # CONFIG_MIPS_PB1100 is not set
  4244. # CONFIG_MIPS_PB1500 is not set
  4245. -# CONFIG_MIPS_HYDROGEN3 is not set
  4246. # CONFIG_MIPS_PB1550 is not set
  4247. +# CONFIG_MIPS_HYDROGEN3 is not set
  4248. # CONFIG_MIPS_XXS1500 is not set
  4249. # CONFIG_MIPS_MTX1 is not set
  4250. # CONFIG_COGENT_CSB250 is not set
  4251. @@ -235,11 +235,6 @@ CONFIG_IP_PNP=y
  4252. #
  4253. # CONFIG_IPX is not set
  4254. # CONFIG_ATALK is not set
  4255. -
  4256. -#
  4257. -# Appletalk devices
  4258. -#
  4259. -# CONFIG_DEV_APPLETALK is not set
  4260. # CONFIG_DECNET is not set
  4261. # CONFIG_BRIDGE is not set
  4262. # CONFIG_X25 is not set
  4263. @@ -317,9 +312,11 @@ CONFIG_SD_EXTRA_DEVS=40
  4264. # CONFIG_SCSI_MEGARAID is not set
  4265. # CONFIG_SCSI_MEGARAID2 is not set
  4266. # CONFIG_SCSI_SATA is not set
  4267. +# CONFIG_SCSI_SATA_AHCI is not set
  4268. # CONFIG_SCSI_SATA_SVW is not set
  4269. # CONFIG_SCSI_ATA_PIIX is not set
  4270. # CONFIG_SCSI_SATA_NV is not set
  4271. +# CONFIG_SCSI_SATA_QSTOR is not set
  4272. # CONFIG_SCSI_SATA_PROMISE is not set
  4273. # CONFIG_SCSI_SATA_SX4 is not set
  4274. # CONFIG_SCSI_SATA_SIL is not set
  4275. @@ -528,7 +525,6 @@ CONFIG_SERIAL=y
  4276. CONFIG_SERIAL_CONSOLE=y
  4277. # CONFIG_SERIAL_EXTENDED is not set
  4278. # CONFIG_SERIAL_NONSTANDARD is not set
  4279. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  4280. CONFIG_UNIX98_PTYS=y
  4281. CONFIG_UNIX98_PTY_COUNT=256
  4282. --- a/arch/mips/defconfig-bosporus
  4283. +++ b/arch/mips/defconfig-bosporus
  4284. @@ -30,8 +30,8 @@ CONFIG_MIPS_BOSPORUS=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. @@ -208,9 +208,7 @@ CONFIG_MTD_CFI_AMDSTD=y
  4295. CONFIG_MTD_BOSPORUS=y
  4296. # CONFIG_MTD_XXS1500 is not set
  4297. # CONFIG_MTD_MTX1 is not set
  4298. -# CONFIG_MTD_DB1X00 is not set
  4299. # CONFIG_MTD_PB1550 is not set
  4300. -# CONFIG_MTD_HYDROGEN3 is not set
  4301. # CONFIG_MTD_MIRAGE is not set
  4302. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  4303. # CONFIG_MTD_OCELOT is not set
  4304. @@ -229,7 +227,6 @@ CONFIG_MTD_BOSPORUS=y
  4305. #
  4306. # Disk-On-Chip Device Drivers
  4307. #
  4308. -# CONFIG_MTD_DOC1000 is not set
  4309. # CONFIG_MTD_DOC2000 is not set
  4310. # CONFIG_MTD_DOC2001 is not set
  4311. # CONFIG_MTD_DOCPROBE is not set
  4312. @@ -373,11 +370,6 @@ CONFIG_IP_NF_MANGLE=m
  4313. #
  4314. # CONFIG_IPX is not set
  4315. # CONFIG_ATALK is not set
  4316. -
  4317. -#
  4318. -# Appletalk devices
  4319. -#
  4320. -# CONFIG_DEV_APPLETALK is not set
  4321. # CONFIG_DECNET is not set
  4322. # CONFIG_BRIDGE is not set
  4323. # CONFIG_X25 is not set
  4324. @@ -457,9 +449,11 @@ CONFIG_SCSI_CONSTANTS=y
  4325. # CONFIG_SCSI_MEGARAID is not set
  4326. # CONFIG_SCSI_MEGARAID2 is not set
  4327. # CONFIG_SCSI_SATA is not set
  4328. +# CONFIG_SCSI_SATA_AHCI is not set
  4329. # CONFIG_SCSI_SATA_SVW is not set
  4330. # CONFIG_SCSI_ATA_PIIX is not set
  4331. # CONFIG_SCSI_SATA_NV is not set
  4332. +# CONFIG_SCSI_SATA_QSTOR is not set
  4333. # CONFIG_SCSI_SATA_PROMISE is not set
  4334. # CONFIG_SCSI_SATA_SX4 is not set
  4335. # CONFIG_SCSI_SATA_SIL is not set
  4336. @@ -681,7 +675,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  4337. # CONFIG_AU1X00_USB_TTY is not set
  4338. # CONFIG_AU1X00_USB_RAW is not set
  4339. # CONFIG_TXX927_SERIAL is not set
  4340. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  4341. CONFIG_UNIX98_PTYS=y
  4342. CONFIG_UNIX98_PTY_COUNT=256
  4343. --- a/arch/mips/defconfig-capcella
  4344. +++ b/arch/mips/defconfig-capcella
  4345. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  4346. # CONFIG_MIPS_PB1000 is not set
  4347. # CONFIG_MIPS_PB1100 is not set
  4348. # CONFIG_MIPS_PB1500 is not set
  4349. -# CONFIG_MIPS_HYDROGEN3 is not set
  4350. # CONFIG_MIPS_PB1550 is not set
  4351. +# CONFIG_MIPS_HYDROGEN3 is not set
  4352. # CONFIG_MIPS_XXS1500 is not set
  4353. # CONFIG_MIPS_MTX1 is not set
  4354. # CONFIG_COGENT_CSB250 is not set
  4355. @@ -228,11 +228,6 @@ CONFIG_IP_PNP_BOOTP=y
  4356. #
  4357. # CONFIG_IPX is not set
  4358. # CONFIG_ATALK is not set
  4359. -
  4360. -#
  4361. -# Appletalk devices
  4362. -#
  4363. -# CONFIG_DEV_APPLETALK is not set
  4364. # CONFIG_DECNET is not set
  4365. # CONFIG_BRIDGE is not set
  4366. # CONFIG_X25 is not set
  4367. @@ -472,7 +467,6 @@ CONFIG_SERIAL=y
  4368. CONFIG_SERIAL_CONSOLE=y
  4369. # CONFIG_SERIAL_EXTENDED is not set
  4370. # CONFIG_SERIAL_NONSTANDARD is not set
  4371. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  4372. # CONFIG_VR41XX_KIU is not set
  4373. CONFIG_UNIX98_PTYS=y
  4374. CONFIG_UNIX98_PTY_COUNT=256
  4375. --- a/arch/mips/defconfig-cobalt
  4376. +++ b/arch/mips/defconfig-cobalt
  4377. @@ -28,8 +28,8 @@ CONFIG_EXPERIMENTAL=y
  4378. # CONFIG_MIPS_PB1000 is not set
  4379. # CONFIG_MIPS_PB1100 is not set
  4380. # CONFIG_MIPS_PB1500 is not set
  4381. -# CONFIG_MIPS_HYDROGEN3 is not set
  4382. # CONFIG_MIPS_PB1550 is not set
  4383. +# CONFIG_MIPS_HYDROGEN3 is not set
  4384. # CONFIG_MIPS_XXS1500 is not set
  4385. # CONFIG_MIPS_MTX1 is not set
  4386. # CONFIG_COGENT_CSB250 is not set
  4387. @@ -222,11 +222,6 @@ CONFIG_INET=y
  4388. #
  4389. # CONFIG_IPX is not set
  4390. # CONFIG_ATALK is not set
  4391. -
  4392. -#
  4393. -# Appletalk devices
  4394. -#
  4395. -# CONFIG_DEV_APPLETALK is not set
  4396. # CONFIG_DECNET is not set
  4397. # CONFIG_BRIDGE is not set
  4398. # CONFIG_X25 is not set
  4399. @@ -505,7 +500,6 @@ CONFIG_SERIAL=y
  4400. CONFIG_SERIAL_CONSOLE=y
  4401. # CONFIG_SERIAL_EXTENDED is not set
  4402. # CONFIG_SERIAL_NONSTANDARD is not set
  4403. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  4404. CONFIG_UNIX98_PTYS=y
  4405. CONFIG_UNIX98_PTY_COUNT=16
  4406. --- a/arch/mips/defconfig-csb250
  4407. +++ b/arch/mips/defconfig-csb250
  4408. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  4409. # CONFIG_MIPS_PB1000 is not set
  4410. # CONFIG_MIPS_PB1100 is not set
  4411. # CONFIG_MIPS_PB1500 is not set
  4412. -# CONFIG_MIPS_HYDROGEN3 is not set
  4413. # CONFIG_MIPS_PB1550 is not set
  4414. +# CONFIG_MIPS_HYDROGEN3 is not set
  4415. # CONFIG_MIPS_XXS1500 is not set
  4416. # CONFIG_MIPS_MTX1 is not set
  4417. CONFIG_COGENT_CSB250=y
  4418. @@ -268,11 +268,6 @@ CONFIG_IP_PNP_BOOTP=y
  4419. #
  4420. # CONFIG_IPX is not set
  4421. # CONFIG_ATALK is not set
  4422. -
  4423. -#
  4424. -# Appletalk devices
  4425. -#
  4426. -# CONFIG_DEV_APPLETALK is not set
  4427. # CONFIG_DECNET is not set
  4428. # CONFIG_BRIDGE is not set
  4429. # CONFIG_X25 is not set
  4430. @@ -556,7 +551,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  4431. # CONFIG_AU1X00_USB_TTY is not set
  4432. # CONFIG_AU1X00_USB_RAW is not set
  4433. # CONFIG_TXX927_SERIAL is not set
  4434. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  4435. CONFIG_UNIX98_PTYS=y
  4436. CONFIG_UNIX98_PTY_COUNT=256
  4437. --- a/arch/mips/defconfig-db1000
  4438. +++ b/arch/mips/defconfig-db1000
  4439. @@ -30,8 +30,8 @@ CONFIG_MIPS_DB1000=y
  4440. # CONFIG_MIPS_PB1000 is not set
  4441. # CONFIG_MIPS_PB1100 is not set
  4442. # CONFIG_MIPS_PB1500 is not set
  4443. -# CONFIG_MIPS_HYDROGEN3 is not set
  4444. # CONFIG_MIPS_PB1550 is not set
  4445. +# CONFIG_MIPS_HYDROGEN3 is not set
  4446. # CONFIG_MIPS_XXS1500 is not set
  4447. # CONFIG_MIPS_MTX1 is not set
  4448. # CONFIG_COGENT_CSB250 is not set
  4449. @@ -214,11 +214,7 @@ CONFIG_MTD_CFI_AMDSTD=y
  4450. # CONFIG_MTD_BOSPORUS is not set
  4451. # CONFIG_MTD_XXS1500 is not set
  4452. # CONFIG_MTD_MTX1 is not set
  4453. -CONFIG_MTD_DB1X00=y
  4454. -CONFIG_MTD_DB1X00_BOOT=y
  4455. -CONFIG_MTD_DB1X00_USER=y
  4456. # CONFIG_MTD_PB1550 is not set
  4457. -# CONFIG_MTD_HYDROGEN3 is not set
  4458. # CONFIG_MTD_MIRAGE is not set
  4459. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  4460. # CONFIG_MTD_OCELOT is not set
  4461. @@ -237,7 +233,6 @@ CONFIG_MTD_DB1X00_USER=y
  4462. #
  4463. # Disk-On-Chip Device Drivers
  4464. #
  4465. -# CONFIG_MTD_DOC1000 is not set
  4466. # CONFIG_MTD_DOC2000 is not set
  4467. # CONFIG_MTD_DOC2001 is not set
  4468. # CONFIG_MTD_DOCPROBE is not set
  4469. @@ -342,11 +337,6 @@ CONFIG_IP_PNP_BOOTP=y
  4470. #
  4471. # CONFIG_IPX is not set
  4472. # CONFIG_ATALK is not set
  4473. -
  4474. -#
  4475. -# Appletalk devices
  4476. -#
  4477. -# CONFIG_DEV_APPLETALK is not set
  4478. # CONFIG_DECNET is not set
  4479. # CONFIG_BRIDGE is not set
  4480. # CONFIG_X25 is not set
  4481. @@ -636,7 +626,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  4482. # CONFIG_AU1X00_USB_TTY is not set
  4483. # CONFIG_AU1X00_USB_RAW is not set
  4484. # CONFIG_TXX927_SERIAL is not set
  4485. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  4486. CONFIG_UNIX98_PTYS=y
  4487. CONFIG_UNIX98_PTY_COUNT=256
  4488. --- a/arch/mips/defconfig-db1100
  4489. +++ b/arch/mips/defconfig-db1100
  4490. @@ -30,8 +30,8 @@ CONFIG_MIPS_DB1100=y
  4491. # CONFIG_MIPS_PB1000 is not set
  4492. # CONFIG_MIPS_PB1100 is not set
  4493. # CONFIG_MIPS_PB1500 is not set
  4494. -# CONFIG_MIPS_HYDROGEN3 is not set
  4495. # CONFIG_MIPS_PB1550 is not set
  4496. +# CONFIG_MIPS_HYDROGEN3 is not set
  4497. # CONFIG_MIPS_XXS1500 is not set
  4498. # CONFIG_MIPS_MTX1 is not set
  4499. # CONFIG_COGENT_CSB250 is not set
  4500. @@ -214,11 +214,7 @@ CONFIG_MTD_CFI_AMDSTD=y
  4501. # CONFIG_MTD_BOSPORUS is not set
  4502. # CONFIG_MTD_XXS1500 is not set
  4503. # CONFIG_MTD_MTX1 is not set
  4504. -CONFIG_MTD_DB1X00=y
  4505. -# CONFIG_MTD_DB1X00_BOOT is not set
  4506. -CONFIG_MTD_DB1X00_USER=y
  4507. # CONFIG_MTD_PB1550 is not set
  4508. -# CONFIG_MTD_HYDROGEN3 is not set
  4509. # CONFIG_MTD_MIRAGE is not set
  4510. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  4511. # CONFIG_MTD_OCELOT is not set
  4512. @@ -237,7 +233,6 @@ CONFIG_MTD_DB1X00_USER=y
  4513. #
  4514. # Disk-On-Chip Device Drivers
  4515. #
  4516. -# CONFIG_MTD_DOC1000 is not set
  4517. # CONFIG_MTD_DOC2000 is not set
  4518. # CONFIG_MTD_DOC2001 is not set
  4519. # CONFIG_MTD_DOCPROBE is not set
  4520. @@ -342,11 +337,6 @@ CONFIG_IP_PNP_BOOTP=y
  4521. #
  4522. # CONFIG_IPX is not set
  4523. # CONFIG_ATALK is not set
  4524. -
  4525. -#
  4526. -# Appletalk devices
  4527. -#
  4528. -# CONFIG_DEV_APPLETALK is not set
  4529. # CONFIG_DECNET is not set
  4530. # CONFIG_BRIDGE is not set
  4531. # CONFIG_X25 is not set
  4532. @@ -636,7 +626,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  4533. # CONFIG_AU1X00_USB_TTY is not set
  4534. # CONFIG_AU1X00_USB_RAW is not set
  4535. # CONFIG_TXX927_SERIAL is not set
  4536. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  4537. CONFIG_UNIX98_PTYS=y
  4538. CONFIG_UNIX98_PTY_COUNT=256
  4539. @@ -884,6 +873,7 @@ CONFIG_DUMMY_CONSOLE=y
  4540. # CONFIG_FB_PM2 is not set
  4541. # CONFIG_FB_PM3 is not set
  4542. # CONFIG_FB_CYBER2000 is not set
  4543. +CONFIG_FB_AU1100=y
  4544. # CONFIG_FB_MATROX is not set
  4545. # CONFIG_FB_ATY is not set
  4546. # CONFIG_FB_RADEON is not set
  4547. @@ -895,7 +885,6 @@ CONFIG_DUMMY_CONSOLE=y
  4548. # CONFIG_FB_VOODOO1 is not set
  4549. # CONFIG_FB_TRIDENT is not set
  4550. # CONFIG_FB_E1356 is not set
  4551. -CONFIG_FB_AU1100=y
  4552. # CONFIG_FB_IT8181 is not set
  4553. # CONFIG_FB_VIRTUAL is not set
  4554. CONFIG_FBCON_ADVANCED=y
  4555. --- /dev/null
  4556. +++ b/arch/mips/defconfig-db1200
  4557. @@ -0,0 +1,1032 @@
  4558. +#
  4559. +# Automatically generated make config: don't edit
  4560. +#
  4561. +CONFIG_MIPS=y
  4562. +CONFIG_MIPS32=y
  4563. +# CONFIG_MIPS64 is not set
  4564. +
  4565. +#
  4566. +# Code maturity level options
  4567. +#
  4568. +CONFIG_EXPERIMENTAL=y
  4569. +
  4570. +#
  4571. +# Loadable module support
  4572. +#
  4573. +CONFIG_MODULES=y
  4574. +# CONFIG_MODVERSIONS is not set
  4575. +CONFIG_KMOD=y
  4576. +
  4577. +#
  4578. +# Machine selection
  4579. +#
  4580. +# CONFIG_ACER_PICA_61 is not set
  4581. +# CONFIG_MIPS_BOSPORUS is not set
  4582. +# CONFIG_MIPS_MIRAGE is not set
  4583. +# CONFIG_MIPS_DB1000 is not set
  4584. +# CONFIG_MIPS_DB1100 is not set
  4585. +# CONFIG_MIPS_DB1500 is not set
  4586. +# CONFIG_MIPS_DB1550 is not set
  4587. +# CONFIG_MIPS_PB1000 is not set
  4588. +# CONFIG_MIPS_PB1100 is not set
  4589. +# CONFIG_MIPS_PB1500 is not set
  4590. +# CONFIG_MIPS_PB1550 is not set
  4591. +# CONFIG_MIPS_HYDROGEN3 is not set
  4592. +# CONFIG_MIPS_XXS1500 is not set
  4593. +# CONFIG_MIPS_MTX1 is not set
  4594. +# CONFIG_COGENT_CSB250 is not set
  4595. +# CONFIG_BAGET_MIPS is not set
  4596. +# CONFIG_CASIO_E55 is not set
  4597. +# CONFIG_MIPS_COBALT is not set
  4598. +# CONFIG_DECSTATION is not set
  4599. +# CONFIG_MIPS_EV64120 is not set
  4600. +# CONFIG_MIPS_EV96100 is not set
  4601. +# CONFIG_MIPS_IVR is not set
  4602. +# CONFIG_HP_LASERJET is not set
  4603. +# CONFIG_IBM_WORKPAD is not set
  4604. +# CONFIG_LASAT is not set
  4605. +# CONFIG_MIPS_ITE8172 is not set
  4606. +# CONFIG_MIPS_ATLAS is not set
  4607. +# CONFIG_MIPS_MAGNUM_4000 is not set
  4608. +# CONFIG_MIPS_MALTA is not set
  4609. +# CONFIG_MIPS_SEAD is not set
  4610. +# CONFIG_MOMENCO_OCELOT is not set
  4611. +# CONFIG_MOMENCO_OCELOT_G is not set
  4612. +# CONFIG_MOMENCO_OCELOT_C is not set
  4613. +# CONFIG_MOMENCO_JAGUAR_ATX is not set
  4614. +# CONFIG_PMC_BIG_SUR is not set
  4615. +# CONFIG_PMC_STRETCH is not set
  4616. +# CONFIG_PMC_YOSEMITE is not set
  4617. +# CONFIG_DDB5074 is not set
  4618. +# CONFIG_DDB5476 is not set
  4619. +# CONFIG_DDB5477 is not set
  4620. +# CONFIG_NEC_OSPREY is not set
  4621. +# CONFIG_NEC_EAGLE is not set
  4622. +# CONFIG_OLIVETTI_M700 is not set
  4623. +# CONFIG_NINO is not set
  4624. +# CONFIG_SGI_IP22 is not set
  4625. +# CONFIG_SGI_IP27 is not set
  4626. +# CONFIG_SIBYTE_SB1xxx_SOC is not set
  4627. +# CONFIG_SNI_RM200_PCI is not set
  4628. +# CONFIG_TANBAC_TB0226 is not set
  4629. +# CONFIG_TANBAC_TB0229 is not set
  4630. +# CONFIG_TOSHIBA_JMR3927 is not set
  4631. +# CONFIG_TOSHIBA_RBTX4927 is not set
  4632. +# CONFIG_VICTOR_MPC30X is not set
  4633. +# CONFIG_ZAO_CAPCELLA is not set
  4634. +# CONFIG_HIGHMEM is not set
  4635. +CONFIG_RWSEM_GENERIC_SPINLOCK=y
  4636. +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
  4637. +# CONFIG_MIPS_AU1000 is not set
  4638. +
  4639. +#
  4640. +# CPU selection
  4641. +#
  4642. +CONFIG_CPU_MIPS32=y
  4643. +# CONFIG_CPU_MIPS64 is not set
  4644. +# CONFIG_CPU_R3000 is not set
  4645. +# CONFIG_CPU_TX39XX is not set
  4646. +# CONFIG_CPU_VR41XX is not set
  4647. +# CONFIG_CPU_R4300 is not set
  4648. +# CONFIG_CPU_R4X00 is not set
  4649. +# CONFIG_CPU_TX49XX is not set
  4650. +# CONFIG_CPU_R5000 is not set
  4651. +# CONFIG_CPU_R5432 is not set
  4652. +# CONFIG_CPU_R6000 is not set
  4653. +# CONFIG_CPU_NEVADA is not set
  4654. +# CONFIG_CPU_R8000 is not set
  4655. +# CONFIG_CPU_R10000 is not set
  4656. +# CONFIG_CPU_RM7000 is not set
  4657. +# CONFIG_CPU_RM9000 is not set
  4658. +# CONFIG_CPU_SB1 is not set
  4659. +CONFIG_PAGE_SIZE_4KB=y
  4660. +# CONFIG_PAGE_SIZE_16KB is not set
  4661. +# CONFIG_PAGE_SIZE_64KB is not set
  4662. +CONFIG_CPU_HAS_PREFETCH=y
  4663. +# CONFIG_VTAG_ICACHE is not set
  4664. +CONFIG_64BIT_PHYS_ADDR=y
  4665. +# CONFIG_CPU_ADVANCED is not set
  4666. +CONFIG_CPU_HAS_LLSC=y
  4667. +# CONFIG_CPU_HAS_LLDSCD is not set
  4668. +# CONFIG_CPU_HAS_WB is not set
  4669. +CONFIG_CPU_HAS_SYNC=y
  4670. +
  4671. +#
  4672. +# General setup
  4673. +#
  4674. +CONFIG_CPU_LITTLE_ENDIAN=y
  4675. +# CONFIG_BUILD_ELF64 is not set
  4676. +CONFIG_NET=y
  4677. +CONFIG_PCI=y
  4678. +CONFIG_PCI_NEW=y
  4679. +CONFIG_PCI_AUTO=y
  4680. +# CONFIG_PCI_NAMES is not set
  4681. +# CONFIG_ISA is not set
  4682. +# CONFIG_TC is not set
  4683. +# CONFIG_MCA is not set
  4684. +# CONFIG_SBUS is not set
  4685. +CONFIG_HOTPLUG=y
  4686. +
  4687. +#
  4688. +# PCMCIA/CardBus support
  4689. +#
  4690. +CONFIG_PCMCIA=m
  4691. +# CONFIG_CARDBUS is not set
  4692. +# CONFIG_TCIC is not set
  4693. +# CONFIG_I82092 is not set
  4694. +# CONFIG_I82365 is not set
  4695. +
  4696. +#
  4697. +# PCI Hotplug Support
  4698. +#
  4699. +# CONFIG_HOTPLUG_PCI is not set
  4700. +# CONFIG_HOTPLUG_PCI_COMPAQ is not set
  4701. +# CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set
  4702. +# CONFIG_HOTPLUG_PCI_SHPC is not set
  4703. +# CONFIG_HOTPLUG_PCI_SHPC_POLL_EVENT_MODE is not set
  4704. +# CONFIG_HOTPLUG_PCI_PCIE is not set
  4705. +# CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE is not set
  4706. +CONFIG_SYSVIPC=y
  4707. +# CONFIG_BSD_PROCESS_ACCT is not set
  4708. +CONFIG_SYSCTL=y
  4709. +CONFIG_KCORE_ELF=y
  4710. +# CONFIG_KCORE_AOUT is not set
  4711. +# CONFIG_BINFMT_AOUT is not set
  4712. +CONFIG_BINFMT_ELF=y
  4713. +# CONFIG_MIPS32_COMPAT is not set
  4714. +# CONFIG_MIPS32_O32 is not set
  4715. +# CONFIG_MIPS32_N32 is not set
  4716. +# CONFIG_BINFMT_ELF32 is not set
  4717. +# CONFIG_BINFMT_MISC is not set
  4718. +# CONFIG_OOM_KILLER is not set
  4719. +CONFIG_CMDLINE_BOOL=y
  4720. +CONFIG_CMDLINE="mem=96M"
  4721. +
  4722. +#
  4723. +# Memory Technology Devices (MTD)
  4724. +#
  4725. +# CONFIG_MTD is not set
  4726. +
  4727. +#
  4728. +# Parallel port support
  4729. +#
  4730. +# CONFIG_PARPORT is not set
  4731. +
  4732. +#
  4733. +# Plug and Play configuration
  4734. +#
  4735. +# CONFIG_PNP is not set
  4736. +# CONFIG_ISAPNP is not set
  4737. +
  4738. +#
  4739. +# Block devices
  4740. +#
  4741. +# CONFIG_BLK_DEV_FD is not set
  4742. +# CONFIG_BLK_DEV_XD is not set
  4743. +# CONFIG_PARIDE is not set
  4744. +# CONFIG_BLK_CPQ_DA is not set
  4745. +# CONFIG_BLK_CPQ_CISS_DA is not set
  4746. +# CONFIG_CISS_SCSI_TAPE is not set
  4747. +# CONFIG_CISS_MONITOR_THREAD is not set
  4748. +# CONFIG_BLK_DEV_DAC960 is not set
  4749. +# CONFIG_BLK_DEV_UMEM is not set
  4750. +# CONFIG_BLK_DEV_SX8 is not set
  4751. +CONFIG_BLK_DEV_LOOP=y
  4752. +# CONFIG_BLK_DEV_NBD is not set
  4753. +# CONFIG_BLK_DEV_RAM is not set
  4754. +# CONFIG_BLK_DEV_INITRD is not set
  4755. +# CONFIG_BLK_STATS is not set
  4756. +
  4757. +#
  4758. +# Multi-device support (RAID and LVM)
  4759. +#
  4760. +# CONFIG_MD is not set
  4761. +# CONFIG_BLK_DEV_MD is not set
  4762. +# CONFIG_MD_LINEAR is not set
  4763. +# CONFIG_MD_RAID0 is not set
  4764. +# CONFIG_MD_RAID1 is not set
  4765. +# CONFIG_MD_RAID5 is not set
  4766. +# CONFIG_MD_MULTIPATH is not set
  4767. +# CONFIG_BLK_DEV_LVM is not set
  4768. +
  4769. +#
  4770. +# Networking options
  4771. +#
  4772. +CONFIG_PACKET=y
  4773. +# CONFIG_PACKET_MMAP is not set
  4774. +# CONFIG_NETLINK_DEV is not set
  4775. +CONFIG_NETFILTER=y
  4776. +# CONFIG_NETFILTER_DEBUG is not set
  4777. +CONFIG_FILTER=y
  4778. +CONFIG_UNIX=y
  4779. +CONFIG_INET=y
  4780. +CONFIG_IP_MULTICAST=y
  4781. +# CONFIG_IP_ADVANCED_ROUTER is not set
  4782. +CONFIG_IP_PNP=y
  4783. +# CONFIG_IP_PNP_DHCP is not set
  4784. +CONFIG_IP_PNP_BOOTP=y
  4785. +# CONFIG_IP_PNP_RARP is not set
  4786. +# CONFIG_NET_IPIP is not set
  4787. +# CONFIG_NET_IPGRE is not set
  4788. +# CONFIG_IP_MROUTE is not set
  4789. +# CONFIG_ARPD is not set
  4790. +# CONFIG_INET_ECN is not set
  4791. +# CONFIG_SYN_COOKIES is not set
  4792. +
  4793. +#
  4794. +# IP: Netfilter Configuration
  4795. +#
  4796. +# CONFIG_IP_NF_CONNTRACK is not set
  4797. +# CONFIG_IP_NF_QUEUE is not set
  4798. +# CONFIG_IP_NF_IPTABLES is not set
  4799. +# CONFIG_IP_NF_ARPTABLES is not set
  4800. +# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
  4801. +# CONFIG_IP_NF_COMPAT_IPFWADM is not set
  4802. +
  4803. +#
  4804. +# IP: Virtual Server Configuration
  4805. +#
  4806. +# CONFIG_IP_VS is not set
  4807. +# CONFIG_IPV6 is not set
  4808. +# CONFIG_KHTTPD is not set
  4809. +
  4810. +#
  4811. +# SCTP Configuration (EXPERIMENTAL)
  4812. +#
  4813. +# CONFIG_IP_SCTP is not set
  4814. +# CONFIG_ATM is not set
  4815. +# CONFIG_VLAN_8021Q is not set
  4816. +
  4817. +#
  4818. +#
  4819. +#
  4820. +# CONFIG_IPX is not set
  4821. +# CONFIG_ATALK is not set
  4822. +# CONFIG_DECNET is not set
  4823. +# CONFIG_BRIDGE is not set
  4824. +# CONFIG_X25 is not set
  4825. +# CONFIG_LAPB is not set
  4826. +# CONFIG_LLC is not set
  4827. +# CONFIG_NET_DIVERT is not set
  4828. +# CONFIG_ECONET is not set
  4829. +# CONFIG_WAN_ROUTER is not set
  4830. +# CONFIG_NET_FASTROUTE is not set
  4831. +# CONFIG_NET_HW_FLOWCONTROL is not set
  4832. +
  4833. +#
  4834. +# QoS and/or fair queueing
  4835. +#
  4836. +# CONFIG_NET_SCHED is not set
  4837. +
  4838. +#
  4839. +# Network testing
  4840. +#
  4841. +# CONFIG_NET_PKTGEN is not set
  4842. +
  4843. +#
  4844. +# Telephony Support
  4845. +#
  4846. +# CONFIG_PHONE is not set
  4847. +# CONFIG_PHONE_IXJ is not set
  4848. +# CONFIG_PHONE_IXJ_PCMCIA is not set
  4849. +
  4850. +#
  4851. +# ATA/IDE/MFM/RLL support
  4852. +#
  4853. +CONFIG_IDE=y
  4854. +
  4855. +#
  4856. +# IDE, ATA and ATAPI Block devices
  4857. +#
  4858. +CONFIG_BLK_DEV_IDE=y
  4859. +
  4860. +#
  4861. +# Please see Documentation/ide.txt for help/info on IDE drives
  4862. +#
  4863. +# CONFIG_BLK_DEV_HD_IDE is not set
  4864. +# CONFIG_BLK_DEV_HD is not set
  4865. +# CONFIG_BLK_DEV_IDE_SATA is not set
  4866. +CONFIG_BLK_DEV_IDEDISK=y
  4867. +CONFIG_IDEDISK_MULTI_MODE=y
  4868. +CONFIG_IDEDISK_STROKE=y
  4869. +CONFIG_BLK_DEV_IDECS=m
  4870. +# CONFIG_BLK_DEV_DELKIN is not set
  4871. +# CONFIG_BLK_DEV_IDECD is not set
  4872. +# CONFIG_BLK_DEV_IDETAPE is not set
  4873. +# CONFIG_BLK_DEV_IDEFLOPPY is not set
  4874. +# CONFIG_BLK_DEV_IDESCSI is not set
  4875. +# CONFIG_IDE_TASK_IOCTL is not set
  4876. +
  4877. +#
  4878. +# IDE chipset support/bugfixes
  4879. +#
  4880. +# CONFIG_BLK_DEV_CMD640 is not set
  4881. +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
  4882. +# CONFIG_BLK_DEV_ISAPNP is not set
  4883. +# CONFIG_BLK_DEV_IDEPCI is not set
  4884. +# CONFIG_IDE_CHIPSETS is not set
  4885. +# CONFIG_IDEDMA_AUTO is not set
  4886. +# CONFIG_DMA_NONPCI is not set
  4887. +# CONFIG_BLK_DEV_ATARAID is not set
  4888. +# CONFIG_BLK_DEV_ATARAID_PDC is not set
  4889. +# CONFIG_BLK_DEV_ATARAID_HPT is not set
  4890. +# CONFIG_BLK_DEV_ATARAID_MEDLEY is not set
  4891. +# CONFIG_BLK_DEV_ATARAID_SII is not set
  4892. +
  4893. +#
  4894. +# SCSI support
  4895. +#
  4896. +CONFIG_SCSI=y
  4897. +
  4898. +#
  4899. +# SCSI support type (disk, tape, CD-ROM)
  4900. +#
  4901. +CONFIG_BLK_DEV_SD=y
  4902. +CONFIG_SD_EXTRA_DEVS=40
  4903. +CONFIG_CHR_DEV_ST=y
  4904. +# CONFIG_CHR_DEV_OSST is not set
  4905. +CONFIG_BLK_DEV_SR=y
  4906. +# CONFIG_BLK_DEV_SR_VENDOR is not set
  4907. +CONFIG_SR_EXTRA_DEVS=2
  4908. +# CONFIG_CHR_DEV_SG is not set
  4909. +
  4910. +#
  4911. +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
  4912. +#
  4913. +# CONFIG_SCSI_DEBUG_QUEUES is not set
  4914. +# CONFIG_SCSI_MULTI_LUN is not set
  4915. +CONFIG_SCSI_CONSTANTS=y
  4916. +# CONFIG_SCSI_LOGGING is not set
  4917. +
  4918. +#
  4919. +# SCSI low-level drivers
  4920. +#
  4921. +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
  4922. +# CONFIG_SCSI_7000FASST is not set
  4923. +# CONFIG_SCSI_ACARD is not set
  4924. +# CONFIG_SCSI_AHA152X is not set
  4925. +# CONFIG_SCSI_AHA1542 is not set
  4926. +# CONFIG_SCSI_AHA1740 is not set
  4927. +# CONFIG_SCSI_AACRAID is not set
  4928. +# CONFIG_SCSI_AIC7XXX is not set
  4929. +# CONFIG_SCSI_AIC79XX is not set
  4930. +# CONFIG_SCSI_AIC7XXX_OLD is not set
  4931. +# CONFIG_SCSI_DPT_I2O is not set
  4932. +# CONFIG_SCSI_ADVANSYS is not set
  4933. +# CONFIG_SCSI_IN2000 is not set
  4934. +# CONFIG_SCSI_AM53C974 is not set
  4935. +# CONFIG_SCSI_MEGARAID is not set
  4936. +# CONFIG_SCSI_MEGARAID2 is not set
  4937. +# CONFIG_SCSI_SATA is not set
  4938. +# CONFIG_SCSI_SATA_AHCI is not set
  4939. +# CONFIG_SCSI_SATA_SVW is not set
  4940. +# CONFIG_SCSI_ATA_PIIX is not set
  4941. +# CONFIG_SCSI_SATA_NV is not set
  4942. +# CONFIG_SCSI_SATA_QSTOR is not set
  4943. +# CONFIG_SCSI_SATA_PROMISE is not set
  4944. +# CONFIG_SCSI_SATA_SX4 is not set
  4945. +# CONFIG_SCSI_SATA_SIL is not set
  4946. +# CONFIG_SCSI_SATA_SIS is not set
  4947. +# CONFIG_SCSI_SATA_ULI is not set
  4948. +# CONFIG_SCSI_SATA_VIA is not set
  4949. +# CONFIG_SCSI_SATA_VITESSE is not set
  4950. +# CONFIG_SCSI_BUSLOGIC is not set
  4951. +# CONFIG_SCSI_CPQFCTS is not set
  4952. +# CONFIG_SCSI_DMX3191D is not set
  4953. +# CONFIG_SCSI_DTC3280 is not set
  4954. +# CONFIG_SCSI_EATA is not set
  4955. +# CONFIG_SCSI_EATA_DMA is not set
  4956. +# CONFIG_SCSI_EATA_PIO is not set
  4957. +# CONFIG_SCSI_FUTURE_DOMAIN is not set
  4958. +# CONFIG_SCSI_GDTH is not set
  4959. +# CONFIG_SCSI_GENERIC_NCR5380 is not set
  4960. +# CONFIG_SCSI_INITIO is not set
  4961. +# CONFIG_SCSI_INIA100 is not set
  4962. +# CONFIG_SCSI_NCR53C406A is not set
  4963. +# CONFIG_SCSI_NCR53C7xx is not set
  4964. +# CONFIG_SCSI_SYM53C8XX_2 is not set
  4965. +# CONFIG_SCSI_NCR53C8XX is not set
  4966. +# CONFIG_SCSI_SYM53C8XX is not set
  4967. +# CONFIG_SCSI_PAS16 is not set
  4968. +# CONFIG_SCSI_PCI2000 is not set
  4969. +# CONFIG_SCSI_PCI2220I is not set
  4970. +# CONFIG_SCSI_PSI240I is not set
  4971. +# CONFIG_SCSI_QLOGIC_FAS is not set
  4972. +# CONFIG_SCSI_QLOGIC_ISP is not set
  4973. +# CONFIG_SCSI_QLOGIC_FC is not set
  4974. +# CONFIG_SCSI_QLOGIC_1280 is not set
  4975. +# CONFIG_SCSI_SIM710 is not set
  4976. +# CONFIG_SCSI_SYM53C416 is not set
  4977. +# CONFIG_SCSI_DC390T is not set
  4978. +# CONFIG_SCSI_T128 is not set
  4979. +# CONFIG_SCSI_U14_34F is not set
  4980. +# CONFIG_SCSI_NSP32 is not set
  4981. +# CONFIG_SCSI_DEBUG is not set
  4982. +
  4983. +#
  4984. +# PCMCIA SCSI adapter support
  4985. +#
  4986. +# CONFIG_SCSI_PCMCIA is not set
  4987. +
  4988. +#
  4989. +# Fusion MPT device support
  4990. +#
  4991. +# CONFIG_FUSION is not set
  4992. +# CONFIG_FUSION_BOOT is not set
  4993. +# CONFIG_FUSION_ISENSE is not set
  4994. +# CONFIG_FUSION_CTL is not set
  4995. +# CONFIG_FUSION_LAN is not set
  4996. +
  4997. +#
  4998. +# IEEE 1394 (FireWire) support (EXPERIMENTAL)
  4999. +#
  5000. +# CONFIG_IEEE1394 is not set
  5001. +
  5002. +#
  5003. +# I2O device support
  5004. +#
  5005. +# CONFIG_I2O is not set
  5006. +# CONFIG_I2O_PCI is not set
  5007. +# CONFIG_I2O_BLOCK is not set
  5008. +# CONFIG_I2O_LAN is not set
  5009. +# CONFIG_I2O_SCSI is not set
  5010. +# CONFIG_I2O_PROC is not set
  5011. +
  5012. +#
  5013. +# Network device support
  5014. +#
  5015. +CONFIG_NETDEVICES=y
  5016. +
  5017. +#
  5018. +# ARCnet devices
  5019. +#
  5020. +# CONFIG_ARCNET is not set
  5021. +# CONFIG_DUMMY is not set
  5022. +# CONFIG_BONDING is not set
  5023. +# CONFIG_EQUALIZER is not set
  5024. +# CONFIG_TUN is not set
  5025. +# CONFIG_ETHERTAP is not set
  5026. +
  5027. +#
  5028. +# Ethernet (10 or 100Mbit)
  5029. +#
  5030. +CONFIG_NET_ETHERNET=y
  5031. +# CONFIG_SUNLANCE is not set
  5032. +# CONFIG_HAPPYMEAL is not set
  5033. +# CONFIG_SUNBMAC is not set
  5034. +# CONFIG_SUNQE is not set
  5035. +# CONFIG_SUNGEM is not set
  5036. +# CONFIG_NET_VENDOR_3COM is not set
  5037. +# CONFIG_LANCE is not set
  5038. +# CONFIG_NET_VENDOR_SMC is not set
  5039. +# CONFIG_NET_VENDOR_RACAL is not set
  5040. +# CONFIG_HP100 is not set
  5041. +# CONFIG_NET_ISA is not set
  5042. +# CONFIG_NET_PCI is not set
  5043. +# CONFIG_NET_POCKET is not set
  5044. +
  5045. +#
  5046. +# Ethernet (1000 Mbit)
  5047. +#
  5048. +# CONFIG_ACENIC is not set
  5049. +# CONFIG_DL2K is not set
  5050. +# CONFIG_E1000 is not set
  5051. +# CONFIG_MYRI_SBUS is not set
  5052. +# CONFIG_NS83820 is not set
  5053. +# CONFIG_HAMACHI is not set
  5054. +# CONFIG_YELLOWFIN is not set
  5055. +# CONFIG_R8169 is not set
  5056. +# CONFIG_SK98LIN is not set
  5057. +# CONFIG_TIGON3 is not set
  5058. +# CONFIG_FDDI is not set
  5059. +# CONFIG_HIPPI is not set
  5060. +# CONFIG_PLIP is not set
  5061. +# CONFIG_PPP is not set
  5062. +# CONFIG_SLIP is not set
  5063. +
  5064. +#
  5065. +# Wireless LAN (non-hamradio)
  5066. +#
  5067. +# CONFIG_NET_RADIO is not set
  5068. +
  5069. +#
  5070. +# Token Ring devices
  5071. +#
  5072. +# CONFIG_TR is not set
  5073. +# CONFIG_NET_FC is not set
  5074. +# CONFIG_RCPCI is not set
  5075. +# CONFIG_SHAPER is not set
  5076. +
  5077. +#
  5078. +# Wan interfaces
  5079. +#
  5080. +# CONFIG_WAN is not set
  5081. +
  5082. +#
  5083. +# PCMCIA network device support
  5084. +#
  5085. +# CONFIG_NET_PCMCIA is not set
  5086. +
  5087. +#
  5088. +# Amateur Radio support
  5089. +#
  5090. +# CONFIG_HAMRADIO is not set
  5091. +
  5092. +#
  5093. +# IrDA (infrared) support
  5094. +#
  5095. +# CONFIG_IRDA is not set
  5096. +
  5097. +#
  5098. +# ISDN subsystem
  5099. +#
  5100. +# CONFIG_ISDN is not set
  5101. +
  5102. +#
  5103. +# Input core support
  5104. +#
  5105. +CONFIG_INPUT=y
  5106. +CONFIG_INPUT_KEYBDEV=y
  5107. +CONFIG_INPUT_MOUSEDEV=y
  5108. +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
  5109. +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
  5110. +# CONFIG_INPUT_JOYDEV is not set
  5111. +CONFIG_INPUT_EVDEV=y
  5112. +# CONFIG_INPUT_UINPUT is not set
  5113. +
  5114. +#
  5115. +# Character devices
  5116. +#
  5117. +CONFIG_VT=y
  5118. +# CONFIG_VT_CONSOLE is not set
  5119. +# CONFIG_SERIAL is not set
  5120. +# CONFIG_SERIAL_EXTENDED is not set
  5121. +CONFIG_SERIAL_NONSTANDARD=y
  5122. +# CONFIG_COMPUTONE is not set
  5123. +# CONFIG_ROCKETPORT is not set
  5124. +# CONFIG_CYCLADES is not set
  5125. +# CONFIG_DIGIEPCA is not set
  5126. +# CONFIG_DIGI is not set
  5127. +# CONFIG_ESPSERIAL is not set
  5128. +# CONFIG_MOXA_INTELLIO is not set
  5129. +# CONFIG_MOXA_SMARTIO is not set
  5130. +# CONFIG_ISI is not set
  5131. +# CONFIG_SYNCLINK is not set
  5132. +# CONFIG_SYNCLINKMP is not set
  5133. +# CONFIG_N_HDLC is not set
  5134. +# CONFIG_RISCOM8 is not set
  5135. +# CONFIG_SPECIALIX is not set
  5136. +# CONFIG_SX is not set
  5137. +# CONFIG_RIO is not set
  5138. +# CONFIG_STALDRV is not set
  5139. +# CONFIG_SERIAL_TX3912 is not set
  5140. +# CONFIG_SERIAL_TX3912_CONSOLE is not set
  5141. +# CONFIG_SERIAL_TXX9 is not set
  5142. +# CONFIG_SERIAL_TXX9_CONSOLE is not set
  5143. +# CONFIG_TXX927_SERIAL is not set
  5144. +CONFIG_UNIX98_PTYS=y
  5145. +CONFIG_UNIX98_PTY_COUNT=256
  5146. +
  5147. +#
  5148. +# I2C support
  5149. +#
  5150. +# CONFIG_I2C is not set
  5151. +
  5152. +#
  5153. +# Mice
  5154. +#
  5155. +# CONFIG_BUSMOUSE is not set
  5156. +# CONFIG_MOUSE is not set
  5157. +
  5158. +#
  5159. +# Joysticks
  5160. +#
  5161. +# CONFIG_INPUT_GAMEPORT is not set
  5162. +# CONFIG_INPUT_NS558 is not set
  5163. +# CONFIG_INPUT_LIGHTNING is not set
  5164. +# CONFIG_INPUT_PCIGAME is not set
  5165. +# CONFIG_INPUT_CS461X is not set
  5166. +# CONFIG_INPUT_EMU10K1 is not set
  5167. +# CONFIG_INPUT_SERIO is not set
  5168. +# CONFIG_INPUT_SERPORT is not set
  5169. +
  5170. +#
  5171. +# Joysticks
  5172. +#
  5173. +# CONFIG_INPUT_ANALOG is not set
  5174. +# CONFIG_INPUT_A3D is not set
  5175. +# CONFIG_INPUT_ADI is not set
  5176. +# CONFIG_INPUT_COBRA is not set
  5177. +# CONFIG_INPUT_GF2K is not set
  5178. +# CONFIG_INPUT_GRIP is not set
  5179. +# CONFIG_INPUT_INTERACT is not set
  5180. +# CONFIG_INPUT_TMDC is not set
  5181. +# CONFIG_INPUT_SIDEWINDER is not set
  5182. +# CONFIG_INPUT_IFORCE_USB is not set
  5183. +# CONFIG_INPUT_IFORCE_232 is not set
  5184. +# CONFIG_INPUT_WARRIOR is not set
  5185. +# CONFIG_INPUT_MAGELLAN is not set
  5186. +# CONFIG_INPUT_SPACEORB is not set
  5187. +# CONFIG_INPUT_SPACEBALL is not set
  5188. +# CONFIG_INPUT_STINGER is not set
  5189. +# CONFIG_INPUT_DB9 is not set
  5190. +# CONFIG_INPUT_GAMECON is not set
  5191. +# CONFIG_INPUT_TURBOGRAFX is not set
  5192. +# CONFIG_QIC02_TAPE is not set
  5193. +# CONFIG_IPMI_HANDLER is not set
  5194. +# CONFIG_IPMI_PANIC_EVENT is not set
  5195. +# CONFIG_IPMI_DEVICE_INTERFACE is not set
  5196. +# CONFIG_IPMI_KCS is not set
  5197. +# CONFIG_IPMI_WATCHDOG is not set
  5198. +
  5199. +#
  5200. +# Watchdog Cards
  5201. +#
  5202. +# CONFIG_WATCHDOG is not set
  5203. +# CONFIG_SCx200 is not set
  5204. +# CONFIG_SCx200_GPIO is not set
  5205. +# CONFIG_AMD_PM768 is not set
  5206. +# CONFIG_NVRAM is not set
  5207. +# CONFIG_RTC is not set
  5208. +# CONFIG_DTLK is not set
  5209. +# CONFIG_R3964 is not set
  5210. +# CONFIG_APPLICOM is not set
  5211. +
  5212. +#
  5213. +# Ftape, the floppy tape device driver
  5214. +#
  5215. +# CONFIG_FTAPE is not set
  5216. +# CONFIG_AGP is not set
  5217. +
  5218. +#
  5219. +# Direct Rendering Manager (XFree86 DRI support)
  5220. +#
  5221. +# CONFIG_DRM is not set
  5222. +
  5223. +#
  5224. +# PCMCIA character devices
  5225. +#
  5226. +# CONFIG_PCMCIA_SERIAL_CS is not set
  5227. +# CONFIG_SYNCLINK_CS is not set
  5228. +
  5229. +#
  5230. +# File systems
  5231. +#
  5232. +# CONFIG_QUOTA is not set
  5233. +# CONFIG_QFMT_V2 is not set
  5234. +CONFIG_AUTOFS_FS=y
  5235. +# CONFIG_AUTOFS4_FS is not set
  5236. +# CONFIG_REISERFS_FS is not set
  5237. +# CONFIG_REISERFS_CHECK is not set
  5238. +# CONFIG_REISERFS_PROC_INFO is not set
  5239. +# CONFIG_ADFS_FS is not set
  5240. +# CONFIG_ADFS_FS_RW is not set
  5241. +# CONFIG_AFFS_FS is not set
  5242. +# CONFIG_HFS_FS is not set
  5243. +# CONFIG_HFSPLUS_FS is not set
  5244. +# CONFIG_BEFS_FS is not set
  5245. +# CONFIG_BEFS_DEBUG is not set
  5246. +# CONFIG_BFS_FS is not set
  5247. +CONFIG_EXT3_FS=y
  5248. +CONFIG_JBD=y
  5249. +# CONFIG_JBD_DEBUG is not set
  5250. +CONFIG_FAT_FS=y
  5251. +CONFIG_MSDOS_FS=y
  5252. +# CONFIG_UMSDOS_FS is not set
  5253. +CONFIG_VFAT_FS=y
  5254. +# CONFIG_EFS_FS is not set
  5255. +# CONFIG_JFFS_FS is not set
  5256. +# CONFIG_JFFS2_FS is not set
  5257. +# CONFIG_CRAMFS is not set
  5258. +CONFIG_TMPFS=y
  5259. +CONFIG_RAMFS=y
  5260. +# CONFIG_ISO9660_FS is not set
  5261. +# CONFIG_JOLIET is not set
  5262. +# CONFIG_ZISOFS is not set
  5263. +# CONFIG_JFS_FS is not set
  5264. +# CONFIG_JFS_DEBUG is not set
  5265. +# CONFIG_JFS_STATISTICS is not set
  5266. +# CONFIG_MINIX_FS is not set
  5267. +# CONFIG_VXFS_FS is not set
  5268. +# CONFIG_NTFS_FS is not set
  5269. +# CONFIG_NTFS_RW is not set
  5270. +# CONFIG_HPFS_FS is not set
  5271. +CONFIG_PROC_FS=y
  5272. +# CONFIG_DEVFS_FS is not set
  5273. +# CONFIG_DEVFS_MOUNT is not set
  5274. +# CONFIG_DEVFS_DEBUG is not set
  5275. +CONFIG_DEVPTS_FS=y
  5276. +# CONFIG_QNX4FS_FS is not set
  5277. +# CONFIG_QNX4FS_RW is not set
  5278. +# CONFIG_ROMFS_FS is not set
  5279. +CONFIG_EXT2_FS=y
  5280. +# CONFIG_SYSV_FS is not set
  5281. +# CONFIG_UDF_FS is not set
  5282. +# CONFIG_UDF_RW is not set
  5283. +# CONFIG_UFS_FS is not set
  5284. +# CONFIG_UFS_FS_WRITE is not set
  5285. +# CONFIG_XFS_FS is not set
  5286. +# CONFIG_XFS_QUOTA is not set
  5287. +# CONFIG_XFS_RT is not set
  5288. +# CONFIG_XFS_TRACE is not set
  5289. +# CONFIG_XFS_DEBUG is not set
  5290. +
  5291. +#
  5292. +# Network File Systems
  5293. +#
  5294. +# CONFIG_CODA_FS is not set
  5295. +# CONFIG_INTERMEZZO_FS is not set
  5296. +CONFIG_NFS_FS=y
  5297. +CONFIG_NFS_V3=y
  5298. +# CONFIG_NFS_DIRECTIO is not set
  5299. +CONFIG_ROOT_NFS=y
  5300. +# CONFIG_NFSD is not set
  5301. +# CONFIG_NFSD_V3 is not set
  5302. +# CONFIG_NFSD_TCP is not set
  5303. +CONFIG_SUNRPC=y
  5304. +CONFIG_LOCKD=y
  5305. +CONFIG_LOCKD_V4=y
  5306. +# CONFIG_SMB_FS is not set
  5307. +# CONFIG_NCP_FS is not set
  5308. +# CONFIG_NCPFS_PACKET_SIGNING is not set
  5309. +# CONFIG_NCPFS_IOCTL_LOCKING is not set
  5310. +# CONFIG_NCPFS_STRONG is not set
  5311. +# CONFIG_NCPFS_NFS_NS is not set
  5312. +# CONFIG_NCPFS_OS2_NS is not set
  5313. +# CONFIG_NCPFS_SMALLDOS is not set
  5314. +# CONFIG_NCPFS_NLS is not set
  5315. +# CONFIG_NCPFS_EXTRAS is not set
  5316. +# CONFIG_ZISOFS_FS is not set
  5317. +
  5318. +#
  5319. +# Partition Types
  5320. +#
  5321. +# CONFIG_PARTITION_ADVANCED is not set
  5322. +CONFIG_MSDOS_PARTITION=y
  5323. +# CONFIG_SMB_NLS is not set
  5324. +CONFIG_NLS=y
  5325. +
  5326. +#
  5327. +# Native Language Support
  5328. +#
  5329. +CONFIG_NLS_DEFAULT="iso8859-1"
  5330. +# CONFIG_NLS_CODEPAGE_437 is not set
  5331. +# CONFIG_NLS_CODEPAGE_737 is not set
  5332. +# CONFIG_NLS_CODEPAGE_775 is not set
  5333. +# CONFIG_NLS_CODEPAGE_850 is not set
  5334. +# CONFIG_NLS_CODEPAGE_852 is not set
  5335. +# CONFIG_NLS_CODEPAGE_855 is not set
  5336. +# CONFIG_NLS_CODEPAGE_857 is not set
  5337. +# CONFIG_NLS_CODEPAGE_860 is not set
  5338. +# CONFIG_NLS_CODEPAGE_861 is not set
  5339. +# CONFIG_NLS_CODEPAGE_862 is not set
  5340. +# CONFIG_NLS_CODEPAGE_863 is not set
  5341. +# CONFIG_NLS_CODEPAGE_864 is not set
  5342. +# CONFIG_NLS_CODEPAGE_865 is not set
  5343. +# CONFIG_NLS_CODEPAGE_866 is not set
  5344. +# CONFIG_NLS_CODEPAGE_869 is not set
  5345. +# CONFIG_NLS_CODEPAGE_936 is not set
  5346. +# CONFIG_NLS_CODEPAGE_950 is not set
  5347. +# CONFIG_NLS_CODEPAGE_932 is not set
  5348. +# CONFIG_NLS_CODEPAGE_949 is not set
  5349. +# CONFIG_NLS_CODEPAGE_874 is not set
  5350. +# CONFIG_NLS_ISO8859_8 is not set
  5351. +# CONFIG_NLS_CODEPAGE_1250 is not set
  5352. +# CONFIG_NLS_CODEPAGE_1251 is not set
  5353. +# CONFIG_NLS_ISO8859_1 is not set
  5354. +# CONFIG_NLS_ISO8859_2 is not set
  5355. +# CONFIG_NLS_ISO8859_3 is not set
  5356. +# CONFIG_NLS_ISO8859_4 is not set
  5357. +# CONFIG_NLS_ISO8859_5 is not set
  5358. +# CONFIG_NLS_ISO8859_6 is not set
  5359. +# CONFIG_NLS_ISO8859_7 is not set
  5360. +# CONFIG_NLS_ISO8859_9 is not set
  5361. +# CONFIG_NLS_ISO8859_13 is not set
  5362. +# CONFIG_NLS_ISO8859_14 is not set
  5363. +# CONFIG_NLS_ISO8859_15 is not set
  5364. +# CONFIG_NLS_KOI8_R is not set
  5365. +# CONFIG_NLS_KOI8_U is not set
  5366. +# CONFIG_NLS_UTF8 is not set
  5367. +
  5368. +#
  5369. +# Multimedia devices
  5370. +#
  5371. +# CONFIG_VIDEO_DEV is not set
  5372. +
  5373. +#
  5374. +# Console drivers
  5375. +#
  5376. +# CONFIG_VGA_CONSOLE is not set
  5377. +# CONFIG_MDA_CONSOLE is not set
  5378. +
  5379. +#
  5380. +# Frame-buffer support
  5381. +#
  5382. +CONFIG_FB=y
  5383. +CONFIG_DUMMY_CONSOLE=y
  5384. +# CONFIG_FB_RIVA is not set
  5385. +# CONFIG_FB_CLGEN is not set
  5386. +# CONFIG_FB_PM2 is not set
  5387. +# CONFIG_FB_PM3 is not set
  5388. +# CONFIG_FB_CYBER2000 is not set
  5389. +# CONFIG_FB_MATROX is not set
  5390. +# CONFIG_FB_ATY is not set
  5391. +# CONFIG_FB_RADEON is not set
  5392. +# CONFIG_FB_ATY128 is not set
  5393. +# CONFIG_FB_INTEL is not set
  5394. +# CONFIG_FB_SIS is not set
  5395. +# CONFIG_FB_NEOMAGIC is not set
  5396. +# CONFIG_FB_3DFX is not set
  5397. +# CONFIG_FB_VOODOO1 is not set
  5398. +# CONFIG_FB_TRIDENT is not set
  5399. +# CONFIG_FB_E1356 is not set
  5400. +# CONFIG_FB_IT8181 is not set
  5401. +# CONFIG_FB_VIRTUAL is not set
  5402. +CONFIG_FBCON_ADVANCED=y
  5403. +# CONFIG_FBCON_MFB is not set
  5404. +# CONFIG_FBCON_CFB2 is not set
  5405. +# CONFIG_FBCON_CFB4 is not set
  5406. +# CONFIG_FBCON_CFB8 is not set
  5407. +CONFIG_FBCON_CFB16=y
  5408. +# CONFIG_FBCON_CFB24 is not set
  5409. +CONFIG_FBCON_CFB32=y
  5410. +# CONFIG_FBCON_AFB is not set
  5411. +# CONFIG_FBCON_ILBM is not set
  5412. +# CONFIG_FBCON_IPLAN2P2 is not set
  5413. +# CONFIG_FBCON_IPLAN2P4 is not set
  5414. +# CONFIG_FBCON_IPLAN2P8 is not set
  5415. +# CONFIG_FBCON_MAC is not set
  5416. +# CONFIG_FBCON_VGA_PLANES is not set
  5417. +# CONFIG_FBCON_VGA is not set
  5418. +# CONFIG_FBCON_HGA is not set
  5419. +# CONFIG_FBCON_FONTWIDTH8_ONLY is not set
  5420. +CONFIG_FBCON_FONTS=y
  5421. +CONFIG_FONT_8x8=y
  5422. +CONFIG_FONT_8x16=y
  5423. +# CONFIG_FONT_SUN8x16 is not set
  5424. +# CONFIG_FONT_SUN12x22 is not set
  5425. +# CONFIG_FONT_6x11 is not set
  5426. +# CONFIG_FONT_PEARL_8x8 is not set
  5427. +# CONFIG_FONT_ACORN_8x8 is not set
  5428. +
  5429. +#
  5430. +# Sound
  5431. +#
  5432. +CONFIG_SOUND=y
  5433. +# CONFIG_SOUND_ALI5455 is not set
  5434. +# CONFIG_SOUND_BT878 is not set
  5435. +# CONFIG_SOUND_CMPCI is not set
  5436. +# CONFIG_SOUND_EMU10K1 is not set
  5437. +# CONFIG_MIDI_EMU10K1 is not set
  5438. +# CONFIG_SOUND_FUSION is not set
  5439. +# CONFIG_SOUND_CS4281 is not set
  5440. +# CONFIG_SOUND_ES1370 is not set
  5441. +# CONFIG_SOUND_ES1371 is not set
  5442. +# CONFIG_SOUND_ESSSOLO1 is not set
  5443. +# CONFIG_SOUND_MAESTRO is not set
  5444. +# CONFIG_SOUND_MAESTRO3 is not set
  5445. +# CONFIG_SOUND_FORTE is not set
  5446. +# CONFIG_SOUND_ICH is not set
  5447. +# CONFIG_SOUND_RME96XX is not set
  5448. +# CONFIG_SOUND_SONICVIBES is not set
  5449. +# CONFIG_SOUND_TRIDENT is not set
  5450. +# CONFIG_SOUND_MSNDCLAS is not set
  5451. +# CONFIG_SOUND_MSNDPIN is not set
  5452. +# CONFIG_SOUND_VIA82CXXX is not set
  5453. +# CONFIG_MIDI_VIA82CXXX is not set
  5454. +# CONFIG_SOUND_OSS is not set
  5455. +# CONFIG_SOUND_TVMIXER is not set
  5456. +# CONFIG_SOUND_AD1980 is not set
  5457. +# CONFIG_SOUND_WM97XX is not set
  5458. +
  5459. +#
  5460. +# USB support
  5461. +#
  5462. +CONFIG_USB=y
  5463. +# CONFIG_USB_DEBUG is not set
  5464. +
  5465. +#
  5466. +# Miscellaneous USB options
  5467. +#
  5468. +CONFIG_USB_DEVICEFS=y
  5469. +# CONFIG_USB_BANDWIDTH is not set
  5470. +
  5471. +#
  5472. +# USB Host Controller Drivers
  5473. +#
  5474. +# CONFIG_USB_EHCI_HCD is not set
  5475. +# CONFIG_USB_UHCI is not set
  5476. +# CONFIG_USB_UHCI_ALT is not set
  5477. +CONFIG_USB_OHCI=y
  5478. +
  5479. +#
  5480. +# USB Device Class drivers
  5481. +#
  5482. +# CONFIG_USB_AUDIO is not set
  5483. +# CONFIG_USB_EMI26 is not set
  5484. +# CONFIG_USB_BLUETOOTH is not set
  5485. +# CONFIG_USB_MIDI is not set
  5486. +CONFIG_USB_STORAGE=y
  5487. +# CONFIG_USB_STORAGE_DEBUG is not set
  5488. +# CONFIG_USB_STORAGE_DATAFAB is not set
  5489. +# CONFIG_USB_STORAGE_FREECOM is not set
  5490. +# CONFIG_USB_STORAGE_ISD200 is not set
  5491. +# CONFIG_USB_STORAGE_DPCM is not set
  5492. +# CONFIG_USB_STORAGE_HP8200e is not set
  5493. +# CONFIG_USB_STORAGE_SDDR09 is not set
  5494. +# CONFIG_USB_STORAGE_SDDR55 is not set
  5495. +# CONFIG_USB_STORAGE_JUMPSHOT is not set
  5496. +# CONFIG_USB_ACM is not set
  5497. +# CONFIG_USB_PRINTER is not set
  5498. +
  5499. +#
  5500. +# USB Human Interface Devices (HID)
  5501. +#
  5502. +CONFIG_USB_HID=y
  5503. +CONFIG_USB_HIDINPUT=y
  5504. +CONFIG_USB_HIDDEV=y
  5505. +# CONFIG_USB_AIPTEK is not set
  5506. +# CONFIG_USB_WACOM is not set
  5507. +# CONFIG_USB_KBTAB is not set
  5508. +# CONFIG_USB_POWERMATE is not set
  5509. +
  5510. +#
  5511. +# USB Imaging devices
  5512. +#
  5513. +# CONFIG_USB_DC2XX is not set
  5514. +# CONFIG_USB_MDC800 is not set
  5515. +# CONFIG_USB_SCANNER is not set
  5516. +# CONFIG_USB_MICROTEK is not set
  5517. +# CONFIG_USB_HPUSBSCSI is not set
  5518. +
  5519. +#
  5520. +# USB Multimedia devices
  5521. +#
  5522. +
  5523. +#
  5524. +# Video4Linux support is needed for USB Multimedia device support
  5525. +#
  5526. +
  5527. +#
  5528. +# USB Network adaptors
  5529. +#
  5530. +# CONFIG_USB_PEGASUS is not set
  5531. +# CONFIG_USB_RTL8150 is not set
  5532. +# CONFIG_USB_KAWETH is not set
  5533. +# CONFIG_USB_CATC is not set
  5534. +# CONFIG_USB_CDCETHER is not set
  5535. +# CONFIG_USB_USBNET is not set
  5536. +
  5537. +#
  5538. +# USB port drivers
  5539. +#
  5540. +# CONFIG_USB_USS720 is not set
  5541. +
  5542. +#
  5543. +# USB Serial Converter support
  5544. +#
  5545. +# CONFIG_USB_SERIAL is not set
  5546. +
  5547. +#
  5548. +# USB Miscellaneous drivers
  5549. +#
  5550. +# CONFIG_USB_RIO500 is not set
  5551. +# CONFIG_USB_AUERSWALD is not set
  5552. +# CONFIG_USB_TIGL is not set
  5553. +# CONFIG_USB_BRLVGER is not set
  5554. +# CONFIG_USB_LCD is not set
  5555. +
  5556. +#
  5557. +# Support for USB gadgets
  5558. +#
  5559. +# CONFIG_USB_GADGET is not set
  5560. +
  5561. +#
  5562. +# Bluetooth support
  5563. +#
  5564. +# CONFIG_BLUEZ is not set
  5565. +
  5566. +#
  5567. +# Kernel hacking
  5568. +#
  5569. +CONFIG_CROSSCOMPILE=y
  5570. +# CONFIG_RUNTIME_DEBUG is not set
  5571. +# CONFIG_KGDB is not set
  5572. +# CONFIG_GDB_CONSOLE is not set
  5573. +# CONFIG_DEBUG_INFO is not set
  5574. +# CONFIG_MAGIC_SYSRQ is not set
  5575. +# CONFIG_MIPS_UNCACHED is not set
  5576. +CONFIG_LOG_BUF_SHIFT=0
  5577. +
  5578. +#
  5579. +# Cryptographic options
  5580. +#
  5581. +# CONFIG_CRYPTO is not set
  5582. +
  5583. +#
  5584. +# Library routines
  5585. +#
  5586. +# CONFIG_CRC32 is not set
  5587. +CONFIG_ZLIB_INFLATE=m
  5588. +CONFIG_ZLIB_DEFLATE=m
  5589. +# CONFIG_FW_LOADER is not set
  5590. --- a/arch/mips/defconfig-db1500
  5591. +++ b/arch/mips/defconfig-db1500
  5592. @@ -30,8 +30,8 @@ CONFIG_MIPS_DB1500=y
  5593. # CONFIG_MIPS_PB1000 is not set
  5594. # CONFIG_MIPS_PB1100 is not set
  5595. # CONFIG_MIPS_PB1500 is not set
  5596. -# CONFIG_MIPS_HYDROGEN3 is not set
  5597. # CONFIG_MIPS_PB1550 is not set
  5598. +# CONFIG_MIPS_HYDROGEN3 is not set
  5599. # CONFIG_MIPS_XXS1500 is not set
  5600. # CONFIG_MIPS_MTX1 is not set
  5601. # CONFIG_COGENT_CSB250 is not set
  5602. @@ -267,11 +267,6 @@ CONFIG_IP_PNP_BOOTP=y
  5603. #
  5604. # CONFIG_IPX is not set
  5605. # CONFIG_ATALK is not set
  5606. -
  5607. -#
  5608. -# Appletalk devices
  5609. -#
  5610. -# CONFIG_DEV_APPLETALK is not set
  5611. # CONFIG_DECNET is not set
  5612. # CONFIG_BRIDGE is not set
  5613. # CONFIG_X25 is not set
  5614. @@ -555,7 +550,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  5615. # CONFIG_AU1X00_USB_TTY is not set
  5616. # CONFIG_AU1X00_USB_RAW is not set
  5617. # CONFIG_TXX927_SERIAL is not set
  5618. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  5619. CONFIG_UNIX98_PTYS=y
  5620. CONFIG_UNIX98_PTY_COUNT=256
  5621. --- a/arch/mips/defconfig-db1550
  5622. +++ b/arch/mips/defconfig-db1550
  5623. @@ -30,8 +30,8 @@ CONFIG_MIPS_DB1550=y
  5624. # CONFIG_MIPS_PB1000 is not set
  5625. # CONFIG_MIPS_PB1100 is not set
  5626. # CONFIG_MIPS_PB1500 is not set
  5627. -# CONFIG_MIPS_HYDROGEN3 is not set
  5628. # CONFIG_MIPS_PB1550 is not set
  5629. +# CONFIG_MIPS_HYDROGEN3 is not set
  5630. # CONFIG_MIPS_XXS1500 is not set
  5631. # CONFIG_MIPS_MTX1 is not set
  5632. # CONFIG_COGENT_CSB250 is not set
  5633. @@ -213,11 +213,9 @@ CONFIG_MTD_CFI_AMDSTD=y
  5634. # CONFIG_MTD_BOSPORUS is not set
  5635. # CONFIG_MTD_XXS1500 is not set
  5636. # CONFIG_MTD_MTX1 is not set
  5637. -# CONFIG_MTD_DB1X00 is not set
  5638. CONFIG_MTD_PB1550=y
  5639. CONFIG_MTD_PB1550_BOOT=y
  5640. CONFIG_MTD_PB1550_USER=y
  5641. -# CONFIG_MTD_HYDROGEN3 is not set
  5642. # CONFIG_MTD_MIRAGE is not set
  5643. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  5644. # CONFIG_MTD_OCELOT is not set
  5645. @@ -236,7 +234,6 @@ CONFIG_MTD_PB1550_USER=y
  5646. #
  5647. # Disk-On-Chip Device Drivers
  5648. #
  5649. -# CONFIG_MTD_DOC1000 is not set
  5650. # CONFIG_MTD_DOC2000 is not set
  5651. # CONFIG_MTD_DOC2001 is not set
  5652. # CONFIG_MTD_DOCPROBE is not set
  5653. @@ -343,11 +340,6 @@ CONFIG_IP_PNP_BOOTP=y
  5654. #
  5655. # CONFIG_IPX is not set
  5656. # CONFIG_ATALK is not set
  5657. -
  5658. -#
  5659. -# Appletalk devices
  5660. -#
  5661. -# CONFIG_DEV_APPLETALK is not set
  5662. # CONFIG_DECNET is not set
  5663. # CONFIG_BRIDGE is not set
  5664. # CONFIG_X25 is not set
  5665. @@ -633,7 +625,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  5666. # CONFIG_AU1X00_USB_TTY is not set
  5667. # CONFIG_AU1X00_USB_RAW is not set
  5668. # CONFIG_TXX927_SERIAL is not set
  5669. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  5670. CONFIG_UNIX98_PTYS=y
  5671. CONFIG_UNIX98_PTY_COUNT=256
  5672. --- a/arch/mips/defconfig-ddb5476
  5673. +++ b/arch/mips/defconfig-ddb5476
  5674. @@ -28,8 +28,8 @@ CONFIG_EXPERIMENTAL=y
  5675. # CONFIG_MIPS_PB1000 is not set
  5676. # CONFIG_MIPS_PB1100 is not set
  5677. # CONFIG_MIPS_PB1500 is not set
  5678. -# CONFIG_MIPS_HYDROGEN3 is not set
  5679. # CONFIG_MIPS_PB1550 is not set
  5680. +# CONFIG_MIPS_HYDROGEN3 is not set
  5681. # CONFIG_MIPS_XXS1500 is not set
  5682. # CONFIG_MIPS_MTX1 is not set
  5683. # CONFIG_COGENT_CSB250 is not set
  5684. @@ -226,11 +226,6 @@ CONFIG_IP_PNP_BOOTP=y
  5685. #
  5686. # CONFIG_IPX is not set
  5687. # CONFIG_ATALK is not set
  5688. -
  5689. -#
  5690. -# Appletalk devices
  5691. -#
  5692. -# CONFIG_DEV_APPLETALK is not set
  5693. # CONFIG_DECNET is not set
  5694. # CONFIG_BRIDGE is not set
  5695. # CONFIG_X25 is not set
  5696. @@ -517,7 +512,6 @@ CONFIG_SERIAL=y
  5697. CONFIG_SERIAL_CONSOLE=y
  5698. # CONFIG_SERIAL_EXTENDED is not set
  5699. # CONFIG_SERIAL_NONSTANDARD is not set
  5700. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  5701. CONFIG_UNIX98_PTYS=y
  5702. CONFIG_UNIX98_PTY_COUNT=256
  5703. --- a/arch/mips/defconfig-ddb5477
  5704. +++ b/arch/mips/defconfig-ddb5477
  5705. @@ -28,8 +28,8 @@ CONFIG_EXPERIMENTAL=y
  5706. # CONFIG_MIPS_PB1000 is not set
  5707. # CONFIG_MIPS_PB1100 is not set
  5708. # CONFIG_MIPS_PB1500 is not set
  5709. -# CONFIG_MIPS_HYDROGEN3 is not set
  5710. # CONFIG_MIPS_PB1550 is not set
  5711. +# CONFIG_MIPS_HYDROGEN3 is not set
  5712. # CONFIG_MIPS_XXS1500 is not set
  5713. # CONFIG_MIPS_MTX1 is not set
  5714. # CONFIG_COGENT_CSB250 is not set
  5715. @@ -226,11 +226,6 @@ CONFIG_IP_PNP_BOOTP=y
  5716. #
  5717. # CONFIG_IPX is not set
  5718. # CONFIG_ATALK is not set
  5719. -
  5720. -#
  5721. -# Appletalk devices
  5722. -#
  5723. -# CONFIG_DEV_APPLETALK is not set
  5724. # CONFIG_DECNET is not set
  5725. # CONFIG_BRIDGE is not set
  5726. # CONFIG_X25 is not set
  5727. @@ -434,7 +429,6 @@ CONFIG_SERIAL=y
  5728. CONFIG_SERIAL_CONSOLE=y
  5729. # CONFIG_SERIAL_EXTENDED is not set
  5730. # CONFIG_SERIAL_NONSTANDARD is not set
  5731. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  5732. CONFIG_UNIX98_PTYS=y
  5733. CONFIG_UNIX98_PTY_COUNT=256
  5734. --- a/arch/mips/defconfig-decstation
  5735. +++ b/arch/mips/defconfig-decstation
  5736. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  5737. # CONFIG_MIPS_PB1000 is not set
  5738. # CONFIG_MIPS_PB1100 is not set
  5739. # CONFIG_MIPS_PB1500 is not set
  5740. -# CONFIG_MIPS_HYDROGEN3 is not set
  5741. # CONFIG_MIPS_PB1550 is not set
  5742. +# CONFIG_MIPS_HYDROGEN3 is not set
  5743. # CONFIG_MIPS_XXS1500 is not set
  5744. # CONFIG_MIPS_MTX1 is not set
  5745. # CONFIG_COGENT_CSB250 is not set
  5746. @@ -223,11 +223,6 @@ CONFIG_IP_PNP_BOOTP=y
  5747. #
  5748. # CONFIG_IPX is not set
  5749. # CONFIG_ATALK is not set
  5750. -
  5751. -#
  5752. -# Appletalk devices
  5753. -#
  5754. -# CONFIG_DEV_APPLETALK is not set
  5755. # CONFIG_DECNET is not set
  5756. # CONFIG_BRIDGE is not set
  5757. # CONFIG_X25 is not set
  5758. @@ -306,9 +301,11 @@ CONFIG_SCSI_DECNCR=y
  5759. # CONFIG_SCSI_MEGARAID is not set
  5760. # CONFIG_SCSI_MEGARAID2 is not set
  5761. # CONFIG_SCSI_SATA is not set
  5762. +# CONFIG_SCSI_SATA_AHCI is not set
  5763. # CONFIG_SCSI_SATA_SVW is not set
  5764. # CONFIG_SCSI_ATA_PIIX is not set
  5765. # CONFIG_SCSI_SATA_NV is not set
  5766. +# CONFIG_SCSI_SATA_QSTOR is not set
  5767. # CONFIG_SCSI_SATA_PROMISE is not set
  5768. # CONFIG_SCSI_SATA_SX4 is not set
  5769. # CONFIG_SCSI_SATA_SIL is not set
  5770. @@ -477,7 +474,6 @@ CONFIG_SERIAL_DEC=y
  5771. CONFIG_SERIAL_DEC_CONSOLE=y
  5772. CONFIG_DZ=y
  5773. CONFIG_ZS=y
  5774. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  5775. CONFIG_UNIX98_PTYS=y
  5776. CONFIG_UNIX98_PTY_COUNT=256
  5777. --- a/arch/mips/defconfig-e55
  5778. +++ b/arch/mips/defconfig-e55
  5779. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  5780. # CONFIG_MIPS_PB1000 is not set
  5781. # CONFIG_MIPS_PB1100 is not set
  5782. # CONFIG_MIPS_PB1500 is not set
  5783. -# CONFIG_MIPS_HYDROGEN3 is not set
  5784. # CONFIG_MIPS_PB1550 is not set
  5785. +# CONFIG_MIPS_HYDROGEN3 is not set
  5786. # CONFIG_MIPS_XXS1500 is not set
  5787. # CONFIG_MIPS_MTX1 is not set
  5788. # CONFIG_COGENT_CSB250 is not set
  5789. @@ -222,11 +222,6 @@ CONFIG_IP_MULTICAST=y
  5790. #
  5791. # CONFIG_IPX is not set
  5792. # CONFIG_ATALK is not set
  5793. -
  5794. -#
  5795. -# Appletalk devices
  5796. -#
  5797. -# CONFIG_DEV_APPLETALK is not set
  5798. # CONFIG_DECNET is not set
  5799. # CONFIG_BRIDGE is not set
  5800. # CONFIG_X25 is not set
  5801. @@ -426,7 +421,6 @@ CONFIG_SERIAL_MANY_PORTS=y
  5802. # CONFIG_SERIAL_MULTIPORT is not set
  5803. # CONFIG_HUB6 is not set
  5804. # CONFIG_SERIAL_NONSTANDARD is not set
  5805. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  5806. # CONFIG_VR41XX_KIU is not set
  5807. CONFIG_UNIX98_PTYS=y
  5808. CONFIG_UNIX98_PTY_COUNT=256
  5809. --- a/arch/mips/defconfig-eagle
  5810. +++ b/arch/mips/defconfig-eagle
  5811. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  5812. # CONFIG_MIPS_PB1000 is not set
  5813. # CONFIG_MIPS_PB1100 is not set
  5814. # CONFIG_MIPS_PB1500 is not set
  5815. -# CONFIG_MIPS_HYDROGEN3 is not set
  5816. # CONFIG_MIPS_PB1550 is not set
  5817. +# CONFIG_MIPS_HYDROGEN3 is not set
  5818. # CONFIG_MIPS_XXS1500 is not set
  5819. # CONFIG_MIPS_MTX1 is not set
  5820. # CONFIG_COGENT_CSB250 is not set
  5821. @@ -208,8 +208,8 @@ CONFIG_MTD_CFI_INTELEXT=y
  5822. # Mapping drivers for chip access
  5823. #
  5824. CONFIG_MTD_PHYSMAP=y
  5825. -CONFIG_MTD_PHYSMAP_START=1c000000
  5826. -CONFIG_MTD_PHYSMAP_LEN=2000000
  5827. +CONFIG_MTD_PHYSMAP_START=0x1c000000
  5828. +CONFIG_MTD_PHYSMAP_LEN=0x2000000
  5829. CONFIG_MTD_PHYSMAP_BUSWIDTH=4
  5830. # CONFIG_MTD_PB1000 is not set
  5831. # CONFIG_MTD_PB1500 is not set
  5832. @@ -217,9 +217,7 @@ CONFIG_MTD_PHYSMAP_BUSWIDTH=4
  5833. # CONFIG_MTD_BOSPORUS is not set
  5834. # CONFIG_MTD_XXS1500 is not set
  5835. # CONFIG_MTD_MTX1 is not set
  5836. -# CONFIG_MTD_DB1X00 is not set
  5837. # CONFIG_MTD_PB1550 is not set
  5838. -# CONFIG_MTD_HYDROGEN3 is not set
  5839. # CONFIG_MTD_MIRAGE is not set
  5840. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  5841. # CONFIG_MTD_OCELOT is not set
  5842. @@ -238,7 +236,6 @@ CONFIG_MTD_PHYSMAP_BUSWIDTH=4
  5843. #
  5844. # Disk-On-Chip Device Drivers
  5845. #
  5846. -# CONFIG_MTD_DOC1000 is not set
  5847. # CONFIG_MTD_DOC2000 is not set
  5848. # CONFIG_MTD_DOC2001 is not set
  5849. # CONFIG_MTD_DOCPROBE is not set
  5850. @@ -327,11 +324,6 @@ CONFIG_IP_PNP_BOOTP=y
  5851. #
  5852. # CONFIG_IPX is not set
  5853. # CONFIG_ATALK is not set
  5854. -
  5855. -#
  5856. -# Appletalk devices
  5857. -#
  5858. -# CONFIG_DEV_APPLETALK is not set
  5859. # CONFIG_DECNET is not set
  5860. # CONFIG_BRIDGE is not set
  5861. # CONFIG_X25 is not set
  5862. @@ -587,7 +579,6 @@ CONFIG_SERIAL=y
  5863. CONFIG_SERIAL_CONSOLE=y
  5864. # CONFIG_SERIAL_EXTENDED is not set
  5865. # CONFIG_SERIAL_NONSTANDARD is not set
  5866. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  5867. # CONFIG_VR41XX_KIU is not set
  5868. CONFIG_UNIX98_PTYS=y
  5869. CONFIG_UNIX98_PTY_COUNT=256
  5870. --- a/arch/mips/defconfig-ev64120
  5871. +++ b/arch/mips/defconfig-ev64120
  5872. @@ -30,8 +30,8 @@ CONFIG_MODULES=y
  5873. # CONFIG_MIPS_PB1000 is not set
  5874. # CONFIG_MIPS_PB1100 is not set
  5875. # CONFIG_MIPS_PB1500 is not set
  5876. -# CONFIG_MIPS_HYDROGEN3 is not set
  5877. # CONFIG_MIPS_PB1550 is not set
  5878. +# CONFIG_MIPS_HYDROGEN3 is not set
  5879. # CONFIG_MIPS_XXS1500 is not set
  5880. # CONFIG_MIPS_MTX1 is not set
  5881. # CONFIG_COGENT_CSB250 is not set
  5882. @@ -230,11 +230,6 @@ CONFIG_IP_PNP=y
  5883. #
  5884. # CONFIG_IPX is not set
  5885. # CONFIG_ATALK is not set
  5886. -
  5887. -#
  5888. -# Appletalk devices
  5889. -#
  5890. -# CONFIG_DEV_APPLETALK is not set
  5891. # CONFIG_DECNET is not set
  5892. # CONFIG_BRIDGE is not set
  5893. # CONFIG_X25 is not set
  5894. @@ -443,7 +438,6 @@ CONFIG_SERIAL=y
  5895. # CONFIG_SERIAL_CONSOLE is not set
  5896. # CONFIG_SERIAL_EXTENDED is not set
  5897. # CONFIG_SERIAL_NONSTANDARD is not set
  5898. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  5899. CONFIG_UNIX98_PTYS=y
  5900. CONFIG_UNIX98_PTY_COUNT=256
  5901. --- a/arch/mips/defconfig-ev96100
  5902. +++ b/arch/mips/defconfig-ev96100
  5903. @@ -30,8 +30,8 @@ CONFIG_MODULES=y
  5904. # CONFIG_MIPS_PB1000 is not set
  5905. # CONFIG_MIPS_PB1100 is not set
  5906. # CONFIG_MIPS_PB1500 is not set
  5907. -# CONFIG_MIPS_HYDROGEN3 is not set
  5908. # CONFIG_MIPS_PB1550 is not set
  5909. +# CONFIG_MIPS_HYDROGEN3 is not set
  5910. # CONFIG_MIPS_XXS1500 is not set
  5911. # CONFIG_MIPS_MTX1 is not set
  5912. # CONFIG_COGENT_CSB250 is not set
  5913. @@ -232,11 +232,6 @@ CONFIG_IP_PNP_BOOTP=y
  5914. #
  5915. # CONFIG_IPX is not set
  5916. # CONFIG_ATALK is not set
  5917. -
  5918. -#
  5919. -# Appletalk devices
  5920. -#
  5921. -# CONFIG_DEV_APPLETALK is not set
  5922. # CONFIG_DECNET is not set
  5923. # CONFIG_BRIDGE is not set
  5924. # CONFIG_X25 is not set
  5925. @@ -441,7 +436,6 @@ CONFIG_SERIAL=y
  5926. CONFIG_SERIAL_CONSOLE=y
  5927. # CONFIG_SERIAL_EXTENDED is not set
  5928. # CONFIG_SERIAL_NONSTANDARD is not set
  5929. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  5930. CONFIG_UNIX98_PTYS=y
  5931. CONFIG_UNIX98_PTY_COUNT=256
  5932. --- /dev/null
  5933. +++ b/arch/mips/defconfig-ficmmp
  5934. @@ -0,0 +1,862 @@
  5935. +#
  5936. +# Automatically generated make config: don't edit
  5937. +#
  5938. +CONFIG_MIPS=y
  5939. +CONFIG_MIPS32=y
  5940. +# CONFIG_MIPS64 is not set
  5941. +
  5942. +#
  5943. +# Code maturity level options
  5944. +#
  5945. +CONFIG_EXPERIMENTAL=y
  5946. +
  5947. +#
  5948. +# Loadable module support
  5949. +#
  5950. +CONFIG_MODULES=y
  5951. +# CONFIG_MODVERSIONS is not set
  5952. +CONFIG_KMOD=y
  5953. +
  5954. +#
  5955. +# Machine selection
  5956. +#
  5957. +# CONFIG_ACER_PICA_61 is not set
  5958. +# CONFIG_MIPS_BOSPORUS is not set
  5959. +# CONFIG_MIPS_MIRAGE is not set
  5960. +# CONFIG_MIPS_DB1000 is not set
  5961. +# CONFIG_MIPS_DB1100 is not set
  5962. +# CONFIG_MIPS_DB1500 is not set
  5963. +# CONFIG_MIPS_DB1550 is not set
  5964. +# CONFIG_MIPS_PB1000 is not set
  5965. +# CONFIG_MIPS_PB1100 is not set
  5966. +# CONFIG_MIPS_PB1500 is not set
  5967. +# CONFIG_MIPS_PB1550 is not set
  5968. +# CONFIG_MIPS_HYDROGEN3 is not set
  5969. +# CONFIG_MIPS_XXS1500 is not set
  5970. +# CONFIG_MIPS_MTX1 is not set
  5971. +# CONFIG_COGENT_CSB250 is not set
  5972. +# CONFIG_BAGET_MIPS is not set
  5973. +# CONFIG_CASIO_E55 is not set
  5974. +# CONFIG_MIPS_COBALT is not set
  5975. +# CONFIG_DECSTATION is not set
  5976. +# CONFIG_MIPS_EV64120 is not set
  5977. +# CONFIG_MIPS_EV96100 is not set
  5978. +# CONFIG_MIPS_IVR is not set
  5979. +# CONFIG_HP_LASERJET is not set
  5980. +# CONFIG_IBM_WORKPAD is not set
  5981. +# CONFIG_LASAT is not set
  5982. +# CONFIG_MIPS_ITE8172 is not set
  5983. +# CONFIG_MIPS_ATLAS is not set
  5984. +# CONFIG_MIPS_MAGNUM_4000 is not set
  5985. +# CONFIG_MIPS_MALTA is not set
  5986. +# CONFIG_MIPS_SEAD is not set
  5987. +# CONFIG_MOMENCO_OCELOT is not set
  5988. +# CONFIG_MOMENCO_OCELOT_G is not set
  5989. +# CONFIG_MOMENCO_OCELOT_C is not set
  5990. +# CONFIG_MOMENCO_JAGUAR_ATX is not set
  5991. +# CONFIG_PMC_BIG_SUR is not set
  5992. +# CONFIG_PMC_STRETCH is not set
  5993. +# CONFIG_PMC_YOSEMITE is not set
  5994. +# CONFIG_DDB5074 is not set
  5995. +# CONFIG_DDB5476 is not set
  5996. +# CONFIG_DDB5477 is not set
  5997. +# CONFIG_NEC_OSPREY is not set
  5998. +# CONFIG_NEC_EAGLE is not set
  5999. +# CONFIG_OLIVETTI_M700 is not set
  6000. +# CONFIG_NINO is not set
  6001. +# CONFIG_SGI_IP22 is not set
  6002. +# CONFIG_SGI_IP27 is not set
  6003. +# CONFIG_SIBYTE_SB1xxx_SOC is not set
  6004. +# CONFIG_SNI_RM200_PCI is not set
  6005. +# CONFIG_TANBAC_TB0226 is not set
  6006. +# CONFIG_TANBAC_TB0229 is not set
  6007. +# CONFIG_TOSHIBA_JMR3927 is not set
  6008. +# CONFIG_TOSHIBA_RBTX4927 is not set
  6009. +# CONFIG_VICTOR_MPC30X is not set
  6010. +# CONFIG_ZAO_CAPCELLA is not set
  6011. +# CONFIG_HIGHMEM is not set
  6012. +CONFIG_RWSEM_GENERIC_SPINLOCK=y
  6013. +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
  6014. +# CONFIG_MIPS_AU1000 is not set
  6015. +
  6016. +#
  6017. +# CPU selection
  6018. +#
  6019. +CONFIG_CPU_MIPS32=y
  6020. +# CONFIG_CPU_MIPS64 is not set
  6021. +# CONFIG_CPU_R3000 is not set
  6022. +# CONFIG_CPU_TX39XX is not set
  6023. +# CONFIG_CPU_VR41XX is not set
  6024. +# CONFIG_CPU_R4300 is not set
  6025. +# CONFIG_CPU_R4X00 is not set
  6026. +# CONFIG_CPU_TX49XX is not set
  6027. +# CONFIG_CPU_R5000 is not set
  6028. +# CONFIG_CPU_R5432 is not set
  6029. +# CONFIG_CPU_R6000 is not set
  6030. +# CONFIG_CPU_NEVADA is not set
  6031. +# CONFIG_CPU_R8000 is not set
  6032. +# CONFIG_CPU_R10000 is not set
  6033. +# CONFIG_CPU_RM7000 is not set
  6034. +# CONFIG_CPU_RM9000 is not set
  6035. +# CONFIG_CPU_SB1 is not set
  6036. +CONFIG_PAGE_SIZE_4KB=y
  6037. +# CONFIG_PAGE_SIZE_16KB is not set
  6038. +# CONFIG_PAGE_SIZE_64KB is not set
  6039. +CONFIG_CPU_HAS_PREFETCH=y
  6040. +# CONFIG_VTAG_ICACHE is not set
  6041. +CONFIG_64BIT_PHYS_ADDR=y
  6042. +# CONFIG_CPU_ADVANCED is not set
  6043. +CONFIG_CPU_HAS_LLSC=y
  6044. +# CONFIG_CPU_HAS_LLDSCD is not set
  6045. +# CONFIG_CPU_HAS_WB is not set
  6046. +CONFIG_CPU_HAS_SYNC=y
  6047. +
  6048. +#
  6049. +# General setup
  6050. +#
  6051. +CONFIG_CPU_LITTLE_ENDIAN=y
  6052. +# CONFIG_BUILD_ELF64 is not set
  6053. +CONFIG_NET=y
  6054. +# CONFIG_PCI is not set
  6055. +# CONFIG_PCI_NEW is not set
  6056. +CONFIG_PCI_AUTO=y
  6057. +# CONFIG_ISA is not set
  6058. +# CONFIG_TC is not set
  6059. +# CONFIG_MCA is not set
  6060. +# CONFIG_SBUS is not set
  6061. +# CONFIG_HOTPLUG is not set
  6062. +# CONFIG_PCMCIA is not set
  6063. +# CONFIG_HOTPLUG_PCI is not set
  6064. +CONFIG_SYSVIPC=y
  6065. +# CONFIG_BSD_PROCESS_ACCT is not set
  6066. +CONFIG_SYSCTL=y
  6067. +CONFIG_KCORE_ELF=y
  6068. +# CONFIG_KCORE_AOUT is not set
  6069. +# CONFIG_BINFMT_AOUT is not set
  6070. +CONFIG_BINFMT_ELF=y
  6071. +# CONFIG_MIPS32_COMPAT is not set
  6072. +# CONFIG_MIPS32_O32 is not set
  6073. +# CONFIG_MIPS32_N32 is not set
  6074. +# CONFIG_BINFMT_ELF32 is not set
  6075. +# CONFIG_BINFMT_MISC is not set
  6076. +# CONFIG_OOM_KILLER is not set
  6077. +CONFIG_CMDLINE_BOOL=y
  6078. +CONFIG_CMDLINE="ide3=dma mem=96M root=/dev/hda2 rootflags=data=journal"
  6079. +
  6080. +#
  6081. +# Memory Technology Devices (MTD)
  6082. +#
  6083. +# CONFIG_MTD is not set
  6084. +
  6085. +#
  6086. +# Parallel port support
  6087. +#
  6088. +# CONFIG_PARPORT is not set
  6089. +
  6090. +#
  6091. +# Plug and Play configuration
  6092. +#
  6093. +# CONFIG_PNP is not set
  6094. +# CONFIG_ISAPNP is not set
  6095. +
  6096. +#
  6097. +# Block devices
  6098. +#
  6099. +# CONFIG_BLK_DEV_FD is not set
  6100. +# CONFIG_BLK_DEV_XD is not set
  6101. +# CONFIG_PARIDE is not set
  6102. +# CONFIG_BLK_CPQ_DA is not set
  6103. +# CONFIG_BLK_CPQ_CISS_DA is not set
  6104. +# CONFIG_CISS_SCSI_TAPE is not set
  6105. +# CONFIG_CISS_MONITOR_THREAD is not set
  6106. +# CONFIG_BLK_DEV_DAC960 is not set
  6107. +# CONFIG_BLK_DEV_UMEM is not set
  6108. +# CONFIG_BLK_DEV_SX8 is not set
  6109. +CONFIG_BLK_DEV_LOOP=y
  6110. +# CONFIG_BLK_DEV_NBD is not set
  6111. +# CONFIG_BLK_DEV_RAM is not set
  6112. +# CONFIG_BLK_DEV_INITRD is not set
  6113. +# CONFIG_BLK_STATS is not set
  6114. +
  6115. +#
  6116. +# Multi-device support (RAID and LVM)
  6117. +#
  6118. +# CONFIG_MD is not set
  6119. +# CONFIG_BLK_DEV_MD is not set
  6120. +# CONFIG_MD_LINEAR is not set
  6121. +# CONFIG_MD_RAID0 is not set
  6122. +# CONFIG_MD_RAID1 is not set
  6123. +# CONFIG_MD_RAID5 is not set
  6124. +# CONFIG_MD_MULTIPATH is not set
  6125. +# CONFIG_BLK_DEV_LVM is not set
  6126. +
  6127. +#
  6128. +# Networking options
  6129. +#
  6130. +CONFIG_PACKET=y
  6131. +# CONFIG_PACKET_MMAP is not set
  6132. +# CONFIG_NETLINK_DEV is not set
  6133. +CONFIG_NETFILTER=y
  6134. +# CONFIG_NETFILTER_DEBUG is not set
  6135. +CONFIG_FILTER=y
  6136. +CONFIG_UNIX=y
  6137. +CONFIG_INET=y
  6138. +CONFIG_IP_MULTICAST=y
  6139. +# CONFIG_IP_ADVANCED_ROUTER is not set
  6140. +# CONFIG_IP_PNP is not set
  6141. +# CONFIG_NET_IPIP is not set
  6142. +# CONFIG_NET_IPGRE is not set
  6143. +# CONFIG_IP_MROUTE is not set
  6144. +# CONFIG_ARPD is not set
  6145. +# CONFIG_INET_ECN is not set
  6146. +# CONFIG_SYN_COOKIES is not set
  6147. +
  6148. +#
  6149. +# IP: Netfilter Configuration
  6150. +#
  6151. +# CONFIG_IP_NF_CONNTRACK is not set
  6152. +# CONFIG_IP_NF_QUEUE is not set
  6153. +# CONFIG_IP_NF_IPTABLES is not set
  6154. +# CONFIG_IP_NF_ARPTABLES is not set
  6155. +# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
  6156. +# CONFIG_IP_NF_COMPAT_IPFWADM is not set
  6157. +
  6158. +#
  6159. +# IP: Virtual Server Configuration
  6160. +#
  6161. +# CONFIG_IP_VS is not set
  6162. +# CONFIG_IPV6 is not set
  6163. +# CONFIG_KHTTPD is not set
  6164. +
  6165. +#
  6166. +# SCTP Configuration (EXPERIMENTAL)
  6167. +#
  6168. +# CONFIG_IP_SCTP is not set
  6169. +# CONFIG_ATM is not set
  6170. +# CONFIG_VLAN_8021Q is not set
  6171. +
  6172. +#
  6173. +#
  6174. +#
  6175. +# CONFIG_IPX is not set
  6176. +# CONFIG_ATALK is not set
  6177. +# CONFIG_DECNET is not set
  6178. +# CONFIG_BRIDGE is not set
  6179. +# CONFIG_X25 is not set
  6180. +# CONFIG_LAPB is not set
  6181. +# CONFIG_LLC is not set
  6182. +# CONFIG_NET_DIVERT is not set
  6183. +# CONFIG_ECONET is not set
  6184. +# CONFIG_WAN_ROUTER is not set
  6185. +# CONFIG_NET_FASTROUTE is not set
  6186. +# CONFIG_NET_HW_FLOWCONTROL is not set
  6187. +
  6188. +#
  6189. +# QoS and/or fair queueing
  6190. +#
  6191. +# CONFIG_NET_SCHED is not set
  6192. +
  6193. +#
  6194. +# Network testing
  6195. +#
  6196. +# CONFIG_NET_PKTGEN is not set
  6197. +
  6198. +#
  6199. +# Telephony Support
  6200. +#
  6201. +# CONFIG_PHONE is not set
  6202. +# CONFIG_PHONE_IXJ is not set
  6203. +# CONFIG_PHONE_IXJ_PCMCIA is not set
  6204. +
  6205. +#
  6206. +# ATA/IDE/MFM/RLL support
  6207. +#
  6208. +CONFIG_IDE=y
  6209. +
  6210. +#
  6211. +# IDE, ATA and ATAPI Block devices
  6212. +#
  6213. +CONFIG_BLK_DEV_IDE=y
  6214. +
  6215. +#
  6216. +# Please see Documentation/ide.txt for help/info on IDE drives
  6217. +#
  6218. +CONFIG_BLK_DEV_HD_IDE=y
  6219. +CONFIG_BLK_DEV_HD=y
  6220. +# CONFIG_BLK_DEV_IDE_SATA is not set
  6221. +CONFIG_BLK_DEV_IDEDISK=y
  6222. +CONFIG_IDEDISK_MULTI_MODE=y
  6223. +CONFIG_IDEDISK_STROKE=y
  6224. +# CONFIG_BLK_DEV_IDECS is not set
  6225. +# CONFIG_BLK_DEV_DELKIN is not set
  6226. +# CONFIG_BLK_DEV_IDECD is not set
  6227. +# CONFIG_BLK_DEV_IDETAPE is not set
  6228. +# CONFIG_BLK_DEV_IDEFLOPPY is not set
  6229. +# CONFIG_BLK_DEV_IDESCSI is not set
  6230. +# CONFIG_IDE_TASK_IOCTL is not set
  6231. +
  6232. +#
  6233. +# IDE chipset support/bugfixes
  6234. +#
  6235. +# CONFIG_BLK_DEV_CMD640 is not set
  6236. +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
  6237. +# CONFIG_BLK_DEV_ISAPNP is not set
  6238. +# CONFIG_IDE_CHIPSETS is not set
  6239. +# CONFIG_IDEDMA_AUTO is not set
  6240. +# CONFIG_DMA_NONPCI is not set
  6241. +# CONFIG_BLK_DEV_ATARAID is not set
  6242. +# CONFIG_BLK_DEV_ATARAID_PDC is not set
  6243. +# CONFIG_BLK_DEV_ATARAID_HPT is not set
  6244. +# CONFIG_BLK_DEV_ATARAID_MEDLEY is not set
  6245. +# CONFIG_BLK_DEV_ATARAID_SII is not set
  6246. +
  6247. +#
  6248. +# SCSI support
  6249. +#
  6250. +CONFIG_SCSI=y
  6251. +
  6252. +#
  6253. +# SCSI support type (disk, tape, CD-ROM)
  6254. +#
  6255. +CONFIG_BLK_DEV_SD=y
  6256. +CONFIG_SD_EXTRA_DEVS=40
  6257. +CONFIG_CHR_DEV_ST=y
  6258. +# CONFIG_CHR_DEV_OSST is not set
  6259. +CONFIG_BLK_DEV_SR=y
  6260. +# CONFIG_BLK_DEV_SR_VENDOR is not set
  6261. +CONFIG_SR_EXTRA_DEVS=2
  6262. +# CONFIG_CHR_DEV_SG is not set
  6263. +
  6264. +#
  6265. +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
  6266. +#
  6267. +# CONFIG_SCSI_DEBUG_QUEUES is not set
  6268. +# CONFIG_SCSI_MULTI_LUN is not set
  6269. +CONFIG_SCSI_CONSTANTS=y
  6270. +# CONFIG_SCSI_LOGGING is not set
  6271. +
  6272. +#
  6273. +# SCSI low-level drivers
  6274. +#
  6275. +# CONFIG_SCSI_7000FASST is not set
  6276. +# CONFIG_SCSI_ACARD is not set
  6277. +# CONFIG_SCSI_AHA152X is not set
  6278. +# CONFIG_SCSI_AHA1542 is not set
  6279. +# CONFIG_SCSI_AHA1740 is not set
  6280. +# CONFIG_SCSI_AACRAID is not set
  6281. +# CONFIG_SCSI_AIC7XXX is not set
  6282. +# CONFIG_SCSI_AIC79XX is not set
  6283. +# CONFIG_SCSI_AIC7XXX_OLD is not set
  6284. +# CONFIG_SCSI_DPT_I2O is not set
  6285. +# CONFIG_SCSI_ADVANSYS is not set
  6286. +# CONFIG_SCSI_IN2000 is not set
  6287. +# CONFIG_SCSI_AM53C974 is not set
  6288. +# CONFIG_SCSI_MEGARAID is not set
  6289. +# CONFIG_SCSI_MEGARAID2 is not set
  6290. +# CONFIG_SCSI_SATA is not set
  6291. +# CONFIG_SCSI_SATA_AHCI is not set
  6292. +# CONFIG_SCSI_SATA_SVW is not set
  6293. +# CONFIG_SCSI_ATA_PIIX is not set
  6294. +# CONFIG_SCSI_SATA_NV is not set
  6295. +# CONFIG_SCSI_SATA_QSTOR is not set
  6296. +# CONFIG_SCSI_SATA_PROMISE is not set
  6297. +# CONFIG_SCSI_SATA_SX4 is not set
  6298. +# CONFIG_SCSI_SATA_SIL is not set
  6299. +# CONFIG_SCSI_SATA_SIS is not set
  6300. +# CONFIG_SCSI_SATA_ULI is not set
  6301. +# CONFIG_SCSI_SATA_VIA is not set
  6302. +# CONFIG_SCSI_SATA_VITESSE is not set
  6303. +# CONFIG_SCSI_BUSLOGIC is not set
  6304. +# CONFIG_SCSI_DMX3191D is not set
  6305. +# CONFIG_SCSI_DTC3280 is not set
  6306. +# CONFIG_SCSI_EATA is not set
  6307. +# CONFIG_SCSI_EATA_DMA is not set
  6308. +# CONFIG_SCSI_EATA_PIO is not set
  6309. +# CONFIG_SCSI_FUTURE_DOMAIN is not set
  6310. +# CONFIG_SCSI_GDTH is not set
  6311. +# CONFIG_SCSI_GENERIC_NCR5380 is not set
  6312. +# CONFIG_SCSI_INITIO is not set
  6313. +# CONFIG_SCSI_INIA100 is not set
  6314. +# CONFIG_SCSI_NCR53C406A is not set
  6315. +# CONFIG_SCSI_NCR53C7xx is not set
  6316. +# CONFIG_SCSI_PAS16 is not set
  6317. +# CONFIG_SCSI_PCI2000 is not set
  6318. +# CONFIG_SCSI_PCI2220I is not set
  6319. +# CONFIG_SCSI_PSI240I is not set
  6320. +# CONFIG_SCSI_QLOGIC_FAS is not set
  6321. +# CONFIG_SCSI_SIM710 is not set
  6322. +# CONFIG_SCSI_SYM53C416 is not set
  6323. +# CONFIG_SCSI_T128 is not set
  6324. +# CONFIG_SCSI_U14_34F is not set
  6325. +# CONFIG_SCSI_NSP32 is not set
  6326. +# CONFIG_SCSI_DEBUG is not set
  6327. +
  6328. +#
  6329. +# Fusion MPT device support
  6330. +#
  6331. +# CONFIG_FUSION is not set
  6332. +# CONFIG_FUSION_BOOT is not set
  6333. +# CONFIG_FUSION_ISENSE is not set
  6334. +# CONFIG_FUSION_CTL is not set
  6335. +# CONFIG_FUSION_LAN is not set
  6336. +
  6337. +#
  6338. +# Network device support
  6339. +#
  6340. +CONFIG_NETDEVICES=y
  6341. +
  6342. +#
  6343. +# ARCnet devices
  6344. +#
  6345. +# CONFIG_ARCNET is not set
  6346. +# CONFIG_DUMMY is not set
  6347. +# CONFIG_BONDING is not set
  6348. +# CONFIG_EQUALIZER is not set
  6349. +# CONFIG_TUN is not set
  6350. +# CONFIG_ETHERTAP is not set
  6351. +
  6352. +#
  6353. +# Ethernet (10 or 100Mbit)
  6354. +#
  6355. +CONFIG_NET_ETHERNET=y
  6356. +# CONFIG_SUNLANCE is not set
  6357. +# CONFIG_SUNBMAC is not set
  6358. +# CONFIG_SUNQE is not set
  6359. +# CONFIG_SUNGEM is not set
  6360. +# CONFIG_NET_VENDOR_3COM is not set
  6361. +# CONFIG_LANCE is not set
  6362. +# CONFIG_NET_VENDOR_SMC is not set
  6363. +# CONFIG_NET_VENDOR_RACAL is not set
  6364. +# CONFIG_NET_ISA is not set
  6365. +# CONFIG_NET_PCI is not set
  6366. +# CONFIG_NET_POCKET is not set
  6367. +
  6368. +#
  6369. +# Ethernet (1000 Mbit)
  6370. +#
  6371. +# CONFIG_ACENIC is not set
  6372. +# CONFIG_DL2K is not set
  6373. +# CONFIG_E1000 is not set
  6374. +# CONFIG_MYRI_SBUS is not set
  6375. +# CONFIG_NS83820 is not set
  6376. +# CONFIG_HAMACHI is not set
  6377. +# CONFIG_YELLOWFIN is not set
  6378. +# CONFIG_R8169 is not set
  6379. +# CONFIG_SK98LIN is not set
  6380. +# CONFIG_TIGON3 is not set
  6381. +# CONFIG_FDDI is not set
  6382. +# CONFIG_HIPPI is not set
  6383. +# CONFIG_PLIP is not set
  6384. +# CONFIG_PPP is not set
  6385. +# CONFIG_SLIP is not set
  6386. +
  6387. +#
  6388. +# Wireless LAN (non-hamradio)
  6389. +#
  6390. +# CONFIG_NET_RADIO is not set
  6391. +
  6392. +#
  6393. +# Token Ring devices
  6394. +#
  6395. +# CONFIG_TR is not set
  6396. +# CONFIG_NET_FC is not set
  6397. +# CONFIG_RCPCI is not set
  6398. +# CONFIG_SHAPER is not set
  6399. +
  6400. +#
  6401. +# Wan interfaces
  6402. +#
  6403. +# CONFIG_WAN is not set
  6404. +
  6405. +#
  6406. +# Amateur Radio support
  6407. +#
  6408. +# CONFIG_HAMRADIO is not set
  6409. +
  6410. +#
  6411. +# IrDA (infrared) support
  6412. +#
  6413. +# CONFIG_IRDA is not set
  6414. +
  6415. +#
  6416. +# ISDN subsystem
  6417. +#
  6418. +# CONFIG_ISDN is not set
  6419. +
  6420. +#
  6421. +# Input core support
  6422. +#
  6423. +CONFIG_INPUT=y
  6424. +CONFIG_INPUT_KEYBDEV=y
  6425. +CONFIG_INPUT_MOUSEDEV=y
  6426. +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
  6427. +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
  6428. +# CONFIG_INPUT_JOYDEV is not set
  6429. +CONFIG_INPUT_EVDEV=y
  6430. +# CONFIG_INPUT_UINPUT is not set
  6431. +
  6432. +#
  6433. +# Character devices
  6434. +#
  6435. +CONFIG_VT=y
  6436. +CONFIG_VT_CONSOLE=y
  6437. +# CONFIG_SERIAL is not set
  6438. +# CONFIG_SERIAL_EXTENDED is not set
  6439. +CONFIG_SERIAL_NONSTANDARD=y
  6440. +# CONFIG_COMPUTONE is not set
  6441. +# CONFIG_ROCKETPORT is not set
  6442. +# CONFIG_CYCLADES is not set
  6443. +# CONFIG_DIGIEPCA is not set
  6444. +# CONFIG_DIGI is not set
  6445. +# CONFIG_ESPSERIAL is not set
  6446. +# CONFIG_MOXA_INTELLIO is not set
  6447. +# CONFIG_MOXA_SMARTIO is not set
  6448. +# CONFIG_ISI is not set
  6449. +# CONFIG_SYNCLINK is not set
  6450. +# CONFIG_SYNCLINKMP is not set
  6451. +# CONFIG_N_HDLC is not set
  6452. +# CONFIG_RISCOM8 is not set
  6453. +# CONFIG_SPECIALIX is not set
  6454. +# CONFIG_SX is not set
  6455. +# CONFIG_RIO is not set
  6456. +# CONFIG_STALDRV is not set
  6457. +# CONFIG_SERIAL_TX3912 is not set
  6458. +# CONFIG_SERIAL_TX3912_CONSOLE is not set
  6459. +# CONFIG_SERIAL_TXX9 is not set
  6460. +# CONFIG_SERIAL_TXX9_CONSOLE is not set
  6461. +# CONFIG_TXX927_SERIAL is not set
  6462. +CONFIG_UNIX98_PTYS=y
  6463. +CONFIG_UNIX98_PTY_COUNT=256
  6464. +
  6465. +#
  6466. +# I2C support
  6467. +#
  6468. +CONFIG_I2C=y
  6469. +# CONFIG_I2C_ALGOBIT is not set
  6470. +# CONFIG_SCx200_ACB is not set
  6471. +# CONFIG_I2C_ALGOPCF is not set
  6472. +# CONFIG_I2C_CHARDEV is not set
  6473. +# CONFIG_I2C_PROC is not set
  6474. +
  6475. +#
  6476. +# Mice
  6477. +#
  6478. +# CONFIG_BUSMOUSE is not set
  6479. +# CONFIG_MOUSE is not set
  6480. +
  6481. +#
  6482. +# Joysticks
  6483. +#
  6484. +# CONFIG_INPUT_GAMEPORT is not set
  6485. +# CONFIG_INPUT_NS558 is not set
  6486. +# CONFIG_INPUT_LIGHTNING is not set
  6487. +# CONFIG_INPUT_PCIGAME is not set
  6488. +# CONFIG_INPUT_CS461X is not set
  6489. +# CONFIG_INPUT_EMU10K1 is not set
  6490. +# CONFIG_INPUT_SERIO is not set
  6491. +# CONFIG_INPUT_SERPORT is not set
  6492. +
  6493. +#
  6494. +# Joysticks
  6495. +#
  6496. +# CONFIG_INPUT_ANALOG is not set
  6497. +# CONFIG_INPUT_A3D is not set
  6498. +# CONFIG_INPUT_ADI is not set
  6499. +# CONFIG_INPUT_COBRA is not set
  6500. +# CONFIG_INPUT_GF2K is not set
  6501. +# CONFIG_INPUT_GRIP is not set
  6502. +# CONFIG_INPUT_INTERACT is not set
  6503. +# CONFIG_INPUT_TMDC is not set
  6504. +# CONFIG_INPUT_SIDEWINDER is not set
  6505. +# CONFIG_INPUT_IFORCE_USB is not set
  6506. +# CONFIG_INPUT_IFORCE_232 is not set
  6507. +# CONFIG_INPUT_WARRIOR is not set
  6508. +# CONFIG_INPUT_MAGELLAN is not set
  6509. +# CONFIG_INPUT_SPACEORB is not set
  6510. +# CONFIG_INPUT_SPACEBALL is not set
  6511. +# CONFIG_INPUT_STINGER is not set
  6512. +# CONFIG_INPUT_DB9 is not set
  6513. +# CONFIG_INPUT_GAMECON is not set
  6514. +# CONFIG_INPUT_TURBOGRAFX is not set
  6515. +# CONFIG_QIC02_TAPE is not set
  6516. +# CONFIG_IPMI_HANDLER is not set
  6517. +# CONFIG_IPMI_PANIC_EVENT is not set
  6518. +# CONFIG_IPMI_DEVICE_INTERFACE is not set
  6519. +# CONFIG_IPMI_KCS is not set
  6520. +# CONFIG_IPMI_WATCHDOG is not set
  6521. +
  6522. +#
  6523. +# Watchdog Cards
  6524. +#
  6525. +# CONFIG_WATCHDOG is not set
  6526. +# CONFIG_SCx200 is not set
  6527. +# CONFIG_SCx200_GPIO is not set
  6528. +# CONFIG_AMD_PM768 is not set
  6529. +# CONFIG_NVRAM is not set
  6530. +# CONFIG_RTC is not set
  6531. +# CONFIG_DTLK is not set
  6532. +# CONFIG_R3964 is not set
  6533. +# CONFIG_APPLICOM is not set
  6534. +
  6535. +#
  6536. +# Ftape, the floppy tape device driver
  6537. +#
  6538. +# CONFIG_FTAPE is not set
  6539. +# CONFIG_AGP is not set
  6540. +
  6541. +#
  6542. +# Direct Rendering Manager (XFree86 DRI support)
  6543. +#
  6544. +# CONFIG_DRM is not set
  6545. +
  6546. +#
  6547. +# File systems
  6548. +#
  6549. +# CONFIG_QUOTA is not set
  6550. +# CONFIG_QFMT_V2 is not set
  6551. +CONFIG_AUTOFS_FS=y
  6552. +# CONFIG_AUTOFS4_FS is not set
  6553. +# CONFIG_REISERFS_FS is not set
  6554. +# CONFIG_REISERFS_CHECK is not set
  6555. +# CONFIG_REISERFS_PROC_INFO is not set
  6556. +# CONFIG_ADFS_FS is not set
  6557. +# CONFIG_ADFS_FS_RW is not set
  6558. +# CONFIG_AFFS_FS is not set
  6559. +# CONFIG_HFS_FS is not set
  6560. +# CONFIG_HFSPLUS_FS is not set
  6561. +# CONFIG_BEFS_FS is not set
  6562. +# CONFIG_BEFS_DEBUG is not set
  6563. +# CONFIG_BFS_FS is not set
  6564. +CONFIG_EXT3_FS=y
  6565. +CONFIG_JBD=y
  6566. +# CONFIG_JBD_DEBUG is not set
  6567. +CONFIG_FAT_FS=y
  6568. +CONFIG_MSDOS_FS=y
  6569. +# CONFIG_UMSDOS_FS is not set
  6570. +CONFIG_VFAT_FS=y
  6571. +# CONFIG_EFS_FS is not set
  6572. +# CONFIG_JFFS_FS is not set
  6573. +# CONFIG_JFFS2_FS is not set
  6574. +# CONFIG_CRAMFS is not set
  6575. +# CONFIG_TMPFS is not set
  6576. +CONFIG_RAMFS=y
  6577. +# CONFIG_ISO9660_FS is not set
  6578. +# CONFIG_JOLIET is not set
  6579. +# CONFIG_ZISOFS is not set
  6580. +# CONFIG_JFS_FS is not set
  6581. +# CONFIG_JFS_DEBUG is not set
  6582. +# CONFIG_JFS_STATISTICS is not set
  6583. +# CONFIG_MINIX_FS is not set
  6584. +# CONFIG_VXFS_FS is not set
  6585. +# CONFIG_NTFS_FS is not set
  6586. +# CONFIG_NTFS_RW is not set
  6587. +# CONFIG_HPFS_FS is not set
  6588. +CONFIG_PROC_FS=y
  6589. +# CONFIG_DEVFS_FS is not set
  6590. +# CONFIG_DEVFS_MOUNT is not set
  6591. +# CONFIG_DEVFS_DEBUG is not set
  6592. +CONFIG_DEVPTS_FS=y
  6593. +# CONFIG_QNX4FS_FS is not set
  6594. +# CONFIG_QNX4FS_RW is not set
  6595. +# CONFIG_ROMFS_FS is not set
  6596. +CONFIG_EXT2_FS=y
  6597. +# CONFIG_SYSV_FS is not set
  6598. +# CONFIG_UDF_FS is not set
  6599. +# CONFIG_UDF_RW is not set
  6600. +# CONFIG_UFS_FS is not set
  6601. +# CONFIG_UFS_FS_WRITE is not set
  6602. +# CONFIG_XFS_FS is not set
  6603. +# CONFIG_XFS_QUOTA is not set
  6604. +# CONFIG_XFS_RT is not set
  6605. +# CONFIG_XFS_TRACE is not set
  6606. +# CONFIG_XFS_DEBUG is not set
  6607. +
  6608. +#
  6609. +# Network File Systems
  6610. +#
  6611. +# CONFIG_CODA_FS is not set
  6612. +# CONFIG_INTERMEZZO_FS is not set
  6613. +# CONFIG_NFS_FS is not set
  6614. +# CONFIG_NFS_V3 is not set
  6615. +# CONFIG_NFS_DIRECTIO is not set
  6616. +# CONFIG_ROOT_NFS is not set
  6617. +# CONFIG_NFSD is not set
  6618. +# CONFIG_NFSD_V3 is not set
  6619. +# CONFIG_NFSD_TCP is not set
  6620. +# CONFIG_SUNRPC is not set
  6621. +# CONFIG_LOCKD is not set
  6622. +# CONFIG_SMB_FS is not set
  6623. +# CONFIG_NCP_FS is not set
  6624. +# CONFIG_NCPFS_PACKET_SIGNING is not set
  6625. +# CONFIG_NCPFS_IOCTL_LOCKING is not set
  6626. +# CONFIG_NCPFS_STRONG is not set
  6627. +# CONFIG_NCPFS_NFS_NS is not set
  6628. +# CONFIG_NCPFS_OS2_NS is not set
  6629. +# CONFIG_NCPFS_SMALLDOS is not set
  6630. +# CONFIG_NCPFS_NLS is not set
  6631. +# CONFIG_NCPFS_EXTRAS is not set
  6632. +# CONFIG_ZISOFS_FS is not set
  6633. +
  6634. +#
  6635. +# Partition Types
  6636. +#
  6637. +# CONFIG_PARTITION_ADVANCED is not set
  6638. +CONFIG_MSDOS_PARTITION=y
  6639. +# CONFIG_SMB_NLS is not set
  6640. +CONFIG_NLS=y
  6641. +
  6642. +#
  6643. +# Native Language Support
  6644. +#
  6645. +CONFIG_NLS_DEFAULT="iso8859-1"
  6646. +# CONFIG_NLS_CODEPAGE_437 is not set
  6647. +# CONFIG_NLS_CODEPAGE_737 is not set
  6648. +# CONFIG_NLS_CODEPAGE_775 is not set
  6649. +# CONFIG_NLS_CODEPAGE_850 is not set
  6650. +# CONFIG_NLS_CODEPAGE_852 is not set
  6651. +# CONFIG_NLS_CODEPAGE_855 is not set
  6652. +# CONFIG_NLS_CODEPAGE_857 is not set
  6653. +# CONFIG_NLS_CODEPAGE_860 is not set
  6654. +# CONFIG_NLS_CODEPAGE_861 is not set
  6655. +# CONFIG_NLS_CODEPAGE_862 is not set
  6656. +# CONFIG_NLS_CODEPAGE_863 is not set
  6657. +# CONFIG_NLS_CODEPAGE_864 is not set
  6658. +# CONFIG_NLS_CODEPAGE_865 is not set
  6659. +# CONFIG_NLS_CODEPAGE_866 is not set
  6660. +# CONFIG_NLS_CODEPAGE_869 is not set
  6661. +# CONFIG_NLS_CODEPAGE_936 is not set
  6662. +# CONFIG_NLS_CODEPAGE_950 is not set
  6663. +# CONFIG_NLS_CODEPAGE_932 is not set
  6664. +# CONFIG_NLS_CODEPAGE_949 is not set
  6665. +# CONFIG_NLS_CODEPAGE_874 is not set
  6666. +# CONFIG_NLS_ISO8859_8 is not set
  6667. +# CONFIG_NLS_CODEPAGE_1250 is not set
  6668. +# CONFIG_NLS_CODEPAGE_1251 is not set
  6669. +# CONFIG_NLS_ISO8859_1 is not set
  6670. +# CONFIG_NLS_ISO8859_2 is not set
  6671. +# CONFIG_NLS_ISO8859_3 is not set
  6672. +# CONFIG_NLS_ISO8859_4 is not set
  6673. +# CONFIG_NLS_ISO8859_5 is not set
  6674. +# CONFIG_NLS_ISO8859_6 is not set
  6675. +# CONFIG_NLS_ISO8859_7 is not set
  6676. +# CONFIG_NLS_ISO8859_9 is not set
  6677. +# CONFIG_NLS_ISO8859_13 is not set
  6678. +# CONFIG_NLS_ISO8859_14 is not set
  6679. +# CONFIG_NLS_ISO8859_15 is not set
  6680. +# CONFIG_NLS_KOI8_R is not set
  6681. +# CONFIG_NLS_KOI8_U is not set
  6682. +# CONFIG_NLS_UTF8 is not set
  6683. +
  6684. +#
  6685. +# Multimedia devices
  6686. +#
  6687. +# CONFIG_VIDEO_DEV is not set
  6688. +
  6689. +#
  6690. +# Console drivers
  6691. +#
  6692. +# CONFIG_VGA_CONSOLE is not set
  6693. +# CONFIG_MDA_CONSOLE is not set
  6694. +
  6695. +#
  6696. +# Frame-buffer support
  6697. +#
  6698. +CONFIG_FB=y
  6699. +CONFIG_DUMMY_CONSOLE=y
  6700. +# CONFIG_FB_CYBER2000 is not set
  6701. +# CONFIG_FB_VIRTUAL is not set
  6702. +CONFIG_FBCON_ADVANCED=y
  6703. +# CONFIG_FBCON_MFB is not set
  6704. +# CONFIG_FBCON_CFB2 is not set
  6705. +# CONFIG_FBCON_CFB4 is not set
  6706. +# CONFIG_FBCON_CFB8 is not set
  6707. +CONFIG_FBCON_CFB16=y
  6708. +# CONFIG_FBCON_CFB24 is not set
  6709. +# CONFIG_FBCON_CFB32 is not set
  6710. +# CONFIG_FBCON_AFB is not set
  6711. +# CONFIG_FBCON_ILBM is not set
  6712. +# CONFIG_FBCON_IPLAN2P2 is not set
  6713. +# CONFIG_FBCON_IPLAN2P4 is not set
  6714. +# CONFIG_FBCON_IPLAN2P8 is not set
  6715. +# CONFIG_FBCON_MAC is not set
  6716. +# CONFIG_FBCON_VGA_PLANES is not set
  6717. +# CONFIG_FBCON_VGA is not set
  6718. +# CONFIG_FBCON_HGA is not set
  6719. +# CONFIG_FBCON_FONTWIDTH8_ONLY is not set
  6720. +CONFIG_FBCON_FONTS=y
  6721. +CONFIG_FONT_8x8=y
  6722. +CONFIG_FONT_8x16=y
  6723. +# CONFIG_FONT_SUN8x16 is not set
  6724. +# CONFIG_FONT_SUN12x22 is not set
  6725. +# CONFIG_FONT_6x11 is not set
  6726. +# CONFIG_FONT_PEARL_8x8 is not set
  6727. +# CONFIG_FONT_ACORN_8x8 is not set
  6728. +
  6729. +#
  6730. +# Sound
  6731. +#
  6732. +CONFIG_SOUND=y
  6733. +# CONFIG_SOUND_ALI5455 is not set
  6734. +# CONFIG_SOUND_BT878 is not set
  6735. +# CONFIG_SOUND_CMPCI is not set
  6736. +# CONFIG_SOUND_EMU10K1 is not set
  6737. +# CONFIG_MIDI_EMU10K1 is not set
  6738. +# CONFIG_SOUND_FUSION is not set
  6739. +# CONFIG_SOUND_CS4281 is not set
  6740. +# CONFIG_SOUND_ES1370 is not set
  6741. +# CONFIG_SOUND_ES1371 is not set
  6742. +# CONFIG_SOUND_ESSSOLO1 is not set
  6743. +# CONFIG_SOUND_MAESTRO is not set
  6744. +# CONFIG_SOUND_MAESTRO3 is not set
  6745. +# CONFIG_SOUND_FORTE is not set
  6746. +# CONFIG_SOUND_ICH is not set
  6747. +# CONFIG_SOUND_RME96XX is not set
  6748. +# CONFIG_SOUND_SONICVIBES is not set
  6749. +# CONFIG_SOUND_TRIDENT is not set
  6750. +# CONFIG_SOUND_MSNDCLAS is not set
  6751. +# CONFIG_SOUND_MSNDPIN is not set
  6752. +# CONFIG_SOUND_VIA82CXXX is not set
  6753. +# CONFIG_MIDI_VIA82CXXX is not set
  6754. +# CONFIG_SOUND_OSS is not set
  6755. +# CONFIG_SOUND_TVMIXER is not set
  6756. +# CONFIG_SOUND_AD1980 is not set
  6757. +# CONFIG_SOUND_WM97XX is not set
  6758. +
  6759. +#
  6760. +# USB support
  6761. +#
  6762. +# CONFIG_USB is not set
  6763. +
  6764. +#
  6765. +# Support for USB gadgets
  6766. +#
  6767. +# CONFIG_USB_GADGET is not set
  6768. +
  6769. +#
  6770. +# Bluetooth support
  6771. +#
  6772. +# CONFIG_BLUEZ is not set
  6773. +
  6774. +#
  6775. +# Kernel hacking
  6776. +#
  6777. +CONFIG_CROSSCOMPILE=y
  6778. +# CONFIG_RUNTIME_DEBUG is not set
  6779. +# CONFIG_KGDB is not set
  6780. +# CONFIG_GDB_CONSOLE is not set
  6781. +# CONFIG_DEBUG_INFO is not set
  6782. +# CONFIG_MAGIC_SYSRQ is not set
  6783. +# CONFIG_MIPS_UNCACHED is not set
  6784. +CONFIG_LOG_BUF_SHIFT=0
  6785. +
  6786. +#
  6787. +# Cryptographic options
  6788. +#
  6789. +# CONFIG_CRYPTO is not set
  6790. +
  6791. +#
  6792. +# Library routines
  6793. +#
  6794. +# CONFIG_CRC32 is not set
  6795. +CONFIG_ZLIB_INFLATE=m
  6796. +CONFIG_ZLIB_DEFLATE=m
  6797. --- a/arch/mips/defconfig-hp-lj
  6798. +++ b/arch/mips/defconfig-hp-lj
  6799. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  6800. # CONFIG_MIPS_PB1000 is not set
  6801. # CONFIG_MIPS_PB1100 is not set
  6802. # CONFIG_MIPS_PB1500 is not set
  6803. -# CONFIG_MIPS_HYDROGEN3 is not set
  6804. # CONFIG_MIPS_PB1550 is not set
  6805. +# CONFIG_MIPS_HYDROGEN3 is not set
  6806. # CONFIG_MIPS_XXS1500 is not set
  6807. # CONFIG_MIPS_MTX1 is not set
  6808. # CONFIG_COGENT_CSB250 is not set
  6809. @@ -184,8 +184,8 @@ CONFIG_MTD_CFI_AMDSTD=y
  6810. # Mapping drivers for chip access
  6811. #
  6812. CONFIG_MTD_PHYSMAP=y
  6813. -CONFIG_MTD_PHYSMAP_START=10040000
  6814. -CONFIG_MTD_PHYSMAP_LEN=00fc0000
  6815. +CONFIG_MTD_PHYSMAP_START=0x10040000
  6816. +CONFIG_MTD_PHYSMAP_LEN=0x00fc0000
  6817. CONFIG_MTD_PHYSMAP_BUSWIDTH=4
  6818. # CONFIG_MTD_PB1000 is not set
  6819. # CONFIG_MTD_PB1500 is not set
  6820. @@ -193,9 +193,7 @@ CONFIG_MTD_PHYSMAP_BUSWIDTH=4
  6821. # CONFIG_MTD_BOSPORUS is not set
  6822. # CONFIG_MTD_XXS1500 is not set
  6823. # CONFIG_MTD_MTX1 is not set
  6824. -# CONFIG_MTD_DB1X00 is not set
  6825. # CONFIG_MTD_PB1550 is not set
  6826. -# CONFIG_MTD_HYDROGEN3 is not set
  6827. # CONFIG_MTD_MIRAGE is not set
  6828. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  6829. # CONFIG_MTD_OCELOT is not set
  6830. @@ -214,7 +212,6 @@ CONFIG_MTD_PHYSMAP_BUSWIDTH=4
  6831. #
  6832. # Disk-On-Chip Device Drivers
  6833. #
  6834. -# CONFIG_MTD_DOC1000 is not set
  6835. # CONFIG_MTD_DOC2000 is not set
  6836. # CONFIG_MTD_DOC2001 is not set
  6837. # CONFIG_MTD_DOCPROBE is not set
  6838. @@ -304,11 +301,6 @@ CONFIG_IP_PNP_DHCP=y
  6839. #
  6840. # CONFIG_IPX is not set
  6841. # CONFIG_ATALK is not set
  6842. -
  6843. -#
  6844. -# Appletalk devices
  6845. -#
  6846. -# CONFIG_DEV_APPLETALK is not set
  6847. # CONFIG_DECNET is not set
  6848. # CONFIG_BRIDGE is not set
  6849. # CONFIG_X25 is not set
  6850. @@ -604,7 +596,6 @@ CONFIG_SERIAL=y
  6851. CONFIG_SERIAL_CONSOLE=y
  6852. # CONFIG_SERIAL_EXTENDED is not set
  6853. # CONFIG_SERIAL_NONSTANDARD is not set
  6854. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  6855. # CONFIG_UNIX98_PTYS is not set
  6856. #
  6857. --- a/arch/mips/defconfig-hydrogen3
  6858. +++ b/arch/mips/defconfig-hydrogen3
  6859. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  6860. # CONFIG_MIPS_PB1000 is not set
  6861. # CONFIG_MIPS_PB1100 is not set
  6862. # CONFIG_MIPS_PB1500 is not set
  6863. -CONFIG_MIPS_HYDROGEN3=y
  6864. # CONFIG_MIPS_PB1550 is not set
  6865. +CONFIG_MIPS_HYDROGEN3=y
  6866. # CONFIG_MIPS_XXS1500 is not set
  6867. # CONFIG_MIPS_MTX1 is not set
  6868. # CONFIG_COGENT_CSB250 is not set
  6869. @@ -214,9 +214,7 @@ CONFIG_MTD_CFI_AMDSTD=y
  6870. # CONFIG_MTD_BOSPORUS is not set
  6871. # CONFIG_MTD_XXS1500 is not set
  6872. # CONFIG_MTD_MTX1 is not set
  6873. -# CONFIG_MTD_DB1X00 is not set
  6874. # CONFIG_MTD_PB1550 is not set
  6875. -CONFIG_MTD_HYDROGEN3=y
  6876. # CONFIG_MTD_MIRAGE is not set
  6877. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  6878. # CONFIG_MTD_OCELOT is not set
  6879. @@ -235,7 +233,6 @@ CONFIG_MTD_HYDROGEN3=y
  6880. #
  6881. # Disk-On-Chip Device Drivers
  6882. #
  6883. -# CONFIG_MTD_DOC1000 is not set
  6884. # CONFIG_MTD_DOC2000 is not set
  6885. # CONFIG_MTD_DOC2001 is not set
  6886. # CONFIG_MTD_DOCPROBE is not set
  6887. @@ -340,11 +337,6 @@ CONFIG_IP_PNP_BOOTP=y
  6888. #
  6889. # CONFIG_IPX is not set
  6890. # CONFIG_ATALK is not set
  6891. -
  6892. -#
  6893. -# Appletalk devices
  6894. -#
  6895. -# CONFIG_DEV_APPLETALK is not set
  6896. # CONFIG_DECNET is not set
  6897. # CONFIG_BRIDGE is not set
  6898. # CONFIG_X25 is not set
  6899. @@ -590,7 +582,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  6900. # CONFIG_AU1X00_USB_TTY is not set
  6901. # CONFIG_AU1X00_USB_RAW is not set
  6902. # CONFIG_TXX927_SERIAL is not set
  6903. -CONFIG_MIPS_HYDROGEN3_BUTTONS=y
  6904. CONFIG_UNIX98_PTYS=y
  6905. CONFIG_UNIX98_PTY_COUNT=256
  6906. @@ -838,6 +829,7 @@ CONFIG_DUMMY_CONSOLE=y
  6907. # CONFIG_FB_PM2 is not set
  6908. # CONFIG_FB_PM3 is not set
  6909. # CONFIG_FB_CYBER2000 is not set
  6910. +CONFIG_FB_AU1100=y
  6911. # CONFIG_FB_MATROX is not set
  6912. # CONFIG_FB_ATY is not set
  6913. # CONFIG_FB_RADEON is not set
  6914. @@ -849,7 +841,6 @@ CONFIG_DUMMY_CONSOLE=y
  6915. # CONFIG_FB_VOODOO1 is not set
  6916. # CONFIG_FB_TRIDENT is not set
  6917. # CONFIG_FB_E1356 is not set
  6918. -CONFIG_FB_AU1100=y
  6919. # CONFIG_FB_IT8181 is not set
  6920. # CONFIG_FB_VIRTUAL is not set
  6921. CONFIG_FBCON_ADVANCED=y
  6922. --- a/arch/mips/defconfig-ip22
  6923. +++ b/arch/mips/defconfig-ip22
  6924. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  6925. # CONFIG_MIPS_PB1000 is not set
  6926. # CONFIG_MIPS_PB1100 is not set
  6927. # CONFIG_MIPS_PB1500 is not set
  6928. -# CONFIG_MIPS_HYDROGEN3 is not set
  6929. # CONFIG_MIPS_PB1550 is not set
  6930. +# CONFIG_MIPS_HYDROGEN3 is not set
  6931. # CONFIG_MIPS_XXS1500 is not set
  6932. # CONFIG_MIPS_MTX1 is not set
  6933. # CONFIG_COGENT_CSB250 is not set
  6934. @@ -235,11 +235,6 @@ CONFIG_IP_PNP_BOOTP=y
  6935. #
  6936. # CONFIG_IPX is not set
  6937. # CONFIG_ATALK is not set
  6938. -
  6939. -#
  6940. -# Appletalk devices
  6941. -#
  6942. -# CONFIG_DEV_APPLETALK is not set
  6943. # CONFIG_DECNET is not set
  6944. # CONFIG_BRIDGE is not set
  6945. # CONFIG_X25 is not set
  6946. @@ -319,9 +314,11 @@ CONFIG_SGIWD93_SCSI=y
  6947. # CONFIG_SCSI_MEGARAID is not set
  6948. # CONFIG_SCSI_MEGARAID2 is not set
  6949. # CONFIG_SCSI_SATA is not set
  6950. +# CONFIG_SCSI_SATA_AHCI is not set
  6951. # CONFIG_SCSI_SATA_SVW is not set
  6952. # CONFIG_SCSI_ATA_PIIX is not set
  6953. # CONFIG_SCSI_SATA_NV is not set
  6954. +# CONFIG_SCSI_SATA_QSTOR is not set
  6955. # CONFIG_SCSI_SATA_PROMISE is not set
  6956. # CONFIG_SCSI_SATA_SX4 is not set
  6957. # CONFIG_SCSI_SATA_SIL is not set
  6958. @@ -465,7 +462,6 @@ CONFIG_VT_CONSOLE=y
  6959. # CONFIG_SERIAL is not set
  6960. # CONFIG_SERIAL_EXTENDED is not set
  6961. # CONFIG_SERIAL_NONSTANDARD is not set
  6962. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  6963. CONFIG_UNIX98_PTYS=y
  6964. CONFIG_UNIX98_PTY_COUNT=256
  6965. --- a/arch/mips/defconfig-it8172
  6966. +++ b/arch/mips/defconfig-it8172
  6967. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  6968. # CONFIG_MIPS_PB1000 is not set
  6969. # CONFIG_MIPS_PB1100 is not set
  6970. # CONFIG_MIPS_PB1500 is not set
  6971. -# CONFIG_MIPS_HYDROGEN3 is not set
  6972. # CONFIG_MIPS_PB1550 is not set
  6973. +# CONFIG_MIPS_HYDROGEN3 is not set
  6974. # CONFIG_MIPS_XXS1500 is not set
  6975. # CONFIG_MIPS_MTX1 is not set
  6976. # CONFIG_COGENT_CSB250 is not set
  6977. @@ -186,8 +186,8 @@ CONFIG_MTD_CFI_INTELEXT=y
  6978. # Mapping drivers for chip access
  6979. #
  6980. CONFIG_MTD_PHYSMAP=y
  6981. -CONFIG_MTD_PHYSMAP_START=8000000
  6982. -CONFIG_MTD_PHYSMAP_LEN=2000000
  6983. +CONFIG_MTD_PHYSMAP_START=0x8000000
  6984. +CONFIG_MTD_PHYSMAP_LEN=0x2000000
  6985. CONFIG_MTD_PHYSMAP_BUSWIDTH=4
  6986. # CONFIG_MTD_PB1000 is not set
  6987. # CONFIG_MTD_PB1500 is not set
  6988. @@ -195,9 +195,7 @@ CONFIG_MTD_PHYSMAP_BUSWIDTH=4
  6989. # CONFIG_MTD_BOSPORUS is not set
  6990. # CONFIG_MTD_XXS1500 is not set
  6991. # CONFIG_MTD_MTX1 is not set
  6992. -# CONFIG_MTD_DB1X00 is not set
  6993. # CONFIG_MTD_PB1550 is not set
  6994. -# CONFIG_MTD_HYDROGEN3 is not set
  6995. # CONFIG_MTD_MIRAGE is not set
  6996. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  6997. # CONFIG_MTD_OCELOT is not set
  6998. @@ -216,7 +214,6 @@ CONFIG_MTD_PHYSMAP_BUSWIDTH=4
  6999. #
  7000. # Disk-On-Chip Device Drivers
  7001. #
  7002. -# CONFIG_MTD_DOC1000 is not set
  7003. # CONFIG_MTD_DOC2000 is not set
  7004. # CONFIG_MTD_DOC2001 is not set
  7005. # CONFIG_MTD_DOCPROBE is not set
  7006. @@ -304,11 +301,6 @@ CONFIG_IP_PNP_BOOTP=y
  7007. #
  7008. # CONFIG_IPX is not set
  7009. # CONFIG_ATALK is not set
  7010. -
  7011. -#
  7012. -# Appletalk devices
  7013. -#
  7014. -# CONFIG_DEV_APPLETALK is not set
  7015. # CONFIG_DECNET is not set
  7016. # CONFIG_BRIDGE is not set
  7017. # CONFIG_X25 is not set
  7018. @@ -592,7 +584,6 @@ CONFIG_SERIAL_CONSOLE=y
  7019. CONFIG_PC_KEYB=y
  7020. # CONFIG_IT8172_SCR0 is not set
  7021. # CONFIG_IT8172_SCR1 is not set
  7022. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7023. CONFIG_UNIX98_PTYS=y
  7024. CONFIG_UNIX98_PTY_COUNT=256
  7025. --- a/arch/mips/defconfig-ivr
  7026. +++ b/arch/mips/defconfig-ivr
  7027. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  7028. # CONFIG_MIPS_PB1000 is not set
  7029. # CONFIG_MIPS_PB1100 is not set
  7030. # CONFIG_MIPS_PB1500 is not set
  7031. -# CONFIG_MIPS_HYDROGEN3 is not set
  7032. # CONFIG_MIPS_PB1550 is not set
  7033. +# CONFIG_MIPS_HYDROGEN3 is not set
  7034. # CONFIG_MIPS_XXS1500 is not set
  7035. # CONFIG_MIPS_MTX1 is not set
  7036. # CONFIG_COGENT_CSB250 is not set
  7037. @@ -226,11 +226,6 @@ CONFIG_IP_PNP_BOOTP=y
  7038. #
  7039. # CONFIG_IPX is not set
  7040. # CONFIG_ATALK is not set
  7041. -
  7042. -#
  7043. -# Appletalk devices
  7044. -#
  7045. -# CONFIG_DEV_APPLETALK is not set
  7046. # CONFIG_DECNET is not set
  7047. # CONFIG_BRIDGE is not set
  7048. # CONFIG_X25 is not set
  7049. @@ -516,7 +511,6 @@ CONFIG_SERIAL_CONSOLE=y
  7050. CONFIG_QTRONIX_KEYBOARD=y
  7051. CONFIG_IT8172_CIR=y
  7052. # CONFIG_IT8172_SCR0 is not set
  7053. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7054. CONFIG_UNIX98_PTYS=y
  7055. CONFIG_UNIX98_PTY_COUNT=256
  7056. --- a/arch/mips/defconfig-jmr3927
  7057. +++ b/arch/mips/defconfig-jmr3927
  7058. @@ -28,8 +28,8 @@ CONFIG_EXPERIMENTAL=y
  7059. # CONFIG_MIPS_PB1000 is not set
  7060. # CONFIG_MIPS_PB1100 is not set
  7061. # CONFIG_MIPS_PB1500 is not set
  7062. -# CONFIG_MIPS_HYDROGEN3 is not set
  7063. # CONFIG_MIPS_PB1550 is not set
  7064. +# CONFIG_MIPS_HYDROGEN3 is not set
  7065. # CONFIG_MIPS_XXS1500 is not set
  7066. # CONFIG_MIPS_MTX1 is not set
  7067. # CONFIG_COGENT_CSB250 is not set
  7068. @@ -225,11 +225,6 @@ CONFIG_IP_PNP_BOOTP=y
  7069. #
  7070. # CONFIG_IPX is not set
  7071. # CONFIG_ATALK is not set
  7072. -
  7073. -#
  7074. -# Appletalk devices
  7075. -#
  7076. -# CONFIG_DEV_APPLETALK is not set
  7077. # CONFIG_DECNET is not set
  7078. # CONFIG_BRIDGE is not set
  7079. # CONFIG_X25 is not set
  7080. @@ -454,7 +449,6 @@ CONFIG_SERIAL_NONSTANDARD=y
  7081. # CONFIG_SERIAL_TXX9_CONSOLE is not set
  7082. CONFIG_TXX927_SERIAL=y
  7083. CONFIG_TXX927_SERIAL_CONSOLE=y
  7084. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7085. # CONFIG_UNIX98_PTYS is not set
  7086. #
  7087. --- a/arch/mips/defconfig-lasat
  7088. +++ b/arch/mips/defconfig-lasat
  7089. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  7090. # CONFIG_MIPS_PB1000 is not set
  7091. # CONFIG_MIPS_PB1100 is not set
  7092. # CONFIG_MIPS_PB1500 is not set
  7093. -# CONFIG_MIPS_HYDROGEN3 is not set
  7094. # CONFIG_MIPS_PB1550 is not set
  7095. +# CONFIG_MIPS_HYDROGEN3 is not set
  7096. # CONFIG_MIPS_XXS1500 is not set
  7097. # CONFIG_MIPS_MTX1 is not set
  7098. # CONFIG_COGENT_CSB250 is not set
  7099. @@ -198,9 +198,7 @@ CONFIG_MTD_CFI_AMDSTD=y
  7100. # CONFIG_MTD_BOSPORUS is not set
  7101. # CONFIG_MTD_XXS1500 is not set
  7102. # CONFIG_MTD_MTX1 is not set
  7103. -# CONFIG_MTD_DB1X00 is not set
  7104. # CONFIG_MTD_PB1550 is not set
  7105. -# CONFIG_MTD_HYDROGEN3 is not set
  7106. # CONFIG_MTD_MIRAGE is not set
  7107. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  7108. # CONFIG_MTD_OCELOT is not set
  7109. @@ -219,7 +217,6 @@ CONFIG_MTD_LASAT=y
  7110. #
  7111. # Disk-On-Chip Device Drivers
  7112. #
  7113. -# CONFIG_MTD_DOC1000 is not set
  7114. # CONFIG_MTD_DOC2000 is not set
  7115. # CONFIG_MTD_DOC2001 is not set
  7116. # CONFIG_MTD_DOCPROBE is not set
  7117. @@ -303,11 +300,6 @@ CONFIG_INET=y
  7118. #
  7119. # CONFIG_IPX is not set
  7120. # CONFIG_ATALK is not set
  7121. -
  7122. -#
  7123. -# Appletalk devices
  7124. -#
  7125. -# CONFIG_DEV_APPLETALK is not set
  7126. # CONFIG_DECNET is not set
  7127. # CONFIG_BRIDGE is not set
  7128. # CONFIG_X25 is not set
  7129. @@ -584,7 +576,6 @@ CONFIG_SERIAL=y
  7130. CONFIG_SERIAL_CONSOLE=y
  7131. # CONFIG_SERIAL_EXTENDED is not set
  7132. # CONFIG_SERIAL_NONSTANDARD is not set
  7133. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7134. CONFIG_UNIX98_PTYS=y
  7135. CONFIG_UNIX98_PTY_COUNT=256
  7136. --- a/arch/mips/defconfig-malta
  7137. +++ b/arch/mips/defconfig-malta
  7138. @@ -22,16 +22,19 @@ CONFIG_KMOD=y
  7139. #
  7140. # CONFIG_ACER_PICA_61 is not set
  7141. # CONFIG_MIPS_BOSPORUS is not set
  7142. +# CONFIG_MIPS_FICMMP is not set
  7143. # CONFIG_MIPS_MIRAGE is not set
  7144. # CONFIG_MIPS_DB1000 is not set
  7145. # CONFIG_MIPS_DB1100 is not set
  7146. # CONFIG_MIPS_DB1500 is not set
  7147. # CONFIG_MIPS_DB1550 is not set
  7148. +# CONFIG_MIPS_DB1200 is not set
  7149. # CONFIG_MIPS_PB1000 is not set
  7150. # CONFIG_MIPS_PB1100 is not set
  7151. # CONFIG_MIPS_PB1500 is not set
  7152. -# CONFIG_MIPS_HYDROGEN3 is not set
  7153. # CONFIG_MIPS_PB1550 is not set
  7154. +# CONFIG_MIPS_PB1200 is not set
  7155. +# CONFIG_MIPS_HYDROGEN3 is not set
  7156. # CONFIG_MIPS_XXS1500 is not set
  7157. # CONFIG_MIPS_MTX1 is not set
  7158. # CONFIG_COGENT_CSB250 is not set
  7159. @@ -237,11 +240,6 @@ CONFIG_IP_PNP_BOOTP=y
  7160. #
  7161. # CONFIG_IPX is not set
  7162. # CONFIG_ATALK is not set
  7163. -
  7164. -#
  7165. -# Appletalk devices
  7166. -#
  7167. -# CONFIG_DEV_APPLETALK is not set
  7168. # CONFIG_DECNET is not set
  7169. # CONFIG_BRIDGE is not set
  7170. # CONFIG_X25 is not set
  7171. @@ -273,8 +271,83 @@ CONFIG_IP_PNP_BOOTP=y
  7172. #
  7173. # ATA/IDE/MFM/RLL support
  7174. #
  7175. -# CONFIG_IDE is not set
  7176. +CONFIG_IDE=y
  7177. +
  7178. +#
  7179. +# IDE, ATA and ATAPI Block devices
  7180. +#
  7181. +CONFIG_BLK_DEV_IDE=y
  7182. +
  7183. +#
  7184. +# Please see Documentation/ide.txt for help/info on IDE drives
  7185. +#
  7186. +# CONFIG_BLK_DEV_HD_IDE is not set
  7187. # CONFIG_BLK_DEV_HD is not set
  7188. +# CONFIG_BLK_DEV_IDE_SATA is not set
  7189. +CONFIG_BLK_DEV_IDEDISK=y
  7190. +# CONFIG_IDEDISK_MULTI_MODE is not set
  7191. +# CONFIG_IDEDISK_STROKE is not set
  7192. +# CONFIG_BLK_DEV_IDECS is not set
  7193. +# CONFIG_BLK_DEV_DELKIN is not set
  7194. +CONFIG_BLK_DEV_IDECD=y
  7195. +CONFIG_BLK_DEV_IDETAPE=y
  7196. +CONFIG_BLK_DEV_IDEFLOPPY=y
  7197. +CONFIG_BLK_DEV_IDESCSI=y
  7198. +# CONFIG_IDE_TASK_IOCTL is not set
  7199. +
  7200. +#
  7201. +# IDE chipset support/bugfixes
  7202. +#
  7203. +# CONFIG_BLK_DEV_CMD640 is not set
  7204. +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
  7205. +# CONFIG_BLK_DEV_ISAPNP is not set
  7206. +CONFIG_BLK_DEV_IDEPCI=y
  7207. +CONFIG_BLK_DEV_GENERIC=y
  7208. +CONFIG_IDEPCI_SHARE_IRQ=y
  7209. +CONFIG_BLK_DEV_IDEDMA_PCI=y
  7210. +# CONFIG_BLK_DEV_OFFBOARD is not set
  7211. +CONFIG_BLK_DEV_IDEDMA_FORCED=y
  7212. +CONFIG_IDEDMA_PCI_AUTO=y
  7213. +# CONFIG_IDEDMA_ONLYDISK is not set
  7214. +CONFIG_BLK_DEV_IDEDMA=y
  7215. +# CONFIG_IDEDMA_PCI_WIP is not set
  7216. +# CONFIG_BLK_DEV_ADMA100 is not set
  7217. +# CONFIG_BLK_DEV_AEC62XX is not set
  7218. +# CONFIG_BLK_DEV_ALI15X3 is not set
  7219. +# CONFIG_WDC_ALI15X3 is not set
  7220. +# CONFIG_BLK_DEV_AMD74XX is not set
  7221. +# CONFIG_AMD74XX_OVERRIDE is not set
  7222. +# CONFIG_BLK_DEV_ATIIXP is not set
  7223. +# CONFIG_BLK_DEV_CMD64X is not set
  7224. +# CONFIG_BLK_DEV_TRIFLEX is not set
  7225. +# CONFIG_BLK_DEV_CY82C693 is not set
  7226. +# CONFIG_BLK_DEV_CS5530 is not set
  7227. +# CONFIG_BLK_DEV_HPT34X is not set
  7228. +# CONFIG_HPT34X_AUTODMA is not set
  7229. +# CONFIG_BLK_DEV_HPT366 is not set
  7230. +CONFIG_BLK_DEV_PIIX=y
  7231. +# CONFIG_BLK_DEV_NS87415 is not set
  7232. +# CONFIG_BLK_DEV_OPTI621 is not set
  7233. +# CONFIG_BLK_DEV_PDC202XX_OLD is not set
  7234. +# CONFIG_PDC202XX_BURST is not set
  7235. +# CONFIG_BLK_DEV_PDC202XX_NEW is not set
  7236. +# CONFIG_BLK_DEV_RZ1000 is not set
  7237. +# CONFIG_BLK_DEV_SC1200 is not set
  7238. +# CONFIG_BLK_DEV_SVWKS is not set
  7239. +# CONFIG_BLK_DEV_SIIMAGE is not set
  7240. +# CONFIG_BLK_DEV_SIS5513 is not set
  7241. +# CONFIG_BLK_DEV_SLC90E66 is not set
  7242. +# CONFIG_BLK_DEV_TRM290 is not set
  7243. +# CONFIG_BLK_DEV_VIA82CXXX is not set
  7244. +# CONFIG_IDE_CHIPSETS is not set
  7245. +CONFIG_IDEDMA_AUTO=y
  7246. +# CONFIG_IDEDMA_IVB is not set
  7247. +# CONFIG_DMA_NONPCI is not set
  7248. +# CONFIG_BLK_DEV_ATARAID is not set
  7249. +# CONFIG_BLK_DEV_ATARAID_PDC is not set
  7250. +# CONFIG_BLK_DEV_ATARAID_HPT is not set
  7251. +# CONFIG_BLK_DEV_ATARAID_MEDLEY is not set
  7252. +# CONFIG_BLK_DEV_ATARAID_SII is not set
  7253. #
  7254. # SCSI support
  7255. @@ -319,9 +392,11 @@ CONFIG_SD_EXTRA_DEVS=40
  7256. # CONFIG_SCSI_MEGARAID is not set
  7257. # CONFIG_SCSI_MEGARAID2 is not set
  7258. # CONFIG_SCSI_SATA is not set
  7259. +# CONFIG_SCSI_SATA_AHCI is not set
  7260. # CONFIG_SCSI_SATA_SVW is not set
  7261. # CONFIG_SCSI_ATA_PIIX is not set
  7262. # CONFIG_SCSI_SATA_NV is not set
  7263. +# CONFIG_SCSI_SATA_QSTOR is not set
  7264. # CONFIG_SCSI_SATA_PROMISE is not set
  7265. # CONFIG_SCSI_SATA_SX4 is not set
  7266. # CONFIG_SCSI_SATA_SIL is not set
  7267. @@ -524,7 +599,6 @@ CONFIG_SERIAL=y
  7268. CONFIG_SERIAL_CONSOLE=y
  7269. # CONFIG_SERIAL_EXTENDED is not set
  7270. # CONFIG_SERIAL_NONSTANDARD is not set
  7271. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7272. CONFIG_UNIX98_PTYS=y
  7273. CONFIG_UNIX98_PTY_COUNT=256
  7274. --- a/arch/mips/defconfig-mirage
  7275. +++ b/arch/mips/defconfig-mirage
  7276. @@ -30,8 +30,8 @@ CONFIG_MIPS_MIRAGE=y
  7277. # CONFIG_MIPS_PB1000 is not set
  7278. # CONFIG_MIPS_PB1100 is not set
  7279. # CONFIG_MIPS_PB1500 is not set
  7280. -# CONFIG_MIPS_HYDROGEN3 is not set
  7281. # CONFIG_MIPS_PB1550 is not set
  7282. +# CONFIG_MIPS_HYDROGEN3 is not set
  7283. # CONFIG_MIPS_XXS1500 is not set
  7284. # CONFIG_MIPS_MTX1 is not set
  7285. # CONFIG_COGENT_CSB250 is not set
  7286. @@ -209,9 +209,7 @@ CONFIG_MTD_CFI_AMDSTD=y
  7287. # CONFIG_MTD_BOSPORUS is not set
  7288. # CONFIG_MTD_XXS1500 is not set
  7289. # CONFIG_MTD_MTX1 is not set
  7290. -# CONFIG_MTD_DB1X00 is not set
  7291. # CONFIG_MTD_PB1550 is not set
  7292. -# CONFIG_MTD_HYDROGEN3 is not set
  7293. CONFIG_MTD_MIRAGE=y
  7294. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  7295. # CONFIG_MTD_OCELOT is not set
  7296. @@ -230,7 +228,6 @@ CONFIG_MTD_MIRAGE=y
  7297. #
  7298. # Disk-On-Chip Device Drivers
  7299. #
  7300. -# CONFIG_MTD_DOC1000 is not set
  7301. # CONFIG_MTD_DOC2000 is not set
  7302. # CONFIG_MTD_DOC2001 is not set
  7303. # CONFIG_MTD_DOCPROBE is not set
  7304. @@ -335,11 +332,6 @@ CONFIG_IP_PNP_BOOTP=y
  7305. #
  7306. # CONFIG_IPX is not set
  7307. # CONFIG_ATALK is not set
  7308. -
  7309. -#
  7310. -# Appletalk devices
  7311. -#
  7312. -# CONFIG_DEV_APPLETALK is not set
  7313. # CONFIG_DECNET is not set
  7314. # CONFIG_BRIDGE is not set
  7315. # CONFIG_X25 is not set
  7316. @@ -560,7 +552,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  7317. # CONFIG_AU1X00_USB_TTY is not set
  7318. # CONFIG_AU1X00_USB_RAW is not set
  7319. # CONFIG_TXX927_SERIAL is not set
  7320. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7321. CONFIG_UNIX98_PTYS=y
  7322. CONFIG_UNIX98_PTY_COUNT=256
  7323. --- a/arch/mips/defconfig-mpc30x
  7324. +++ b/arch/mips/defconfig-mpc30x
  7325. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  7326. # CONFIG_MIPS_PB1000 is not set
  7327. # CONFIG_MIPS_PB1100 is not set
  7328. # CONFIG_MIPS_PB1500 is not set
  7329. -# CONFIG_MIPS_HYDROGEN3 is not set
  7330. # CONFIG_MIPS_PB1550 is not set
  7331. +# CONFIG_MIPS_HYDROGEN3 is not set
  7332. # CONFIG_MIPS_XXS1500 is not set
  7333. # CONFIG_MIPS_MTX1 is not set
  7334. # CONFIG_COGENT_CSB250 is not set
  7335. @@ -228,11 +228,6 @@ CONFIG_IP_PNP_BOOTP=y
  7336. #
  7337. # CONFIG_IPX is not set
  7338. # CONFIG_ATALK is not set
  7339. -
  7340. -#
  7341. -# Appletalk devices
  7342. -#
  7343. -# CONFIG_DEV_APPLETALK is not set
  7344. # CONFIG_DECNET is not set
  7345. # CONFIG_BRIDGE is not set
  7346. # CONFIG_X25 is not set
  7347. @@ -400,7 +395,6 @@ CONFIG_SERIAL=y
  7348. CONFIG_SERIAL_CONSOLE=y
  7349. # CONFIG_SERIAL_EXTENDED is not set
  7350. # CONFIG_SERIAL_NONSTANDARD is not set
  7351. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7352. # CONFIG_VR41XX_KIU is not set
  7353. CONFIG_UNIX98_PTYS=y
  7354. CONFIG_UNIX98_PTY_COUNT=256
  7355. --- a/arch/mips/defconfig-mtx-1
  7356. +++ b/arch/mips/defconfig-mtx-1
  7357. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  7358. # CONFIG_MIPS_PB1000 is not set
  7359. # CONFIG_MIPS_PB1100 is not set
  7360. # CONFIG_MIPS_PB1500 is not set
  7361. -# CONFIG_MIPS_HYDROGEN3 is not set
  7362. # CONFIG_MIPS_PB1550 is not set
  7363. +# CONFIG_MIPS_HYDROGEN3 is not set
  7364. # CONFIG_MIPS_XXS1500 is not set
  7365. CONFIG_MIPS_MTX1=y
  7366. # CONFIG_COGENT_CSB250 is not set
  7367. @@ -193,9 +193,7 @@ CONFIG_MTD_CFI_AMDSTD=y
  7368. # CONFIG_MTD_BOSPORUS is not set
  7369. # CONFIG_MTD_XXS1500 is not set
  7370. CONFIG_MTD_MTX1=y
  7371. -# CONFIG_MTD_DB1X00 is not set
  7372. # CONFIG_MTD_PB1550 is not set
  7373. -# CONFIG_MTD_HYDROGEN3 is not set
  7374. # CONFIG_MTD_MIRAGE is not set
  7375. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  7376. # CONFIG_MTD_OCELOT is not set
  7377. @@ -214,7 +212,6 @@ CONFIG_MTD_MTX1=y
  7378. #
  7379. # Disk-On-Chip Device Drivers
  7380. #
  7381. -# CONFIG_MTD_DOC1000 is not set
  7382. # CONFIG_MTD_DOC2000 is not set
  7383. # CONFIG_MTD_DOC2001 is not set
  7384. # CONFIG_MTD_DOCPROBE is not set
  7385. @@ -371,11 +368,6 @@ CONFIG_VLAN_8021Q=m
  7386. #
  7387. # CONFIG_IPX is not set
  7388. # CONFIG_ATALK is not set
  7389. -
  7390. -#
  7391. -# Appletalk devices
  7392. -#
  7393. -# CONFIG_DEV_APPLETALK is not set
  7394. # CONFIG_DECNET is not set
  7395. CONFIG_BRIDGE=m
  7396. # CONFIG_X25 is not set
  7397. @@ -479,9 +471,11 @@ CONFIG_SR_EXTRA_DEVS=2
  7398. # CONFIG_SCSI_MEGARAID is not set
  7399. # CONFIG_SCSI_MEGARAID2 is not set
  7400. # CONFIG_SCSI_SATA is not set
  7401. +# CONFIG_SCSI_SATA_AHCI is not set
  7402. # CONFIG_SCSI_SATA_SVW is not set
  7403. # CONFIG_SCSI_ATA_PIIX is not set
  7404. # CONFIG_SCSI_SATA_NV is not set
  7405. +# CONFIG_SCSI_SATA_QSTOR is not set
  7406. # CONFIG_SCSI_SATA_PROMISE is not set
  7407. # CONFIG_SCSI_SATA_SX4 is not set
  7408. # CONFIG_SCSI_SATA_SIL is not set
  7409. @@ -700,7 +694,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  7410. # CONFIG_AU1X00_USB_TTY is not set
  7411. # CONFIG_AU1X00_USB_RAW is not set
  7412. # CONFIG_TXX927_SERIAL is not set
  7413. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7414. CONFIG_UNIX98_PTYS=y
  7415. CONFIG_UNIX98_PTY_COUNT=256
  7416. --- a/arch/mips/defconfig-nino
  7417. +++ b/arch/mips/defconfig-nino
  7418. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  7419. # CONFIG_MIPS_PB1000 is not set
  7420. # CONFIG_MIPS_PB1100 is not set
  7421. # CONFIG_MIPS_PB1500 is not set
  7422. -# CONFIG_MIPS_HYDROGEN3 is not set
  7423. # CONFIG_MIPS_PB1550 is not set
  7424. +# CONFIG_MIPS_HYDROGEN3 is not set
  7425. # CONFIG_MIPS_XXS1500 is not set
  7426. # CONFIG_MIPS_MTX1 is not set
  7427. # CONFIG_COGENT_CSB250 is not set
  7428. @@ -226,11 +226,6 @@ CONFIG_INET=y
  7429. #
  7430. # CONFIG_IPX is not set
  7431. # CONFIG_ATALK is not set
  7432. -
  7433. -#
  7434. -# Appletalk devices
  7435. -#
  7436. -# CONFIG_DEV_APPLETALK is not set
  7437. # CONFIG_DECNET is not set
  7438. # CONFIG_BRIDGE is not set
  7439. # CONFIG_X25 is not set
  7440. @@ -339,7 +334,6 @@ CONFIG_SERIAL_TX3912_CONSOLE=y
  7441. # CONFIG_SERIAL_TXX9 is not set
  7442. # CONFIG_SERIAL_TXX9_CONSOLE is not set
  7443. # CONFIG_TXX927_SERIAL is not set
  7444. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7445. # CONFIG_UNIX98_PTYS is not set
  7446. #
  7447. --- a/arch/mips/defconfig-ocelot
  7448. +++ b/arch/mips/defconfig-ocelot
  7449. @@ -28,8 +28,8 @@ CONFIG_EXPERIMENTAL=y
  7450. # CONFIG_MIPS_PB1000 is not set
  7451. # CONFIG_MIPS_PB1100 is not set
  7452. # CONFIG_MIPS_PB1500 is not set
  7453. -# CONFIG_MIPS_HYDROGEN3 is not set
  7454. # CONFIG_MIPS_PB1550 is not set
  7455. +# CONFIG_MIPS_HYDROGEN3 is not set
  7456. # CONFIG_MIPS_XXS1500 is not set
  7457. # CONFIG_MIPS_MTX1 is not set
  7458. # CONFIG_COGENT_CSB250 is not set
  7459. @@ -194,9 +194,7 @@ CONFIG_MTD_JEDEC=y
  7460. # CONFIG_MTD_BOSPORUS is not set
  7461. # CONFIG_MTD_XXS1500 is not set
  7462. # CONFIG_MTD_MTX1 is not set
  7463. -# CONFIG_MTD_DB1X00 is not set
  7464. # CONFIG_MTD_PB1550 is not set
  7465. -# CONFIG_MTD_HYDROGEN3 is not set
  7466. # CONFIG_MTD_MIRAGE is not set
  7467. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  7468. CONFIG_MTD_OCELOT=y
  7469. @@ -215,7 +213,6 @@ CONFIG_MTD_OCELOT=y
  7470. #
  7471. # Disk-On-Chip Device Drivers
  7472. #
  7473. -# CONFIG_MTD_DOC1000 is not set
  7474. CONFIG_MTD_DOC2000=y
  7475. # CONFIG_MTD_DOC2001 is not set
  7476. CONFIG_MTD_DOCPROBE=y
  7477. @@ -307,11 +304,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. @@ -513,7 +505,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_UNIX98_PTYS=y
  7495. CONFIG_UNIX98_PTY_COUNT=256
  7496. --- a/arch/mips/defconfig-osprey
  7497. +++ b/arch/mips/defconfig-osprey
  7498. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  7499. # CONFIG_MIPS_PB1000 is not set
  7500. # CONFIG_MIPS_PB1100 is not set
  7501. # CONFIG_MIPS_PB1500 is not set
  7502. -# CONFIG_MIPS_HYDROGEN3 is not set
  7503. # CONFIG_MIPS_PB1550 is not set
  7504. +# CONFIG_MIPS_HYDROGEN3 is not set
  7505. # CONFIG_MIPS_XXS1500 is not set
  7506. # CONFIG_MIPS_MTX1 is not set
  7507. # CONFIG_COGENT_CSB250 is not set
  7508. @@ -227,11 +227,6 @@ CONFIG_IP_PNP_BOOTP=y
  7509. #
  7510. # CONFIG_IPX is not set
  7511. # CONFIG_ATALK is not set
  7512. -
  7513. -#
  7514. -# Appletalk devices
  7515. -#
  7516. -# CONFIG_DEV_APPLETALK is not set
  7517. # CONFIG_DECNET is not set
  7518. # CONFIG_BRIDGE is not set
  7519. # CONFIG_X25 is not set
  7520. @@ -388,7 +383,6 @@ CONFIG_SERIAL_MANY_PORTS=y
  7521. # CONFIG_SERIAL_MULTIPORT is not set
  7522. # CONFIG_HUB6 is not set
  7523. # CONFIG_SERIAL_NONSTANDARD is not set
  7524. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7525. # CONFIG_VR41XX_KIU is not set
  7526. CONFIG_UNIX98_PTYS=y
  7527. CONFIG_UNIX98_PTY_COUNT=256
  7528. --- a/arch/mips/defconfig-pb1000
  7529. +++ b/arch/mips/defconfig-pb1000
  7530. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  7531. CONFIG_MIPS_PB1000=y
  7532. # CONFIG_MIPS_PB1100 is not set
  7533. # CONFIG_MIPS_PB1500 is not set
  7534. -# CONFIG_MIPS_HYDROGEN3 is not set
  7535. # CONFIG_MIPS_PB1550 is not set
  7536. +# CONFIG_MIPS_HYDROGEN3 is not set
  7537. # CONFIG_MIPS_XXS1500 is not set
  7538. # CONFIG_MIPS_MTX1 is not set
  7539. # CONFIG_COGENT_CSB250 is not set
  7540. @@ -215,9 +215,7 @@ CONFIG_MTD_PB1000=y
  7541. # CONFIG_MTD_BOSPORUS is not set
  7542. # CONFIG_MTD_XXS1500 is not set
  7543. # CONFIG_MTD_MTX1 is not set
  7544. -# CONFIG_MTD_DB1X00 is not set
  7545. # CONFIG_MTD_PB1550 is not set
  7546. -# CONFIG_MTD_HYDROGEN3 is not set
  7547. # CONFIG_MTD_MIRAGE is not set
  7548. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  7549. # CONFIG_MTD_OCELOT is not set
  7550. @@ -236,7 +234,6 @@ CONFIG_MTD_PB1000=y
  7551. #
  7552. # Disk-On-Chip Device Drivers
  7553. #
  7554. -# CONFIG_MTD_DOC1000 is not set
  7555. # CONFIG_MTD_DOC2000 is not set
  7556. # CONFIG_MTD_DOC2001 is not set
  7557. # CONFIG_MTD_DOCPROBE is not set
  7558. @@ -324,11 +321,6 @@ CONFIG_IP_PNP_BOOTP=y
  7559. #
  7560. # CONFIG_IPX is not set
  7561. # CONFIG_ATALK is not set
  7562. -
  7563. -#
  7564. -# Appletalk devices
  7565. -#
  7566. -# CONFIG_DEV_APPLETALK is not set
  7567. # CONFIG_DECNET is not set
  7568. # CONFIG_BRIDGE is not set
  7569. # CONFIG_X25 is not set
  7570. @@ -622,7 +614,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  7571. # CONFIG_AU1X00_USB_TTY is not set
  7572. # CONFIG_AU1X00_USB_RAW is not set
  7573. # CONFIG_TXX927_SERIAL is not set
  7574. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7575. CONFIG_UNIX98_PTYS=y
  7576. CONFIG_UNIX98_PTY_COUNT=256
  7577. @@ -707,7 +698,7 @@ CONFIG_UNIX98_PTY_COUNT=256
  7578. #
  7579. # CONFIG_PCMCIA_SERIAL_CS is not set
  7580. # CONFIG_SYNCLINK_CS is not set
  7581. -CONFIG_AU1X00_GPIO=m
  7582. +CONFIG_AU1X00_GPIO=y
  7583. # CONFIG_TS_AU1X00_ADS7846 is not set
  7584. #
  7585. --- a/arch/mips/defconfig-pb1100
  7586. +++ b/arch/mips/defconfig-pb1100
  7587. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  7588. # CONFIG_MIPS_PB1000 is not set
  7589. CONFIG_MIPS_PB1100=y
  7590. # CONFIG_MIPS_PB1500 is not set
  7591. -# CONFIG_MIPS_HYDROGEN3 is not set
  7592. # CONFIG_MIPS_PB1550 is not set
  7593. +# CONFIG_MIPS_HYDROGEN3 is not set
  7594. # CONFIG_MIPS_XXS1500 is not set
  7595. # CONFIG_MIPS_MTX1 is not set
  7596. # CONFIG_COGENT_CSB250 is not set
  7597. @@ -198,9 +198,7 @@ CONFIG_MTD_PB1100=y
  7598. # CONFIG_MTD_MTX1 is not set
  7599. CONFIG_MTD_PB1500_BOOT=y
  7600. CONFIG_MTD_PB1500_USER=y
  7601. -# CONFIG_MTD_DB1X00 is not set
  7602. # CONFIG_MTD_PB1550 is not set
  7603. -# CONFIG_MTD_HYDROGEN3 is not set
  7604. # CONFIG_MTD_MIRAGE is not set
  7605. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  7606. # CONFIG_MTD_OCELOT is not set
  7607. @@ -219,7 +217,6 @@ CONFIG_MTD_PB1500_USER=y
  7608. #
  7609. # Disk-On-Chip Device Drivers
  7610. #
  7611. -# CONFIG_MTD_DOC1000 is not set
  7612. # CONFIG_MTD_DOC2000 is not set
  7613. # CONFIG_MTD_DOC2001 is not set
  7614. # CONFIG_MTD_DOCPROBE is not set
  7615. @@ -324,11 +321,6 @@ CONFIG_IP_PNP_BOOTP=y
  7616. #
  7617. # CONFIG_IPX is not set
  7618. # CONFIG_ATALK is not set
  7619. -
  7620. -#
  7621. -# Appletalk devices
  7622. -#
  7623. -# CONFIG_DEV_APPLETALK is not set
  7624. # CONFIG_DECNET is not set
  7625. # CONFIG_BRIDGE is not set
  7626. # CONFIG_X25 is not set
  7627. @@ -613,7 +605,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  7628. # CONFIG_AU1X00_USB_TTY is not set
  7629. # CONFIG_AU1X00_USB_RAW is not set
  7630. # CONFIG_TXX927_SERIAL is not set
  7631. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  7632. CONFIG_UNIX98_PTYS=y
  7633. CONFIG_UNIX98_PTY_COUNT=256
  7634. @@ -859,6 +850,7 @@ CONFIG_DUMMY_CONSOLE=y
  7635. # CONFIG_FB_PM2 is not set
  7636. # CONFIG_FB_PM3 is not set
  7637. # CONFIG_FB_CYBER2000 is not set
  7638. +CONFIG_FB_AU1100=y
  7639. # CONFIG_FB_MATROX is not set
  7640. # CONFIG_FB_ATY is not set
  7641. # CONFIG_FB_RADEON is not set
  7642. @@ -870,7 +862,6 @@ CONFIG_DUMMY_CONSOLE=y
  7643. # CONFIG_FB_VOODOO1 is not set
  7644. # CONFIG_FB_TRIDENT is not set
  7645. # CONFIG_FB_E1356 is not set
  7646. -CONFIG_FB_AU1100=y
  7647. # CONFIG_FB_IT8181 is not set
  7648. # CONFIG_FB_VIRTUAL is not set
  7649. CONFIG_FBCON_ADVANCED=y
  7650. --- /dev/null
  7651. +++ b/arch/mips/defconfig-pb1200
  7652. @@ -0,0 +1,1060 @@
  7653. +#
  7654. +# Automatically generated make config: don't edit
  7655. +#
  7656. +CONFIG_MIPS=y
  7657. +CONFIG_MIPS32=y
  7658. +# CONFIG_MIPS64 is not set
  7659. +
  7660. +#
  7661. +# Code maturity level options
  7662. +#
  7663. +CONFIG_EXPERIMENTAL=y
  7664. +
  7665. +#
  7666. +# Loadable module support
  7667. +#
  7668. +CONFIG_MODULES=y
  7669. +# CONFIG_MODVERSIONS is not set
  7670. +CONFIG_KMOD=y
  7671. +
  7672. +#
  7673. +# Machine selection
  7674. +#
  7675. +# CONFIG_ACER_PICA_61 is not set
  7676. +# CONFIG_MIPS_BOSPORUS is not set
  7677. +# CONFIG_MIPS_MIRAGE is not set
  7678. +# CONFIG_MIPS_DB1000 is not set
  7679. +# CONFIG_MIPS_DB1100 is not set
  7680. +# CONFIG_MIPS_DB1500 is not set
  7681. +# CONFIG_MIPS_DB1550 is not set
  7682. +# CONFIG_MIPS_PB1000 is not set
  7683. +# CONFIG_MIPS_PB1100 is not set
  7684. +# CONFIG_MIPS_PB1500 is not set
  7685. +# CONFIG_MIPS_PB1550 is not set
  7686. +# CONFIG_MIPS_HYDROGEN3 is not set
  7687. +# CONFIG_MIPS_XXS1500 is not set
  7688. +# CONFIG_MIPS_MTX1 is not set
  7689. +# CONFIG_COGENT_CSB250 is not set
  7690. +# CONFIG_BAGET_MIPS is not set
  7691. +# CONFIG_CASIO_E55 is not set
  7692. +# CONFIG_MIPS_COBALT is not set
  7693. +# CONFIG_DECSTATION is not set
  7694. +# CONFIG_MIPS_EV64120 is not set
  7695. +# CONFIG_MIPS_EV96100 is not set
  7696. +# CONFIG_MIPS_IVR is not set
  7697. +# CONFIG_HP_LASERJET is not set
  7698. +# CONFIG_IBM_WORKPAD is not set
  7699. +# CONFIG_LASAT is not set
  7700. +# CONFIG_MIPS_ITE8172 is not set
  7701. +# CONFIG_MIPS_ATLAS is not set
  7702. +# CONFIG_MIPS_MAGNUM_4000 is not set
  7703. +# CONFIG_MIPS_MALTA is not set
  7704. +# CONFIG_MIPS_SEAD is not set
  7705. +# CONFIG_MOMENCO_OCELOT is not set
  7706. +# CONFIG_MOMENCO_OCELOT_G is not set
  7707. +# CONFIG_MOMENCO_OCELOT_C is not set
  7708. +# CONFIG_MOMENCO_JAGUAR_ATX is not set
  7709. +# CONFIG_PMC_BIG_SUR is not set
  7710. +# CONFIG_PMC_STRETCH is not set
  7711. +# CONFIG_PMC_YOSEMITE is not set
  7712. +# CONFIG_DDB5074 is not set
  7713. +# CONFIG_DDB5476 is not set
  7714. +# CONFIG_DDB5477 is not set
  7715. +# CONFIG_NEC_OSPREY is not set
  7716. +# CONFIG_NEC_EAGLE is not set
  7717. +# CONFIG_OLIVETTI_M700 is not set
  7718. +# CONFIG_NINO is not set
  7719. +# CONFIG_SGI_IP22 is not set
  7720. +# CONFIG_SGI_IP27 is not set
  7721. +# CONFIG_SIBYTE_SB1xxx_SOC is not set
  7722. +# CONFIG_SNI_RM200_PCI is not set
  7723. +# CONFIG_TANBAC_TB0226 is not set
  7724. +# CONFIG_TANBAC_TB0229 is not set
  7725. +# CONFIG_TOSHIBA_JMR3927 is not set
  7726. +# CONFIG_TOSHIBA_RBTX4927 is not set
  7727. +# CONFIG_VICTOR_MPC30X is not set
  7728. +# CONFIG_ZAO_CAPCELLA is not set
  7729. +# CONFIG_HIGHMEM is not set
  7730. +CONFIG_RWSEM_GENERIC_SPINLOCK=y
  7731. +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
  7732. +CONFIG_SOC_AU1X00=y
  7733. +CONFIG_SOC_AU1200=y
  7734. +CONFIG_NONCOHERENT_IO=y
  7735. +CONFIG_PC_KEYB=y
  7736. +# CONFIG_MIPS_AU1000 is not set
  7737. +
  7738. +#
  7739. +# CPU selection
  7740. +#
  7741. +CONFIG_CPU_MIPS32=y
  7742. +# CONFIG_CPU_MIPS64 is not set
  7743. +# CONFIG_CPU_R3000 is not set
  7744. +# CONFIG_CPU_TX39XX is not set
  7745. +# CONFIG_CPU_VR41XX is not set
  7746. +# CONFIG_CPU_R4300 is not set
  7747. +# CONFIG_CPU_R4X00 is not set
  7748. +# CONFIG_CPU_TX49XX is not set
  7749. +# CONFIG_CPU_R5000 is not set
  7750. +# CONFIG_CPU_R5432 is not set
  7751. +# CONFIG_CPU_R6000 is not set
  7752. +# CONFIG_CPU_NEVADA is not set
  7753. +# CONFIG_CPU_R8000 is not set
  7754. +# CONFIG_CPU_R10000 is not set
  7755. +# CONFIG_CPU_RM7000 is not set
  7756. +# CONFIG_CPU_RM9000 is not set
  7757. +# CONFIG_CPU_SB1 is not set
  7758. +CONFIG_PAGE_SIZE_4KB=y
  7759. +# CONFIG_PAGE_SIZE_16KB is not set
  7760. +# CONFIG_PAGE_SIZE_64KB is not set
  7761. +CONFIG_CPU_HAS_PREFETCH=y
  7762. +# CONFIG_VTAG_ICACHE is not set
  7763. +CONFIG_64BIT_PHYS_ADDR=y
  7764. +# CONFIG_CPU_ADVANCED is not set
  7765. +CONFIG_CPU_HAS_LLSC=y
  7766. +# CONFIG_CPU_HAS_LLDSCD is not set
  7767. +# CONFIG_CPU_HAS_WB is not set
  7768. +CONFIG_CPU_HAS_SYNC=y
  7769. +
  7770. +#
  7771. +# General setup
  7772. +#
  7773. +CONFIG_CPU_LITTLE_ENDIAN=y
  7774. +# CONFIG_BUILD_ELF64 is not set
  7775. +CONFIG_NET=y
  7776. +CONFIG_PCI=y
  7777. +CONFIG_PCI_NEW=y
  7778. +CONFIG_PCI_AUTO=y
  7779. +# CONFIG_PCI_NAMES is not set
  7780. +# CONFIG_ISA is not set
  7781. +# CONFIG_TC is not set
  7782. +# CONFIG_MCA is not set
  7783. +# CONFIG_SBUS is not set
  7784. +CONFIG_HOTPLUG=y
  7785. +
  7786. +#
  7787. +# PCMCIA/CardBus support
  7788. +#
  7789. +CONFIG_PCMCIA=m
  7790. +# CONFIG_CARDBUS is not set
  7791. +# CONFIG_TCIC is not set
  7792. +# CONFIG_I82092 is not set
  7793. +# CONFIG_I82365 is not set
  7794. +CONFIG_PCMCIA_AU1X00=m
  7795. +
  7796. +#
  7797. +# PCI Hotplug Support
  7798. +#
  7799. +# CONFIG_HOTPLUG_PCI is not set
  7800. +# CONFIG_HOTPLUG_PCI_COMPAQ is not set
  7801. +# CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set
  7802. +# CONFIG_HOTPLUG_PCI_SHPC is not set
  7803. +# CONFIG_HOTPLUG_PCI_SHPC_POLL_EVENT_MODE is not set
  7804. +# CONFIG_HOTPLUG_PCI_PCIE is not set
  7805. +# CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE is not set
  7806. +CONFIG_SYSVIPC=y
  7807. +# CONFIG_BSD_PROCESS_ACCT is not set
  7808. +CONFIG_SYSCTL=y
  7809. +CONFIG_KCORE_ELF=y
  7810. +# CONFIG_KCORE_AOUT is not set
  7811. +# CONFIG_BINFMT_AOUT is not set
  7812. +CONFIG_BINFMT_ELF=y
  7813. +# CONFIG_MIPS32_COMPAT is not set
  7814. +# CONFIG_MIPS32_O32 is not set
  7815. +# CONFIG_MIPS32_N32 is not set
  7816. +# CONFIG_BINFMT_ELF32 is not set
  7817. +# CONFIG_BINFMT_MISC is not set
  7818. +# CONFIG_OOM_KILLER is not set
  7819. +CONFIG_CMDLINE_BOOL=y
  7820. +CONFIG_CMDLINE="mem=96M"
  7821. +# CONFIG_PM is not set
  7822. +
  7823. +#
  7824. +# Memory Technology Devices (MTD)
  7825. +#
  7826. +# CONFIG_MTD is not set
  7827. +
  7828. +#
  7829. +# Parallel port support
  7830. +#
  7831. +# CONFIG_PARPORT is not set
  7832. +
  7833. +#
  7834. +# Plug and Play configuration
  7835. +#
  7836. +# CONFIG_PNP is not set
  7837. +# CONFIG_ISAPNP is not set
  7838. +
  7839. +#
  7840. +# Block devices
  7841. +#
  7842. +# CONFIG_BLK_DEV_FD is not set
  7843. +# CONFIG_BLK_DEV_XD is not set
  7844. +# CONFIG_PARIDE is not set
  7845. +# CONFIG_BLK_CPQ_DA is not set
  7846. +# CONFIG_BLK_CPQ_CISS_DA is not set
  7847. +# CONFIG_CISS_SCSI_TAPE is not set
  7848. +# CONFIG_CISS_MONITOR_THREAD is not set
  7849. +# CONFIG_BLK_DEV_DAC960 is not set
  7850. +# CONFIG_BLK_DEV_UMEM is not set
  7851. +# CONFIG_BLK_DEV_SX8 is not set
  7852. +CONFIG_BLK_DEV_LOOP=y
  7853. +# CONFIG_BLK_DEV_NBD is not set
  7854. +# CONFIG_BLK_DEV_RAM is not set
  7855. +# CONFIG_BLK_DEV_INITRD is not set
  7856. +# CONFIG_BLK_STATS is not set
  7857. +
  7858. +#
  7859. +# Multi-device support (RAID and LVM)
  7860. +#
  7861. +# CONFIG_MD is not set
  7862. +# CONFIG_BLK_DEV_MD is not set
  7863. +# CONFIG_MD_LINEAR is not set
  7864. +# CONFIG_MD_RAID0 is not set
  7865. +# CONFIG_MD_RAID1 is not set
  7866. +# CONFIG_MD_RAID5 is not set
  7867. +# CONFIG_MD_MULTIPATH is not set
  7868. +# CONFIG_BLK_DEV_LVM is not set
  7869. +
  7870. +#
  7871. +# Networking options
  7872. +#
  7873. +CONFIG_PACKET=y
  7874. +# CONFIG_PACKET_MMAP is not set
  7875. +# CONFIG_NETLINK_DEV is not set
  7876. +CONFIG_NETFILTER=y
  7877. +# CONFIG_NETFILTER_DEBUG is not set
  7878. +CONFIG_FILTER=y
  7879. +CONFIG_UNIX=y
  7880. +CONFIG_INET=y
  7881. +CONFIG_IP_MULTICAST=y
  7882. +# CONFIG_IP_ADVANCED_ROUTER is not set
  7883. +CONFIG_IP_PNP=y
  7884. +# CONFIG_IP_PNP_DHCP is not set
  7885. +CONFIG_IP_PNP_BOOTP=y
  7886. +# CONFIG_IP_PNP_RARP is not set
  7887. +# CONFIG_NET_IPIP is not set
  7888. +# CONFIG_NET_IPGRE is not set
  7889. +# CONFIG_IP_MROUTE is not set
  7890. +# CONFIG_ARPD is not set
  7891. +# CONFIG_INET_ECN is not set
  7892. +# CONFIG_SYN_COOKIES is not set
  7893. +
  7894. +#
  7895. +# IP: Netfilter Configuration
  7896. +#
  7897. +# CONFIG_IP_NF_CONNTRACK is not set
  7898. +# CONFIG_IP_NF_QUEUE is not set
  7899. +# CONFIG_IP_NF_IPTABLES is not set
  7900. +# CONFIG_IP_NF_ARPTABLES is not set
  7901. +# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
  7902. +# CONFIG_IP_NF_COMPAT_IPFWADM is not set
  7903. +
  7904. +#
  7905. +# IP: Virtual Server Configuration
  7906. +#
  7907. +# CONFIG_IP_VS is not set
  7908. +# CONFIG_IPV6 is not set
  7909. +# CONFIG_KHTTPD is not set
  7910. +
  7911. +#
  7912. +# SCTP Configuration (EXPERIMENTAL)
  7913. +#
  7914. +# CONFIG_IP_SCTP is not set
  7915. +# CONFIG_ATM is not set
  7916. +# CONFIG_VLAN_8021Q is not set
  7917. +
  7918. +#
  7919. +#
  7920. +#
  7921. +# CONFIG_IPX is not set
  7922. +# CONFIG_ATALK is not set
  7923. +# CONFIG_DECNET is not set
  7924. +# CONFIG_BRIDGE is not set
  7925. +# CONFIG_X25 is not set
  7926. +# CONFIG_LAPB is not set
  7927. +# CONFIG_LLC is not set
  7928. +# CONFIG_NET_DIVERT is not set
  7929. +# CONFIG_ECONET is not set
  7930. +# CONFIG_WAN_ROUTER is not set
  7931. +# CONFIG_NET_FASTROUTE is not set
  7932. +# CONFIG_NET_HW_FLOWCONTROL is not set
  7933. +
  7934. +#
  7935. +# QoS and/or fair queueing
  7936. +#
  7937. +# CONFIG_NET_SCHED is not set
  7938. +
  7939. +#
  7940. +# Network testing
  7941. +#
  7942. +# CONFIG_NET_PKTGEN is not set
  7943. +
  7944. +#
  7945. +# Telephony Support
  7946. +#
  7947. +# CONFIG_PHONE is not set
  7948. +# CONFIG_PHONE_IXJ is not set
  7949. +# CONFIG_PHONE_IXJ_PCMCIA is not set
  7950. +
  7951. +#
  7952. +# ATA/IDE/MFM/RLL support
  7953. +#
  7954. +CONFIG_IDE=y
  7955. +
  7956. +#
  7957. +# IDE, ATA and ATAPI Block devices
  7958. +#
  7959. +CONFIG_BLK_DEV_IDE=y
  7960. +
  7961. +#
  7962. +# Please see Documentation/ide.txt for help/info on IDE drives
  7963. +#
  7964. +# CONFIG_BLK_DEV_HD_IDE is not set
  7965. +# CONFIG_BLK_DEV_HD is not set
  7966. +# CONFIG_BLK_DEV_IDE_SATA is not set
  7967. +CONFIG_BLK_DEV_IDEDISK=y
  7968. +CONFIG_IDEDISK_MULTI_MODE=y
  7969. +CONFIG_IDEDISK_STROKE=y
  7970. +CONFIG_BLK_DEV_IDECS=m
  7971. +# CONFIG_BLK_DEV_DELKIN is not set
  7972. +# CONFIG_BLK_DEV_IDECD is not set
  7973. +# CONFIG_BLK_DEV_IDETAPE is not set
  7974. +# CONFIG_BLK_DEV_IDEFLOPPY is not set
  7975. +# CONFIG_BLK_DEV_IDESCSI is not set
  7976. +# CONFIG_IDE_TASK_IOCTL is not set
  7977. +
  7978. +#
  7979. +# IDE chipset support/bugfixes
  7980. +#
  7981. +# CONFIG_BLK_DEV_CMD640 is not set
  7982. +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
  7983. +# CONFIG_BLK_DEV_ISAPNP is not set
  7984. +# CONFIG_BLK_DEV_IDEPCI is not set
  7985. +# CONFIG_IDE_CHIPSETS is not set
  7986. +# CONFIG_IDEDMA_AUTO is not set
  7987. +# CONFIG_DMA_NONPCI is not set
  7988. +# CONFIG_BLK_DEV_ATARAID is not set
  7989. +# CONFIG_BLK_DEV_ATARAID_PDC is not set
  7990. +# CONFIG_BLK_DEV_ATARAID_HPT is not set
  7991. +# CONFIG_BLK_DEV_ATARAID_MEDLEY is not set
  7992. +# CONFIG_BLK_DEV_ATARAID_SII is not set
  7993. +
  7994. +#
  7995. +# SCSI support
  7996. +#
  7997. +CONFIG_SCSI=y
  7998. +
  7999. +#
  8000. +# SCSI support type (disk, tape, CD-ROM)
  8001. +#
  8002. +CONFIG_BLK_DEV_SD=y
  8003. +CONFIG_SD_EXTRA_DEVS=40
  8004. +CONFIG_CHR_DEV_ST=y
  8005. +# CONFIG_CHR_DEV_OSST is not set
  8006. +CONFIG_BLK_DEV_SR=y
  8007. +# CONFIG_BLK_DEV_SR_VENDOR is not set
  8008. +CONFIG_SR_EXTRA_DEVS=2
  8009. +# CONFIG_CHR_DEV_SG is not set
  8010. +
  8011. +#
  8012. +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
  8013. +#
  8014. +# CONFIG_SCSI_DEBUG_QUEUES is not set
  8015. +# CONFIG_SCSI_MULTI_LUN is not set
  8016. +CONFIG_SCSI_CONSTANTS=y
  8017. +# CONFIG_SCSI_LOGGING is not set
  8018. +
  8019. +#
  8020. +# SCSI low-level drivers
  8021. +#
  8022. +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
  8023. +# CONFIG_SCSI_7000FASST is not set
  8024. +# CONFIG_SCSI_ACARD is not set
  8025. +# CONFIG_SCSI_AHA152X is not set
  8026. +# CONFIG_SCSI_AHA1542 is not set
  8027. +# CONFIG_SCSI_AHA1740 is not set
  8028. +# CONFIG_SCSI_AACRAID is not set
  8029. +# CONFIG_SCSI_AIC7XXX is not set
  8030. +# CONFIG_SCSI_AIC79XX is not set
  8031. +# CONFIG_SCSI_AIC7XXX_OLD is not set
  8032. +# CONFIG_SCSI_DPT_I2O is not set
  8033. +# CONFIG_SCSI_ADVANSYS is not set
  8034. +# CONFIG_SCSI_IN2000 is not set
  8035. +# CONFIG_SCSI_AM53C974 is not set
  8036. +# CONFIG_SCSI_MEGARAID is not set
  8037. +# CONFIG_SCSI_MEGARAID2 is not set
  8038. +# CONFIG_SCSI_SATA is not set
  8039. +# CONFIG_SCSI_SATA_AHCI is not set
  8040. +# CONFIG_SCSI_SATA_SVW is not set
  8041. +# CONFIG_SCSI_ATA_PIIX is not set
  8042. +# CONFIG_SCSI_SATA_NV is not set
  8043. +# CONFIG_SCSI_SATA_QSTOR is not set
  8044. +# CONFIG_SCSI_SATA_PROMISE is not set
  8045. +# CONFIG_SCSI_SATA_SX4 is not set
  8046. +# CONFIG_SCSI_SATA_SIL is not set
  8047. +# CONFIG_SCSI_SATA_SIS is not set
  8048. +# CONFIG_SCSI_SATA_ULI is not set
  8049. +# CONFIG_SCSI_SATA_VIA is not set
  8050. +# CONFIG_SCSI_SATA_VITESSE is not set
  8051. +# CONFIG_SCSI_BUSLOGIC is not set
  8052. +# CONFIG_SCSI_CPQFCTS is not set
  8053. +# CONFIG_SCSI_DMX3191D is not set
  8054. +# CONFIG_SCSI_DTC3280 is not set
  8055. +# CONFIG_SCSI_EATA is not set
  8056. +# CONFIG_SCSI_EATA_DMA is not set
  8057. +# CONFIG_SCSI_EATA_PIO is not set
  8058. +# CONFIG_SCSI_FUTURE_DOMAIN is not set
  8059. +# CONFIG_SCSI_GDTH is not set
  8060. +# CONFIG_SCSI_GENERIC_NCR5380 is not set
  8061. +# CONFIG_SCSI_INITIO is not set
  8062. +# CONFIG_SCSI_INIA100 is not set
  8063. +# CONFIG_SCSI_NCR53C406A is not set
  8064. +# CONFIG_SCSI_NCR53C7xx is not set
  8065. +# CONFIG_SCSI_SYM53C8XX_2 is not set
  8066. +# CONFIG_SCSI_NCR53C8XX is not set
  8067. +# CONFIG_SCSI_SYM53C8XX is not set
  8068. +# CONFIG_SCSI_PAS16 is not set
  8069. +# CONFIG_SCSI_PCI2000 is not set
  8070. +# CONFIG_SCSI_PCI2220I is not set
  8071. +# CONFIG_SCSI_PSI240I is not set
  8072. +# CONFIG_SCSI_QLOGIC_FAS is not set
  8073. +# CONFIG_SCSI_QLOGIC_ISP is not set
  8074. +# CONFIG_SCSI_QLOGIC_FC is not set
  8075. +# CONFIG_SCSI_QLOGIC_1280 is not set
  8076. +# CONFIG_SCSI_SIM710 is not set
  8077. +# CONFIG_SCSI_SYM53C416 is not set
  8078. +# CONFIG_SCSI_DC390T is not set
  8079. +# CONFIG_SCSI_T128 is not set
  8080. +# CONFIG_SCSI_U14_34F is not set
  8081. +# CONFIG_SCSI_NSP32 is not set
  8082. +# CONFIG_SCSI_DEBUG is not set
  8083. +
  8084. +#
  8085. +# PCMCIA SCSI adapter support
  8086. +#
  8087. +# CONFIG_SCSI_PCMCIA is not set
  8088. +
  8089. +#
  8090. +# Fusion MPT device support
  8091. +#
  8092. +# CONFIG_FUSION is not set
  8093. +# CONFIG_FUSION_BOOT is not set
  8094. +# CONFIG_FUSION_ISENSE is not set
  8095. +# CONFIG_FUSION_CTL is not set
  8096. +# CONFIG_FUSION_LAN is not set
  8097. +
  8098. +#
  8099. +# IEEE 1394 (FireWire) support (EXPERIMENTAL)
  8100. +#
  8101. +# CONFIG_IEEE1394 is not set
  8102. +
  8103. +#
  8104. +# I2O device support
  8105. +#
  8106. +# CONFIG_I2O is not set
  8107. +# CONFIG_I2O_PCI is not set
  8108. +# CONFIG_I2O_BLOCK is not set
  8109. +# CONFIG_I2O_LAN is not set
  8110. +# CONFIG_I2O_SCSI is not set
  8111. +# CONFIG_I2O_PROC is not set
  8112. +
  8113. +#
  8114. +# Network device support
  8115. +#
  8116. +CONFIG_NETDEVICES=y
  8117. +
  8118. +#
  8119. +# ARCnet devices
  8120. +#
  8121. +# CONFIG_ARCNET is not set
  8122. +# CONFIG_DUMMY is not set
  8123. +# CONFIG_BONDING is not set
  8124. +# CONFIG_EQUALIZER is not set
  8125. +# CONFIG_TUN is not set
  8126. +# CONFIG_ETHERTAP is not set
  8127. +
  8128. +#
  8129. +# Ethernet (10 or 100Mbit)
  8130. +#
  8131. +CONFIG_NET_ETHERNET=y
  8132. +# CONFIG_MIPS_AU1X00_ENET is not set
  8133. +# CONFIG_SUNLANCE is not set
  8134. +# CONFIG_HAPPYMEAL is not set
  8135. +# CONFIG_SUNBMAC is not set
  8136. +# CONFIG_SUNQE is not set
  8137. +# CONFIG_SUNGEM is not set
  8138. +# CONFIG_NET_VENDOR_3COM is not set
  8139. +# CONFIG_LANCE is not set
  8140. +# CONFIG_NET_VENDOR_SMC is not set
  8141. +# CONFIG_NET_VENDOR_RACAL is not set
  8142. +# CONFIG_HP100 is not set
  8143. +# CONFIG_NET_ISA is not set
  8144. +# CONFIG_NET_PCI is not set
  8145. +# CONFIG_NET_POCKET is not set
  8146. +
  8147. +#
  8148. +# Ethernet (1000 Mbit)
  8149. +#
  8150. +# CONFIG_ACENIC is not set
  8151. +# CONFIG_DL2K is not set
  8152. +# CONFIG_E1000 is not set
  8153. +# CONFIG_MYRI_SBUS is not set
  8154. +# CONFIG_NS83820 is not set
  8155. +# CONFIG_HAMACHI is not set
  8156. +# CONFIG_YELLOWFIN is not set
  8157. +# CONFIG_R8169 is not set
  8158. +# CONFIG_SK98LIN is not set
  8159. +# CONFIG_TIGON3 is not set
  8160. +# CONFIG_FDDI is not set
  8161. +# CONFIG_HIPPI is not set
  8162. +# CONFIG_PLIP is not set
  8163. +CONFIG_PPP=m
  8164. +CONFIG_PPP_MULTILINK=y
  8165. +# CONFIG_PPP_FILTER is not set
  8166. +CONFIG_PPP_ASYNC=m
  8167. +# CONFIG_PPP_SYNC_TTY is not set
  8168. +CONFIG_PPP_DEFLATE=m
  8169. +# CONFIG_PPP_BSDCOMP is not set
  8170. +CONFIG_PPPOE=m
  8171. +# CONFIG_SLIP is not set
  8172. +
  8173. +#
  8174. +# Wireless LAN (non-hamradio)
  8175. +#
  8176. +# CONFIG_NET_RADIO is not set
  8177. +
  8178. +#
  8179. +# Token Ring devices
  8180. +#
  8181. +# CONFIG_TR is not set
  8182. +# CONFIG_NET_FC is not set
  8183. +# CONFIG_RCPCI is not set
  8184. +# CONFIG_SHAPER is not set
  8185. +
  8186. +#
  8187. +# Wan interfaces
  8188. +#
  8189. +# CONFIG_WAN is not set
  8190. +
  8191. +#
  8192. +# PCMCIA network device support
  8193. +#
  8194. +# CONFIG_NET_PCMCIA is not set
  8195. +
  8196. +#
  8197. +# Amateur Radio support
  8198. +#
  8199. +# CONFIG_HAMRADIO is not set
  8200. +
  8201. +#
  8202. +# IrDA (infrared) support
  8203. +#
  8204. +# CONFIG_IRDA is not set
  8205. +
  8206. +#
  8207. +# ISDN subsystem
  8208. +#
  8209. +# CONFIG_ISDN is not set
  8210. +
  8211. +#
  8212. +# Input core support
  8213. +#
  8214. +CONFIG_INPUT=y
  8215. +CONFIG_INPUT_KEYBDEV=y
  8216. +CONFIG_INPUT_MOUSEDEV=y
  8217. +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
  8218. +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
  8219. +# CONFIG_INPUT_JOYDEV is not set
  8220. +CONFIG_INPUT_EVDEV=y
  8221. +# CONFIG_INPUT_UINPUT is not set
  8222. +
  8223. +#
  8224. +# Character devices
  8225. +#
  8226. +CONFIG_VT=y
  8227. +# CONFIG_VT_CONSOLE is not set
  8228. +# CONFIG_SERIAL is not set
  8229. +# CONFIG_SERIAL_EXTENDED is not set
  8230. +CONFIG_SERIAL_NONSTANDARD=y
  8231. +# CONFIG_COMPUTONE is not set
  8232. +# CONFIG_ROCKETPORT is not set
  8233. +# CONFIG_CYCLADES is not set
  8234. +# CONFIG_DIGIEPCA is not set
  8235. +# CONFIG_DIGI is not set
  8236. +# CONFIG_ESPSERIAL is not set
  8237. +# CONFIG_MOXA_INTELLIO is not set
  8238. +# CONFIG_MOXA_SMARTIO is not set
  8239. +# CONFIG_ISI is not set
  8240. +# CONFIG_SYNCLINK is not set
  8241. +# CONFIG_SYNCLINKMP is not set
  8242. +# CONFIG_N_HDLC is not set
  8243. +# CONFIG_RISCOM8 is not set
  8244. +# CONFIG_SPECIALIX is not set
  8245. +# CONFIG_SX is not set
  8246. +# CONFIG_RIO is not set
  8247. +# CONFIG_STALDRV is not set
  8248. +# CONFIG_SERIAL_TX3912 is not set
  8249. +# CONFIG_SERIAL_TX3912_CONSOLE is not set
  8250. +# CONFIG_SERIAL_TXX9 is not set
  8251. +# CONFIG_SERIAL_TXX9_CONSOLE is not set
  8252. +CONFIG_AU1X00_UART=y
  8253. +CONFIG_AU1X00_SERIAL_CONSOLE=y
  8254. +# CONFIG_AU1X00_USB_TTY is not set
  8255. +# CONFIG_AU1X00_USB_RAW is not set
  8256. +# CONFIG_TXX927_SERIAL is not set
  8257. +CONFIG_UNIX98_PTYS=y
  8258. +CONFIG_UNIX98_PTY_COUNT=256
  8259. +
  8260. +#
  8261. +# I2C support
  8262. +#
  8263. +CONFIG_I2C=y
  8264. +# CONFIG_I2C_ALGOBIT is not set
  8265. +# CONFIG_SCx200_ACB is not set
  8266. +# CONFIG_I2C_ALGOPCF is not set
  8267. +# CONFIG_I2C_CHARDEV is not set
  8268. +CONFIG_I2C_PROC=y
  8269. +
  8270. +#
  8271. +# Mice
  8272. +#
  8273. +# CONFIG_BUSMOUSE is not set
  8274. +# CONFIG_MOUSE is not set
  8275. +
  8276. +#
  8277. +# Joysticks
  8278. +#
  8279. +# CONFIG_INPUT_GAMEPORT is not set
  8280. +# CONFIG_INPUT_NS558 is not set
  8281. +# CONFIG_INPUT_LIGHTNING is not set
  8282. +# CONFIG_INPUT_PCIGAME is not set
  8283. +# CONFIG_INPUT_CS461X is not set
  8284. +# CONFIG_INPUT_EMU10K1 is not set
  8285. +# CONFIG_INPUT_SERIO is not set
  8286. +# CONFIG_INPUT_SERPORT is not set
  8287. +
  8288. +#
  8289. +# Joysticks
  8290. +#
  8291. +# CONFIG_INPUT_ANALOG is not set
  8292. +# CONFIG_INPUT_A3D is not set
  8293. +# CONFIG_INPUT_ADI is not set
  8294. +# CONFIG_INPUT_COBRA is not set
  8295. +# CONFIG_INPUT_GF2K is not set
  8296. +# CONFIG_INPUT_GRIP is not set
  8297. +# CONFIG_INPUT_INTERACT is not set
  8298. +# CONFIG_INPUT_TMDC is not set
  8299. +# CONFIG_INPUT_SIDEWINDER is not set
  8300. +# CONFIG_INPUT_IFORCE_USB is not set
  8301. +# CONFIG_INPUT_IFORCE_232 is not set
  8302. +# CONFIG_INPUT_WARRIOR is not set
  8303. +# CONFIG_INPUT_MAGELLAN is not set
  8304. +# CONFIG_INPUT_SPACEORB is not set
  8305. +# CONFIG_INPUT_SPACEBALL is not set
  8306. +# CONFIG_INPUT_STINGER is not set
  8307. +# CONFIG_INPUT_DB9 is not set
  8308. +# CONFIG_INPUT_GAMECON is not set
  8309. +# CONFIG_INPUT_TURBOGRAFX is not set
  8310. +# CONFIG_QIC02_TAPE is not set
  8311. +# CONFIG_IPMI_HANDLER is not set
  8312. +# CONFIG_IPMI_PANIC_EVENT is not set
  8313. +# CONFIG_IPMI_DEVICE_INTERFACE is not set
  8314. +# CONFIG_IPMI_KCS is not set
  8315. +# CONFIG_IPMI_WATCHDOG is not set
  8316. +
  8317. +#
  8318. +# Watchdog Cards
  8319. +#
  8320. +# CONFIG_WATCHDOG is not set
  8321. +# CONFIG_SCx200 is not set
  8322. +# CONFIG_SCx200_GPIO is not set
  8323. +# CONFIG_AMD_PM768 is not set
  8324. +# CONFIG_NVRAM is not set
  8325. +# CONFIG_RTC is not set
  8326. +# CONFIG_DTLK is not set
  8327. +# CONFIG_R3964 is not set
  8328. +# CONFIG_APPLICOM is not set
  8329. +
  8330. +#
  8331. +# Ftape, the floppy tape device driver
  8332. +#
  8333. +# CONFIG_FTAPE is not set
  8334. +# CONFIG_AGP is not set
  8335. +
  8336. +#
  8337. +# Direct Rendering Manager (XFree86 DRI support)
  8338. +#
  8339. +# CONFIG_DRM is not set
  8340. +
  8341. +#
  8342. +# PCMCIA character devices
  8343. +#
  8344. +# CONFIG_PCMCIA_SERIAL_CS is not set
  8345. +# CONFIG_SYNCLINK_CS is not set
  8346. +# CONFIG_AU1X00_GPIO is not set
  8347. +# CONFIG_TS_AU1X00_ADS7846 is not set
  8348. +
  8349. +#
  8350. +# File systems
  8351. +#
  8352. +# CONFIG_QUOTA is not set
  8353. +# CONFIG_QFMT_V2 is not set
  8354. +CONFIG_AUTOFS_FS=y
  8355. +# CONFIG_AUTOFS4_FS is not set
  8356. +# CONFIG_REISERFS_FS is not set
  8357. +# CONFIG_REISERFS_CHECK is not set
  8358. +# CONFIG_REISERFS_PROC_INFO is not set
  8359. +# CONFIG_ADFS_FS is not set
  8360. +# CONFIG_ADFS_FS_RW is not set
  8361. +# CONFIG_AFFS_FS is not set
  8362. +# CONFIG_HFS_FS is not set
  8363. +# CONFIG_HFSPLUS_FS is not set
  8364. +# CONFIG_BEFS_FS is not set
  8365. +# CONFIG_BEFS_DEBUG is not set
  8366. +# CONFIG_BFS_FS is not set
  8367. +CONFIG_EXT3_FS=y
  8368. +CONFIG_JBD=y
  8369. +# CONFIG_JBD_DEBUG is not set
  8370. +CONFIG_FAT_FS=y
  8371. +CONFIG_MSDOS_FS=y
  8372. +# CONFIG_UMSDOS_FS is not set
  8373. +CONFIG_VFAT_FS=y
  8374. +# CONFIG_EFS_FS is not set
  8375. +# CONFIG_JFFS_FS is not set
  8376. +# CONFIG_JFFS2_FS is not set
  8377. +# CONFIG_CRAMFS is not set
  8378. +CONFIG_TMPFS=y
  8379. +CONFIG_RAMFS=y
  8380. +# CONFIG_ISO9660_FS is not set
  8381. +# CONFIG_JOLIET is not set
  8382. +# CONFIG_ZISOFS is not set
  8383. +# CONFIG_JFS_FS is not set
  8384. +# CONFIG_JFS_DEBUG is not set
  8385. +# CONFIG_JFS_STATISTICS is not set
  8386. +# CONFIG_MINIX_FS is not set
  8387. +# CONFIG_VXFS_FS is not set
  8388. +# CONFIG_NTFS_FS is not set
  8389. +# CONFIG_NTFS_RW is not set
  8390. +# CONFIG_HPFS_FS is not set
  8391. +CONFIG_PROC_FS=y
  8392. +# CONFIG_DEVFS_FS is not set
  8393. +# CONFIG_DEVFS_MOUNT is not set
  8394. +# CONFIG_DEVFS_DEBUG is not set
  8395. +CONFIG_DEVPTS_FS=y
  8396. +# CONFIG_QNX4FS_FS is not set
  8397. +# CONFIG_QNX4FS_RW is not set
  8398. +# CONFIG_ROMFS_FS is not set
  8399. +CONFIG_EXT2_FS=y
  8400. +# CONFIG_SYSV_FS is not set
  8401. +# CONFIG_UDF_FS is not set
  8402. +# CONFIG_UDF_RW is not set
  8403. +# CONFIG_UFS_FS is not set
  8404. +# CONFIG_UFS_FS_WRITE is not set
  8405. +# CONFIG_XFS_FS is not set
  8406. +# CONFIG_XFS_QUOTA is not set
  8407. +# CONFIG_XFS_RT is not set
  8408. +# CONFIG_XFS_TRACE is not set
  8409. +# CONFIG_XFS_DEBUG is not set
  8410. +
  8411. +#
  8412. +# Network File Systems
  8413. +#
  8414. +# CONFIG_CODA_FS is not set
  8415. +# CONFIG_INTERMEZZO_FS is not set
  8416. +CONFIG_NFS_FS=y
  8417. +CONFIG_NFS_V3=y
  8418. +# CONFIG_NFS_DIRECTIO is not set
  8419. +CONFIG_ROOT_NFS=y
  8420. +# CONFIG_NFSD is not set
  8421. +# CONFIG_NFSD_V3 is not set
  8422. +# CONFIG_NFSD_TCP is not set
  8423. +CONFIG_SUNRPC=y
  8424. +CONFIG_LOCKD=y
  8425. +CONFIG_LOCKD_V4=y
  8426. +# CONFIG_SMB_FS is not set
  8427. +# CONFIG_NCP_FS is not set
  8428. +# CONFIG_NCPFS_PACKET_SIGNING is not set
  8429. +# CONFIG_NCPFS_IOCTL_LOCKING is not set
  8430. +# CONFIG_NCPFS_STRONG is not set
  8431. +# CONFIG_NCPFS_NFS_NS is not set
  8432. +# CONFIG_NCPFS_OS2_NS is not set
  8433. +# CONFIG_NCPFS_SMALLDOS is not set
  8434. +# CONFIG_NCPFS_NLS is not set
  8435. +# CONFIG_NCPFS_EXTRAS is not set
  8436. +# CONFIG_ZISOFS_FS is not set
  8437. +
  8438. +#
  8439. +# Partition Types
  8440. +#
  8441. +# CONFIG_PARTITION_ADVANCED is not set
  8442. +CONFIG_MSDOS_PARTITION=y
  8443. +# CONFIG_SMB_NLS is not set
  8444. +CONFIG_NLS=y
  8445. +
  8446. +#
  8447. +# Native Language Support
  8448. +#
  8449. +CONFIG_NLS_DEFAULT="iso8859-1"
  8450. +# CONFIG_NLS_CODEPAGE_437 is not set
  8451. +# CONFIG_NLS_CODEPAGE_737 is not set
  8452. +# CONFIG_NLS_CODEPAGE_775 is not set
  8453. +# CONFIG_NLS_CODEPAGE_850 is not set
  8454. +# CONFIG_NLS_CODEPAGE_852 is not set
  8455. +# CONFIG_NLS_CODEPAGE_855 is not set
  8456. +# CONFIG_NLS_CODEPAGE_857 is not set
  8457. +# CONFIG_NLS_CODEPAGE_860 is not set
  8458. +# CONFIG_NLS_CODEPAGE_861 is not set
  8459. +# CONFIG_NLS_CODEPAGE_862 is not set
  8460. +# CONFIG_NLS_CODEPAGE_863 is not set
  8461. +# CONFIG_NLS_CODEPAGE_864 is not set
  8462. +# CONFIG_NLS_CODEPAGE_865 is not set
  8463. +# CONFIG_NLS_CODEPAGE_866 is not set
  8464. +# CONFIG_NLS_CODEPAGE_869 is not set
  8465. +# CONFIG_NLS_CODEPAGE_936 is not set
  8466. +# CONFIG_NLS_CODEPAGE_950 is not set
  8467. +# CONFIG_NLS_CODEPAGE_932 is not set
  8468. +# CONFIG_NLS_CODEPAGE_949 is not set
  8469. +# CONFIG_NLS_CODEPAGE_874 is not set
  8470. +# CONFIG_NLS_ISO8859_8 is not set
  8471. +# CONFIG_NLS_CODEPAGE_1250 is not set
  8472. +# CONFIG_NLS_CODEPAGE_1251 is not set
  8473. +# CONFIG_NLS_ISO8859_1 is not set
  8474. +# CONFIG_NLS_ISO8859_2 is not set
  8475. +# CONFIG_NLS_ISO8859_3 is not set
  8476. +# CONFIG_NLS_ISO8859_4 is not set
  8477. +# CONFIG_NLS_ISO8859_5 is not set
  8478. +# CONFIG_NLS_ISO8859_6 is not set
  8479. +# CONFIG_NLS_ISO8859_7 is not set
  8480. +# CONFIG_NLS_ISO8859_9 is not set
  8481. +# CONFIG_NLS_ISO8859_13 is not set
  8482. +# CONFIG_NLS_ISO8859_14 is not set
  8483. +# CONFIG_NLS_ISO8859_15 is not set
  8484. +# CONFIG_NLS_KOI8_R is not set
  8485. +# CONFIG_NLS_KOI8_U is not set
  8486. +# CONFIG_NLS_UTF8 is not set
  8487. +
  8488. +#
  8489. +# Multimedia devices
  8490. +#
  8491. +# CONFIG_VIDEO_DEV is not set
  8492. +
  8493. +#
  8494. +# Console drivers
  8495. +#
  8496. +# CONFIG_VGA_CONSOLE is not set
  8497. +# CONFIG_MDA_CONSOLE is not set
  8498. +
  8499. +#
  8500. +# Frame-buffer support
  8501. +#
  8502. +CONFIG_FB=y
  8503. +CONFIG_DUMMY_CONSOLE=y
  8504. +# CONFIG_FB_RIVA is not set
  8505. +# CONFIG_FB_CLGEN is not set
  8506. +# CONFIG_FB_PM2 is not set
  8507. +# CONFIG_FB_PM3 is not set
  8508. +# CONFIG_FB_CYBER2000 is not set
  8509. +# CONFIG_FB_MATROX is not set
  8510. +# CONFIG_FB_ATY is not set
  8511. +# CONFIG_FB_RADEON is not set
  8512. +# CONFIG_FB_ATY128 is not set
  8513. +# CONFIG_FB_INTEL is not set
  8514. +# CONFIG_FB_SIS is not set
  8515. +# CONFIG_FB_NEOMAGIC is not set
  8516. +# CONFIG_FB_3DFX is not set
  8517. +# CONFIG_FB_VOODOO1 is not set
  8518. +# CONFIG_FB_TRIDENT is not set
  8519. +# CONFIG_FB_E1356 is not set
  8520. +# CONFIG_FB_IT8181 is not set
  8521. +# CONFIG_FB_VIRTUAL is not set
  8522. +CONFIG_FBCON_ADVANCED=y
  8523. +# CONFIG_FBCON_MFB is not set
  8524. +# CONFIG_FBCON_CFB2 is not set
  8525. +# CONFIG_FBCON_CFB4 is not set
  8526. +# CONFIG_FBCON_CFB8 is not set
  8527. +CONFIG_FBCON_CFB16=y
  8528. +# CONFIG_FBCON_CFB24 is not set
  8529. +CONFIG_FBCON_CFB32=y
  8530. +# CONFIG_FBCON_AFB is not set
  8531. +# CONFIG_FBCON_ILBM is not set
  8532. +# CONFIG_FBCON_IPLAN2P2 is not set
  8533. +# CONFIG_FBCON_IPLAN2P4 is not set
  8534. +# CONFIG_FBCON_IPLAN2P8 is not set
  8535. +# CONFIG_FBCON_MAC is not set
  8536. +# CONFIG_FBCON_VGA_PLANES is not set
  8537. +# CONFIG_FBCON_VGA is not set
  8538. +# CONFIG_FBCON_HGA is not set
  8539. +# CONFIG_FBCON_FONTWIDTH8_ONLY is not set
  8540. +CONFIG_FBCON_FONTS=y
  8541. +CONFIG_FONT_8x8=y
  8542. +CONFIG_FONT_8x16=y
  8543. +# CONFIG_FONT_SUN8x16 is not set
  8544. +# CONFIG_FONT_SUN12x22 is not set
  8545. +# CONFIG_FONT_6x11 is not set
  8546. +# CONFIG_FONT_PEARL_8x8 is not set
  8547. +# CONFIG_FONT_ACORN_8x8 is not set
  8548. +
  8549. +#
  8550. +# Sound
  8551. +#
  8552. +CONFIG_SOUND=y
  8553. +# CONFIG_SOUND_ALI5455 is not set
  8554. +# CONFIG_SOUND_BT878 is not set
  8555. +# CONFIG_SOUND_CMPCI is not set
  8556. +# CONFIG_SOUND_EMU10K1 is not set
  8557. +# CONFIG_MIDI_EMU10K1 is not set
  8558. +# CONFIG_SOUND_FUSION is not set
  8559. +# CONFIG_SOUND_CS4281 is not set
  8560. +# CONFIG_SOUND_ES1370 is not set
  8561. +# CONFIG_SOUND_ES1371 is not set
  8562. +# CONFIG_SOUND_ESSSOLO1 is not set
  8563. +# CONFIG_SOUND_MAESTRO is not set
  8564. +# CONFIG_SOUND_MAESTRO3 is not set
  8565. +# CONFIG_SOUND_FORTE is not set
  8566. +# CONFIG_SOUND_ICH is not set
  8567. +# CONFIG_SOUND_RME96XX is not set
  8568. +# CONFIG_SOUND_SONICVIBES is not set
  8569. +# CONFIG_SOUND_AU1X00 is not set
  8570. +CONFIG_SOUND_AU1550_PSC=y
  8571. +# CONFIG_SOUND_AU1550_I2S is not set
  8572. +# CONFIG_SOUND_TRIDENT is not set
  8573. +# CONFIG_SOUND_MSNDCLAS is not set
  8574. +# CONFIG_SOUND_MSNDPIN is not set
  8575. +# CONFIG_SOUND_VIA82CXXX is not set
  8576. +# CONFIG_MIDI_VIA82CXXX is not set
  8577. +# CONFIG_SOUND_OSS is not set
  8578. +# CONFIG_SOUND_TVMIXER is not set
  8579. +# CONFIG_SOUND_AD1980 is not set
  8580. +# CONFIG_SOUND_WM97XX is not set
  8581. +
  8582. +#
  8583. +# USB support
  8584. +#
  8585. +CONFIG_USB=y
  8586. +# CONFIG_USB_DEBUG is not set
  8587. +
  8588. +#
  8589. +# Miscellaneous USB options
  8590. +#
  8591. +CONFIG_USB_DEVICEFS=y
  8592. +# CONFIG_USB_BANDWIDTH is not set
  8593. +
  8594. +#
  8595. +# USB Host Controller Drivers
  8596. +#
  8597. +# CONFIG_USB_EHCI_HCD is not set
  8598. +# CONFIG_USB_UHCI is not set
  8599. +# CONFIG_USB_UHCI_ALT is not set
  8600. +CONFIG_USB_OHCI=y
  8601. +
  8602. +#
  8603. +# USB Device Class drivers
  8604. +#
  8605. +# CONFIG_USB_AUDIO is not set
  8606. +# CONFIG_USB_EMI26 is not set
  8607. +# CONFIG_USB_BLUETOOTH is not set
  8608. +# CONFIG_USB_MIDI is not set
  8609. +CONFIG_USB_STORAGE=y
  8610. +# CONFIG_USB_STORAGE_DEBUG is not set
  8611. +# CONFIG_USB_STORAGE_DATAFAB is not set
  8612. +# CONFIG_USB_STORAGE_FREECOM is not set
  8613. +# CONFIG_USB_STORAGE_ISD200 is not set
  8614. +# CONFIG_USB_STORAGE_DPCM is not set
  8615. +# CONFIG_USB_STORAGE_HP8200e is not set
  8616. +# CONFIG_USB_STORAGE_SDDR09 is not set
  8617. +# CONFIG_USB_STORAGE_SDDR55 is not set
  8618. +# CONFIG_USB_STORAGE_JUMPSHOT is not set
  8619. +# CONFIG_USB_ACM is not set
  8620. +# CONFIG_USB_PRINTER is not set
  8621. +
  8622. +#
  8623. +# USB Human Interface Devices (HID)
  8624. +#
  8625. +CONFIG_USB_HID=y
  8626. +CONFIG_USB_HIDINPUT=y
  8627. +CONFIG_USB_HIDDEV=y
  8628. +# CONFIG_USB_AIPTEK is not set
  8629. +# CONFIG_USB_WACOM is not set
  8630. +# CONFIG_USB_KBTAB is not set
  8631. +# CONFIG_USB_POWERMATE is not set
  8632. +
  8633. +#
  8634. +# USB Imaging devices
  8635. +#
  8636. +# CONFIG_USB_DC2XX is not set
  8637. +# CONFIG_USB_MDC800 is not set
  8638. +# CONFIG_USB_SCANNER is not set
  8639. +# CONFIG_USB_MICROTEK is not set
  8640. +# CONFIG_USB_HPUSBSCSI is not set
  8641. +
  8642. +#
  8643. +# USB Multimedia devices
  8644. +#
  8645. +
  8646. +#
  8647. +# Video4Linux support is needed for USB Multimedia device support
  8648. +#
  8649. +
  8650. +#
  8651. +# USB Network adaptors
  8652. +#
  8653. +# CONFIG_USB_PEGASUS is not set
  8654. +# CONFIG_USB_RTL8150 is not set
  8655. +# CONFIG_USB_KAWETH is not set
  8656. +# CONFIG_USB_CATC is not set
  8657. +# CONFIG_USB_CDCETHER is not set
  8658. +# CONFIG_USB_USBNET is not set
  8659. +
  8660. +#
  8661. +# USB port drivers
  8662. +#
  8663. +# CONFIG_USB_USS720 is not set
  8664. +
  8665. +#
  8666. +# USB Serial Converter support
  8667. +#
  8668. +# CONFIG_USB_SERIAL is not set
  8669. +
  8670. +#
  8671. +# USB Miscellaneous drivers
  8672. +#
  8673. +# CONFIG_USB_RIO500 is not set
  8674. +# CONFIG_USB_AUERSWALD is not set
  8675. +# CONFIG_USB_TIGL is not set
  8676. +# CONFIG_USB_BRLVGER is not set
  8677. +# CONFIG_USB_LCD is not set
  8678. +
  8679. +#
  8680. +# Support for USB gadgets
  8681. +#
  8682. +# CONFIG_USB_GADGET is not set
  8683. +
  8684. +#
  8685. +# Bluetooth support
  8686. +#
  8687. +# CONFIG_BLUEZ is not set
  8688. +
  8689. +#
  8690. +# Kernel hacking
  8691. +#
  8692. +CONFIG_CROSSCOMPILE=y
  8693. +# CONFIG_RUNTIME_DEBUG is not set
  8694. +# CONFIG_KGDB is not set
  8695. +# CONFIG_GDB_CONSOLE is not set
  8696. +# CONFIG_DEBUG_INFO is not set
  8697. +# CONFIG_MAGIC_SYSRQ is not set
  8698. +# CONFIG_MIPS_UNCACHED is not set
  8699. +CONFIG_LOG_BUF_SHIFT=0
  8700. +
  8701. +#
  8702. +# Cryptographic options
  8703. +#
  8704. +# CONFIG_CRYPTO is not set
  8705. +
  8706. +#
  8707. +# Library routines
  8708. +#
  8709. +# CONFIG_CRC32 is not set
  8710. +CONFIG_ZLIB_INFLATE=m
  8711. +CONFIG_ZLIB_DEFLATE=m
  8712. +# CONFIG_FW_LOADER is not set
  8713. --- a/arch/mips/defconfig-pb1500
  8714. +++ b/arch/mips/defconfig-pb1500
  8715. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  8716. # CONFIG_MIPS_PB1000 is not set
  8717. # CONFIG_MIPS_PB1100 is not set
  8718. CONFIG_MIPS_PB1500=y
  8719. -# CONFIG_MIPS_HYDROGEN3 is not set
  8720. # CONFIG_MIPS_PB1550 is not set
  8721. +# CONFIG_MIPS_HYDROGEN3 is not set
  8722. # CONFIG_MIPS_XXS1500 is not set
  8723. # CONFIG_MIPS_MTX1 is not set
  8724. # CONFIG_COGENT_CSB250 is not set
  8725. @@ -215,9 +215,7 @@ CONFIG_MTD_PB1500=y
  8726. # CONFIG_MTD_MTX1 is not set
  8727. CONFIG_MTD_PB1500_BOOT=y
  8728. # CONFIG_MTD_PB1500_USER is not set
  8729. -# CONFIG_MTD_DB1X00 is not set
  8730. # CONFIG_MTD_PB1550 is not set
  8731. -# CONFIG_MTD_HYDROGEN3 is not set
  8732. # CONFIG_MTD_MIRAGE is not set
  8733. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  8734. # CONFIG_MTD_OCELOT is not set
  8735. @@ -236,7 +234,6 @@ CONFIG_MTD_PB1500_BOOT=y
  8736. #
  8737. # Disk-On-Chip Device Drivers
  8738. #
  8739. -# CONFIG_MTD_DOC1000 is not set
  8740. # CONFIG_MTD_DOC2000 is not set
  8741. # CONFIG_MTD_DOC2001 is not set
  8742. # CONFIG_MTD_DOCPROBE is not set
  8743. @@ -341,11 +338,6 @@ CONFIG_IP_PNP_BOOTP=y
  8744. #
  8745. # CONFIG_IPX is not set
  8746. # CONFIG_ATALK is not set
  8747. -
  8748. -#
  8749. -# Appletalk devices
  8750. -#
  8751. -# CONFIG_DEV_APPLETALK is not set
  8752. # CONFIG_DECNET is not set
  8753. # CONFIG_BRIDGE is not set
  8754. # CONFIG_X25 is not set
  8755. @@ -675,7 +667,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  8756. # CONFIG_AU1X00_USB_TTY is not set
  8757. # CONFIG_AU1X00_USB_RAW is not set
  8758. # CONFIG_TXX927_SERIAL is not set
  8759. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  8760. CONFIG_UNIX98_PTYS=y
  8761. CONFIG_UNIX98_PTY_COUNT=256
  8762. --- a/arch/mips/defconfig-pb1550
  8763. +++ b/arch/mips/defconfig-pb1550
  8764. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  8765. # CONFIG_MIPS_PB1000 is not set
  8766. # CONFIG_MIPS_PB1100 is not set
  8767. # CONFIG_MIPS_PB1500 is not set
  8768. -# CONFIG_MIPS_HYDROGEN3 is not set
  8769. CONFIG_MIPS_PB1550=y
  8770. +# CONFIG_MIPS_HYDROGEN3 is not set
  8771. # CONFIG_MIPS_XXS1500 is not set
  8772. # CONFIG_MIPS_MTX1 is not set
  8773. # CONFIG_COGENT_CSB250 is not set
  8774. @@ -213,11 +213,9 @@ CONFIG_MTD_CFI_AMDSTD=y
  8775. # CONFIG_MTD_BOSPORUS is not set
  8776. # CONFIG_MTD_XXS1500 is not set
  8777. # CONFIG_MTD_MTX1 is not set
  8778. -# CONFIG_MTD_DB1X00 is not set
  8779. CONFIG_MTD_PB1550=y
  8780. CONFIG_MTD_PB1550_BOOT=y
  8781. CONFIG_MTD_PB1550_USER=y
  8782. -# CONFIG_MTD_HYDROGEN3 is not set
  8783. # CONFIG_MTD_MIRAGE is not set
  8784. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  8785. # CONFIG_MTD_OCELOT is not set
  8786. @@ -236,7 +234,6 @@ CONFIG_MTD_PB1550_USER=y
  8787. #
  8788. # Disk-On-Chip Device Drivers
  8789. #
  8790. -# CONFIG_MTD_DOC1000 is not set
  8791. # CONFIG_MTD_DOC2000 is not set
  8792. # CONFIG_MTD_DOC2001 is not set
  8793. # CONFIG_MTD_DOCPROBE is not set
  8794. @@ -343,11 +340,6 @@ CONFIG_IP_PNP_BOOTP=y
  8795. #
  8796. # CONFIG_IPX is not set
  8797. # CONFIG_ATALK is not set
  8798. -
  8799. -#
  8800. -# Appletalk devices
  8801. -#
  8802. -# CONFIG_DEV_APPLETALK is not set
  8803. # CONFIG_DECNET is not set
  8804. # CONFIG_BRIDGE is not set
  8805. # CONFIG_X25 is not set
  8806. @@ -633,7 +625,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  8807. # CONFIG_AU1X00_USB_TTY is not set
  8808. # CONFIG_AU1X00_USB_RAW is not set
  8809. # CONFIG_TXX927_SERIAL is not set
  8810. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  8811. CONFIG_UNIX98_PTYS=y
  8812. CONFIG_UNIX98_PTY_COUNT=256
  8813. --- a/arch/mips/defconfig-rbtx4927
  8814. +++ b/arch/mips/defconfig-rbtx4927
  8815. @@ -28,8 +28,8 @@ CONFIG_EXPERIMENTAL=y
  8816. # CONFIG_MIPS_PB1000 is not set
  8817. # CONFIG_MIPS_PB1100 is not set
  8818. # CONFIG_MIPS_PB1500 is not set
  8819. -# CONFIG_MIPS_HYDROGEN3 is not set
  8820. # CONFIG_MIPS_PB1550 is not set
  8821. +# CONFIG_MIPS_HYDROGEN3 is not set
  8822. # CONFIG_MIPS_XXS1500 is not set
  8823. # CONFIG_MIPS_MTX1 is not set
  8824. # CONFIG_COGENT_CSB250 is not set
  8825. @@ -223,11 +223,6 @@ CONFIG_IP_PNP_DHCP=y
  8826. #
  8827. # CONFIG_IPX is not set
  8828. # CONFIG_ATALK is not set
  8829. -
  8830. -#
  8831. -# Appletalk devices
  8832. -#
  8833. -# CONFIG_DEV_APPLETALK is not set
  8834. # CONFIG_DECNET is not set
  8835. # CONFIG_BRIDGE is not set
  8836. # CONFIG_X25 is not set
  8837. @@ -466,7 +461,6 @@ CONFIG_SERIAL_NONSTANDARD=y
  8838. CONFIG_SERIAL_TXX9=y
  8839. CONFIG_SERIAL_TXX9_CONSOLE=y
  8840. # CONFIG_TXX927_SERIAL is not set
  8841. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  8842. # CONFIG_UNIX98_PTYS is not set
  8843. #
  8844. --- a/arch/mips/defconfig-rm200
  8845. +++ b/arch/mips/defconfig-rm200
  8846. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  8847. # CONFIG_MIPS_PB1000 is not set
  8848. # CONFIG_MIPS_PB1100 is not set
  8849. # CONFIG_MIPS_PB1500 is not set
  8850. -# CONFIG_MIPS_HYDROGEN3 is not set
  8851. # CONFIG_MIPS_PB1550 is not set
  8852. +# CONFIG_MIPS_HYDROGEN3 is not set
  8853. # CONFIG_MIPS_XXS1500 is not set
  8854. # CONFIG_MIPS_MTX1 is not set
  8855. # CONFIG_COGENT_CSB250 is not set
  8856. @@ -229,11 +229,6 @@ CONFIG_INET=y
  8857. #
  8858. # CONFIG_IPX is not set
  8859. # CONFIG_ATALK is not set
  8860. -
  8861. -#
  8862. -# Appletalk devices
  8863. -#
  8864. -# CONFIG_DEV_APPLETALK is not set
  8865. # CONFIG_DECNET is not set
  8866. # CONFIG_BRIDGE is not set
  8867. # CONFIG_X25 is not set
  8868. @@ -340,7 +335,6 @@ CONFIG_VT_CONSOLE=y
  8869. # CONFIG_SERIAL is not set
  8870. # CONFIG_SERIAL_EXTENDED is not set
  8871. # CONFIG_SERIAL_NONSTANDARD is not set
  8872. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  8873. CONFIG_UNIX98_PTYS=y
  8874. CONFIG_UNIX98_PTY_COUNT=256
  8875. --- a/arch/mips/defconfig-sb1250-swarm
  8876. +++ b/arch/mips/defconfig-sb1250-swarm
  8877. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  8878. # CONFIG_MIPS_PB1000 is not set
  8879. # CONFIG_MIPS_PB1100 is not set
  8880. # CONFIG_MIPS_PB1500 is not set
  8881. -# CONFIG_MIPS_HYDROGEN3 is not set
  8882. # CONFIG_MIPS_PB1550 is not set
  8883. +# CONFIG_MIPS_HYDROGEN3 is not set
  8884. # CONFIG_MIPS_XXS1500 is not set
  8885. # CONFIG_MIPS_MTX1 is not set
  8886. # CONFIG_COGENT_CSB250 is not set
  8887. @@ -90,6 +90,7 @@ CONFIG_SIBYTE_CFE=y
  8888. # CONFIG_SIBYTE_TBPROF is not set
  8889. CONFIG_SIBYTE_GENBUS_IDE=y
  8890. CONFIG_SMP_CAPABLE=y
  8891. +CONFIG_MIPS_RTC=y
  8892. # CONFIG_SNI_RM200_PCI is not set
  8893. # CONFIG_TANBAC_TB0226 is not set
  8894. # CONFIG_TANBAC_TB0229 is not set
  8895. @@ -253,11 +254,6 @@ CONFIG_INET=y
  8896. #
  8897. # CONFIG_IPX is not set
  8898. # CONFIG_ATALK is not set
  8899. -
  8900. -#
  8901. -# Appletalk devices
  8902. -#
  8903. -# CONFIG_DEV_APPLETALK is not set
  8904. # CONFIG_DECNET is not set
  8905. # CONFIG_BRIDGE is not set
  8906. # CONFIG_X25 is not set
  8907. @@ -469,7 +465,6 @@ CONFIG_SERIAL_NONSTANDARD=y
  8908. CONFIG_SIBYTE_SB1250_DUART=y
  8909. CONFIG_SIBYTE_SB1250_DUART_CONSOLE=y
  8910. CONFIG_SERIAL_CONSOLE=y
  8911. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  8912. CONFIG_UNIX98_PTYS=y
  8913. CONFIG_UNIX98_PTY_COUNT=256
  8914. --- a/arch/mips/defconfig-sead
  8915. +++ b/arch/mips/defconfig-sead
  8916. @@ -28,8 +28,8 @@ CONFIG_EXPERIMENTAL=y
  8917. # CONFIG_MIPS_PB1000 is not set
  8918. # CONFIG_MIPS_PB1100 is not set
  8919. # CONFIG_MIPS_PB1500 is not set
  8920. -# CONFIG_MIPS_HYDROGEN3 is not set
  8921. # CONFIG_MIPS_PB1550 is not set
  8922. +# CONFIG_MIPS_HYDROGEN3 is not set
  8923. # CONFIG_MIPS_XXS1500 is not set
  8924. # CONFIG_MIPS_MTX1 is not set
  8925. # CONFIG_COGENT_CSB250 is not set
  8926. @@ -244,7 +244,6 @@ CONFIG_SERIAL=y
  8927. CONFIG_SERIAL_CONSOLE=y
  8928. # CONFIG_SERIAL_EXTENDED is not set
  8929. # CONFIG_SERIAL_NONSTANDARD is not set
  8930. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  8931. # CONFIG_UNIX98_PTYS is not set
  8932. #
  8933. --- a/arch/mips/defconfig-stretch
  8934. +++ b/arch/mips/defconfig-stretch
  8935. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  8936. # CONFIG_MIPS_PB1000 is not set
  8937. # CONFIG_MIPS_PB1100 is not set
  8938. # CONFIG_MIPS_PB1500 is not set
  8939. -# CONFIG_MIPS_HYDROGEN3 is not set
  8940. # CONFIG_MIPS_PB1550 is not set
  8941. +# CONFIG_MIPS_HYDROGEN3 is not set
  8942. # CONFIG_MIPS_XXS1500 is not set
  8943. # CONFIG_MIPS_MTX1 is not set
  8944. # CONFIG_COGENT_CSB250 is not set
  8945. @@ -240,11 +240,6 @@ CONFIG_IP_PNP_DHCP=y
  8946. #
  8947. # CONFIG_IPX is not set
  8948. # CONFIG_ATALK is not set
  8949. -
  8950. -#
  8951. -# Appletalk devices
  8952. -#
  8953. -# CONFIG_DEV_APPLETALK is not set
  8954. # CONFIG_DECNET is not set
  8955. # CONFIG_BRIDGE is not set
  8956. # CONFIG_X25 is not set
  8957. @@ -324,9 +319,11 @@ CONFIG_CHR_DEV_SG=y
  8958. # CONFIG_SCSI_MEGARAID is not set
  8959. # CONFIG_SCSI_MEGARAID2 is not set
  8960. # CONFIG_SCSI_SATA is not set
  8961. +# CONFIG_SCSI_SATA_AHCI is not set
  8962. # CONFIG_SCSI_SATA_SVW is not set
  8963. # CONFIG_SCSI_ATA_PIIX is not set
  8964. # CONFIG_SCSI_SATA_NV is not set
  8965. +# CONFIG_SCSI_SATA_QSTOR is not set
  8966. # CONFIG_SCSI_SATA_PROMISE is not set
  8967. # CONFIG_SCSI_SATA_SX4 is not set
  8968. # CONFIG_SCSI_SATA_SIL is not set
  8969. @@ -516,7 +513,6 @@ CONFIG_SERIAL_NONSTANDARD=y
  8970. # CONFIG_SERIAL_TXX9 is not set
  8971. # CONFIG_SERIAL_TXX9_CONSOLE is not set
  8972. # CONFIG_TXX927_SERIAL is not set
  8973. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  8974. CONFIG_UNIX98_PTYS=y
  8975. CONFIG_UNIX98_PTY_COUNT=256
  8976. --- a/arch/mips/defconfig-tb0226
  8977. +++ b/arch/mips/defconfig-tb0226
  8978. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  8979. # CONFIG_MIPS_PB1000 is not set
  8980. # CONFIG_MIPS_PB1100 is not set
  8981. # CONFIG_MIPS_PB1500 is not set
  8982. -# CONFIG_MIPS_HYDROGEN3 is not set
  8983. # CONFIG_MIPS_PB1550 is not set
  8984. +# CONFIG_MIPS_HYDROGEN3 is not set
  8985. # CONFIG_MIPS_XXS1500 is not set
  8986. # CONFIG_MIPS_MTX1 is not set
  8987. # CONFIG_COGENT_CSB250 is not set
  8988. @@ -228,11 +228,6 @@ CONFIG_IP_PNP_BOOTP=y
  8989. #
  8990. # CONFIG_IPX is not set
  8991. # CONFIG_ATALK is not set
  8992. -
  8993. -#
  8994. -# Appletalk devices
  8995. -#
  8996. -# CONFIG_DEV_APPLETALK is not set
  8997. # CONFIG_DECNET is not set
  8998. # CONFIG_BRIDGE is not set
  8999. # CONFIG_X25 is not set
  9000. @@ -312,9 +307,11 @@ CONFIG_SCSI_CONSTANTS=y
  9001. # CONFIG_SCSI_MEGARAID is not set
  9002. # CONFIG_SCSI_MEGARAID2 is not set
  9003. # CONFIG_SCSI_SATA is not set
  9004. +# CONFIG_SCSI_SATA_AHCI is not set
  9005. # CONFIG_SCSI_SATA_SVW is not set
  9006. # CONFIG_SCSI_ATA_PIIX is not set
  9007. # CONFIG_SCSI_SATA_NV is not set
  9008. +# CONFIG_SCSI_SATA_QSTOR is not set
  9009. # CONFIG_SCSI_SATA_PROMISE is not set
  9010. # CONFIG_SCSI_SATA_SX4 is not set
  9011. # CONFIG_SCSI_SATA_SIL is not set
  9012. @@ -518,7 +515,6 @@ CONFIG_SERIAL=y
  9013. CONFIG_SERIAL_CONSOLE=y
  9014. # CONFIG_SERIAL_EXTENDED is not set
  9015. # CONFIG_SERIAL_NONSTANDARD is not set
  9016. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  9017. # CONFIG_VR41XX_KIU is not set
  9018. CONFIG_UNIX98_PTYS=y
  9019. CONFIG_UNIX98_PTY_COUNT=256
  9020. --- a/arch/mips/defconfig-tb0229
  9021. +++ b/arch/mips/defconfig-tb0229
  9022. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  9023. # CONFIG_MIPS_PB1000 is not set
  9024. # CONFIG_MIPS_PB1100 is not set
  9025. # CONFIG_MIPS_PB1500 is not set
  9026. -# CONFIG_MIPS_HYDROGEN3 is not set
  9027. # CONFIG_MIPS_PB1550 is not set
  9028. +# CONFIG_MIPS_HYDROGEN3 is not set
  9029. # CONFIG_MIPS_XXS1500 is not set
  9030. # CONFIG_MIPS_MTX1 is not set
  9031. # CONFIG_COGENT_CSB250 is not set
  9032. @@ -230,11 +230,6 @@ CONFIG_IP_PNP_BOOTP=y
  9033. #
  9034. # CONFIG_IPX is not set
  9035. # CONFIG_ATALK is not set
  9036. -
  9037. -#
  9038. -# Appletalk devices
  9039. -#
  9040. -# CONFIG_DEV_APPLETALK is not set
  9041. # CONFIG_DECNET is not set
  9042. # CONFIG_BRIDGE is not set
  9043. # CONFIG_X25 is not set
  9044. @@ -445,7 +440,6 @@ CONFIG_SERIAL=y
  9045. CONFIG_SERIAL_CONSOLE=y
  9046. # CONFIG_SERIAL_EXTENDED is not set
  9047. # CONFIG_SERIAL_NONSTANDARD is not set
  9048. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  9049. # CONFIG_VR41XX_KIU is not set
  9050. CONFIG_UNIX98_PTYS=y
  9051. CONFIG_UNIX98_PTY_COUNT=256
  9052. --- a/arch/mips/defconfig-ti1500
  9053. +++ b/arch/mips/defconfig-ti1500
  9054. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  9055. # CONFIG_MIPS_PB1000 is not set
  9056. # CONFIG_MIPS_PB1100 is not set
  9057. # CONFIG_MIPS_PB1500 is not set
  9058. -# CONFIG_MIPS_HYDROGEN3 is not set
  9059. # CONFIG_MIPS_PB1550 is not set
  9060. +# CONFIG_MIPS_HYDROGEN3 is not set
  9061. CONFIG_MIPS_XXS1500=y
  9062. # CONFIG_MIPS_MTX1 is not set
  9063. # CONFIG_COGENT_CSB250 is not set
  9064. @@ -213,9 +213,7 @@ CONFIG_MTD_CFI_AMDSTD=y
  9065. # CONFIG_MTD_BOSPORUS is not set
  9066. CONFIG_MTD_XXS1500=y
  9067. # CONFIG_MTD_MTX1 is not set
  9068. -# CONFIG_MTD_DB1X00 is not set
  9069. # CONFIG_MTD_PB1550 is not set
  9070. -# CONFIG_MTD_HYDROGEN3 is not set
  9071. # CONFIG_MTD_MIRAGE is not set
  9072. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  9073. # CONFIG_MTD_OCELOT is not set
  9074. @@ -234,7 +232,6 @@ CONFIG_MTD_XXS1500=y
  9075. #
  9076. # Disk-On-Chip Device Drivers
  9077. #
  9078. -# CONFIG_MTD_DOC1000 is not set
  9079. # CONFIG_MTD_DOC2000 is not set
  9080. # CONFIG_MTD_DOC2001 is not set
  9081. # CONFIG_MTD_DOCPROBE is not set
  9082. @@ -339,11 +336,6 @@ CONFIG_IP_PNP_BOOTP=y
  9083. #
  9084. # CONFIG_IPX is not set
  9085. # CONFIG_ATALK is not set
  9086. -
  9087. -#
  9088. -# Appletalk devices
  9089. -#
  9090. -# CONFIG_DEV_APPLETALK is not set
  9091. # CONFIG_DECNET is not set
  9092. # CONFIG_BRIDGE is not set
  9093. # CONFIG_X25 is not set
  9094. @@ -600,7 +592,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  9095. # CONFIG_AU1X00_USB_TTY is not set
  9096. # CONFIG_AU1X00_USB_RAW is not set
  9097. # CONFIG_TXX927_SERIAL is not set
  9098. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  9099. CONFIG_UNIX98_PTYS=y
  9100. CONFIG_UNIX98_PTY_COUNT=256
  9101. --- a/arch/mips/defconfig-workpad
  9102. +++ b/arch/mips/defconfig-workpad
  9103. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  9104. # CONFIG_MIPS_PB1000 is not set
  9105. # CONFIG_MIPS_PB1100 is not set
  9106. # CONFIG_MIPS_PB1500 is not set
  9107. -# CONFIG_MIPS_HYDROGEN3 is not set
  9108. # CONFIG_MIPS_PB1550 is not set
  9109. +# CONFIG_MIPS_HYDROGEN3 is not set
  9110. # CONFIG_MIPS_XXS1500 is not set
  9111. # CONFIG_MIPS_MTX1 is not set
  9112. # CONFIG_COGENT_CSB250 is not set
  9113. @@ -222,11 +222,6 @@ CONFIG_IP_MULTICAST=y
  9114. #
  9115. # CONFIG_IPX is not set
  9116. # CONFIG_ATALK is not set
  9117. -
  9118. -#
  9119. -# Appletalk devices
  9120. -#
  9121. -# CONFIG_DEV_APPLETALK is not set
  9122. # CONFIG_DECNET is not set
  9123. # CONFIG_BRIDGE is not set
  9124. # CONFIG_X25 is not set
  9125. @@ -426,7 +421,6 @@ CONFIG_SERIAL_MANY_PORTS=y
  9126. # CONFIG_SERIAL_MULTIPORT is not set
  9127. # CONFIG_HUB6 is not set
  9128. # CONFIG_SERIAL_NONSTANDARD is not set
  9129. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  9130. # CONFIG_VR41XX_KIU is not set
  9131. CONFIG_UNIX98_PTYS=y
  9132. CONFIG_UNIX98_PTY_COUNT=256
  9133. --- a/arch/mips/defconfig-xxs1500
  9134. +++ b/arch/mips/defconfig-xxs1500
  9135. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  9136. # CONFIG_MIPS_PB1000 is not set
  9137. # CONFIG_MIPS_PB1100 is not set
  9138. # CONFIG_MIPS_PB1500 is not set
  9139. -# CONFIG_MIPS_HYDROGEN3 is not set
  9140. # CONFIG_MIPS_PB1550 is not set
  9141. +# CONFIG_MIPS_HYDROGEN3 is not set
  9142. CONFIG_MIPS_XXS1500=y
  9143. # CONFIG_MIPS_MTX1 is not set
  9144. # CONFIG_COGENT_CSB250 is not set
  9145. @@ -213,9 +213,7 @@ CONFIG_MTD_CFI_AMDSTD=y
  9146. # CONFIG_MTD_BOSPORUS is not set
  9147. CONFIG_MTD_XXS1500=y
  9148. # CONFIG_MTD_MTX1 is not set
  9149. -# CONFIG_MTD_DB1X00 is not set
  9150. # CONFIG_MTD_PB1550 is not set
  9151. -# CONFIG_MTD_HYDROGEN3 is not set
  9152. # CONFIG_MTD_MIRAGE is not set
  9153. # CONFIG_MTD_CSTM_MIPS_IXX is not set
  9154. # CONFIG_MTD_OCELOT is not set
  9155. @@ -234,7 +232,6 @@ CONFIG_MTD_XXS1500=y
  9156. #
  9157. # Disk-On-Chip Device Drivers
  9158. #
  9159. -# CONFIG_MTD_DOC1000 is not set
  9160. # CONFIG_MTD_DOC2000 is not set
  9161. # CONFIG_MTD_DOC2001 is not set
  9162. # CONFIG_MTD_DOCPROBE is not set
  9163. @@ -339,11 +336,6 @@ CONFIG_IP_PNP_BOOTP=y
  9164. #
  9165. # CONFIG_IPX is not set
  9166. # CONFIG_ATALK is not set
  9167. -
  9168. -#
  9169. -# Appletalk devices
  9170. -#
  9171. -# CONFIG_DEV_APPLETALK is not set
  9172. # CONFIG_DECNET is not set
  9173. # CONFIG_BRIDGE is not set
  9174. # CONFIG_X25 is not set
  9175. @@ -671,7 +663,6 @@ CONFIG_AU1X00_SERIAL_CONSOLE=y
  9176. # CONFIG_AU1X00_USB_TTY is not set
  9177. # CONFIG_AU1X00_USB_RAW is not set
  9178. # CONFIG_TXX927_SERIAL is not set
  9179. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  9180. CONFIG_UNIX98_PTYS=y
  9181. CONFIG_UNIX98_PTY_COUNT=256
  9182. --- a/arch/mips/defconfig-yosemite
  9183. +++ b/arch/mips/defconfig-yosemite
  9184. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  9185. # CONFIG_MIPS_PB1000 is not set
  9186. # CONFIG_MIPS_PB1100 is not set
  9187. # CONFIG_MIPS_PB1500 is not set
  9188. -# CONFIG_MIPS_HYDROGEN3 is not set
  9189. # CONFIG_MIPS_PB1550 is not set
  9190. +# CONFIG_MIPS_HYDROGEN3 is not set
  9191. # CONFIG_MIPS_XXS1500 is not set
  9192. # CONFIG_MIPS_MTX1 is not set
  9193. # CONFIG_COGENT_CSB250 is not set
  9194. @@ -227,11 +227,6 @@ CONFIG_IP_PNP_DHCP=y
  9195. #
  9196. # CONFIG_IPX is not set
  9197. # CONFIG_ATALK is not set
  9198. -
  9199. -#
  9200. -# Appletalk devices
  9201. -#
  9202. -# CONFIG_DEV_APPLETALK is not set
  9203. # CONFIG_DECNET is not set
  9204. # CONFIG_BRIDGE is not set
  9205. # CONFIG_X25 is not set
  9206. @@ -310,9 +305,11 @@ CONFIG_CHR_DEV_SG=y
  9207. # CONFIG_SCSI_MEGARAID is not set
  9208. # CONFIG_SCSI_MEGARAID2 is not set
  9209. # CONFIG_SCSI_SATA is not set
  9210. +# CONFIG_SCSI_SATA_AHCI is not set
  9211. # CONFIG_SCSI_SATA_SVW is not set
  9212. # CONFIG_SCSI_ATA_PIIX is not set
  9213. # CONFIG_SCSI_SATA_NV is not set
  9214. +# CONFIG_SCSI_SATA_QSTOR is not set
  9215. # CONFIG_SCSI_SATA_PROMISE is not set
  9216. # CONFIG_SCSI_SATA_SX4 is not set
  9217. # CONFIG_SCSI_SATA_SIL is not set
  9218. @@ -477,7 +474,6 @@ CONFIG_SERIAL_NONSTANDARD=y
  9219. # CONFIG_SERIAL_TXX9 is not set
  9220. # CONFIG_SERIAL_TXX9_CONSOLE is not set
  9221. # CONFIG_TXX927_SERIAL is not set
  9222. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  9223. CONFIG_UNIX98_PTYS=y
  9224. CONFIG_UNIX98_PTY_COUNT=256
  9225. --- a/arch/mips/kernel/cpu-probe.c
  9226. +++ b/arch/mips/kernel/cpu-probe.c
  9227. @@ -34,21 +34,16 @@ static void r4k_wait(void)
  9228. ".set\tmips0");
  9229. }
  9230. -/* The Au1xxx wait is available only if we run CONFIG_PM and
  9231. - * the timer setup found we had a 32KHz counter available.
  9232. - * There are still problems with functions that may call au1k_wait
  9233. - * directly, but that will be discovered pretty quickly.
  9234. - */
  9235. -extern void (*au1k_wait_ptr)(void);
  9236. -void au1k_wait(void)
  9237. +/* The Au1xxx wait is available only if using 32khz counter or
  9238. + * external timer source, but specifically not CP0 Counter. */
  9239. +int allow_au1k_wait;
  9240. +
  9241. +static void au1k_wait(void)
  9242. {
  9243. -#ifdef CONFIG_PM
  9244. - unsigned long addr;
  9245. /* using the wait instruction makes CP0 counter unusable */
  9246. - __asm__("la %0,au1k_wait\n\t"
  9247. - ".set mips3\n\t"
  9248. - "cache 0x14,0(%0)\n\t"
  9249. - "cache 0x14,32(%0)\n\t"
  9250. + __asm__(".set mips3\n\t"
  9251. + "cache 0x14, 0(%0)\n\t"
  9252. + "cache 0x14, 32(%0)\n\t"
  9253. "sync\n\t"
  9254. "nop\n\t"
  9255. "wait\n\t"
  9256. @@ -57,11 +52,7 @@ void au1k_wait(void)
  9257. "nop\n\t"
  9258. "nop\n\t"
  9259. ".set mips0\n\t"
  9260. - : : "r" (addr));
  9261. -#else
  9262. - __asm__("nop\n\t"
  9263. - "nop");
  9264. -#endif
  9265. + : : "r" (au1k_wait));
  9266. }
  9267. static inline void check_wait(void)
  9268. @@ -100,20 +91,17 @@ static inline void check_wait(void)
  9269. cpu_wait = r4k_wait;
  9270. printk(" available.\n");
  9271. break;
  9272. -#ifdef CONFIG_PM
  9273. case CPU_AU1000:
  9274. case CPU_AU1100:
  9275. case CPU_AU1500:
  9276. case CPU_AU1550:
  9277. - if (au1k_wait_ptr != NULL) {
  9278. - cpu_wait = au1k_wait_ptr;
  9279. + case CPU_AU1200:
  9280. + if (allow_au1k_wait) {
  9281. + cpu_wait = au1k_wait;
  9282. printk(" available.\n");
  9283. - }
  9284. - else {
  9285. + } else
  9286. printk(" unavailable.\n");
  9287. - }
  9288. break;
  9289. -#endif
  9290. default:
  9291. printk(" unavailable.\n");
  9292. break;
  9293. --- a/arch/mips/kernel/head.S
  9294. +++ b/arch/mips/kernel/head.S
  9295. @@ -43,9 +43,9 @@
  9296. /* Cache Error */
  9297. LEAF(except_vec2_generic)
  9298. + .set push
  9299. .set noreorder
  9300. .set noat
  9301. - .set mips0
  9302. /*
  9303. * This is a very bad place to be. Our cache error
  9304. * detection has triggered. If we have write-back data
  9305. @@ -64,10 +64,9 @@
  9306. j cache_parity_error
  9307. nop
  9308. + .set pop
  9309. END(except_vec2_generic)
  9310. - .set at
  9311. -
  9312. /*
  9313. * Special interrupt vector for embedded MIPS. This is a
  9314. * dedicated interrupt vector which reduces interrupt processing
  9315. @@ -76,8 +75,11 @@
  9316. * size!
  9317. */
  9318. NESTED(except_vec4, 0, sp)
  9319. + .set push
  9320. + .set noreorder
  9321. 1: j 1b /* Dummy, will be replaced */
  9322. nop
  9323. + .set pop
  9324. END(except_vec4)
  9325. /*
  9326. @@ -87,8 +89,11 @@
  9327. * unconditional jump to this vector.
  9328. */
  9329. NESTED(except_vec_ejtag_debug, 0, sp)
  9330. + .set push
  9331. + .set noreorder
  9332. j ejtag_debug_handler
  9333. nop
  9334. + .set pop
  9335. END(except_vec_ejtag_debug)
  9336. __FINIT
  9337. @@ -97,6 +102,7 @@
  9338. * EJTAG debug exception handler.
  9339. */
  9340. NESTED(ejtag_debug_handler, PT_SIZE, sp)
  9341. + .set push
  9342. .set noat
  9343. .set noreorder
  9344. mtc0 k0, CP0_DESAVE
  9345. @@ -120,7 +126,7 @@ ejtag_return:
  9346. deret
  9347. .set mips0
  9348. nop
  9349. - .set at
  9350. + .set pop
  9351. END(ejtag_debug_handler)
  9352. __INIT
  9353. @@ -132,13 +138,17 @@ ejtag_return:
  9354. * unconditional jump to this vector.
  9355. */
  9356. NESTED(except_vec_nmi, 0, sp)
  9357. + .set push
  9358. + .set noreorder
  9359. j nmi_handler
  9360. nop
  9361. + .set pop
  9362. END(except_vec_nmi)
  9363. __FINIT
  9364. NESTED(nmi_handler, PT_SIZE, sp)
  9365. + .set push
  9366. .set noat
  9367. .set noreorder
  9368. .set mips3
  9369. @@ -147,8 +157,7 @@ ejtag_return:
  9370. move a0, sp
  9371. RESTORE_ALL
  9372. eret
  9373. - .set at
  9374. - .set mips0
  9375. + .set pop
  9376. END(nmi_handler)
  9377. __INIT
  9378. @@ -157,7 +166,20 @@ ejtag_return:
  9379. * Kernel entry point
  9380. */
  9381. NESTED(kernel_entry, 16, sp)
  9382. + .set push
  9383. + /*
  9384. + * For the moment disable interrupts and mark the kernel mode.
  9385. + * A full initialization of the CPU's status register is done
  9386. + * later in per_cpu_trap_init().
  9387. + */
  9388. + mfc0 t0, CP0_STATUS
  9389. + or t0, ST0_CU0|0x1f
  9390. + xor t0, 0x1f
  9391. + mtc0 t0, CP0_STATUS
  9392. +
  9393. .set noreorder
  9394. + sll zero,3 # ehb
  9395. + .set reorder
  9396. /*
  9397. * The firmware/bootloader passes argc/argp/envp
  9398. @@ -170,8 +192,8 @@ ejtag_return:
  9399. la t1, (_end - 4)
  9400. 1:
  9401. addiu t0, 4
  9402. + sw zero, (t0)
  9403. bne t0, t1, 1b
  9404. - sw zero, (t0)
  9405. /*
  9406. * Stack for kernel and init, current variable
  9407. @@ -182,7 +204,7 @@ ejtag_return:
  9408. sw t0, kernelsp
  9409. jal init_arch
  9410. - nop
  9411. + .set pop
  9412. END(kernel_entry)
  9413. @@ -193,17 +215,26 @@ ejtag_return:
  9414. * function after setting up the stack and gp registers.
  9415. */
  9416. LEAF(smp_bootstrap)
  9417. - .set push
  9418. - .set noreorder
  9419. - mtc0 zero, CP0_WIRED
  9420. - CLI
  9421. + .set push
  9422. + /*
  9423. + * For the moment disable interrupts and bootstrap exception
  9424. + * vectors and mark the kernel mode. A full initialization of
  9425. + * the CPU's status register is done later in
  9426. + * per_cpu_trap_init().
  9427. + */
  9428. mfc0 t0, CP0_STATUS
  9429. - li t1, ~(ST0_CU1|ST0_CU2|ST0_CU3|ST0_KX|ST0_SX|ST0_UX)
  9430. - and t0, t1
  9431. - or t0, (ST0_CU0);
  9432. + or t0, ST0_CU0|ST0_BEV|0x1f
  9433. + xor t0, ST0_BEV|0x1f
  9434. + mtc0 t0, CP0_STATUS
  9435. +
  9436. + .set noreorder
  9437. + sll zero,3 # ehb
  9438. + .set reorder
  9439. +
  9440. + mtc0 zero, CP0_WIRED
  9441. +
  9442. jal start_secondary
  9443. - mtc0 t0, CP0_STATUS
  9444. - .set pop
  9445. + .set pop
  9446. END(smp_bootstrap)
  9447. #endif
  9448. --- a/arch/mips/kernel/process.c
  9449. +++ b/arch/mips/kernel/process.c
  9450. @@ -128,6 +128,26 @@ int dump_fpu(struct pt_regs *regs, elf_f
  9451. return 1;
  9452. }
  9453. +void dump_regs(elf_greg_t *gp, struct pt_regs *regs)
  9454. +{
  9455. + int i;
  9456. +
  9457. + for (i = 0; i < EF_REG0; i++)
  9458. + gp[i] = 0;
  9459. + gp[EF_REG0] = 0;
  9460. + for (i = 1; i <= 31; i++)
  9461. + gp[EF_REG0 + i] = regs->regs[i];
  9462. + gp[EF_REG26] = 0;
  9463. + gp[EF_REG27] = 0;
  9464. + gp[EF_LO] = regs->lo;
  9465. + gp[EF_HI] = regs->hi;
  9466. + gp[EF_CP0_EPC] = regs->cp0_epc;
  9467. + gp[EF_CP0_BADVADDR] = regs->cp0_badvaddr;
  9468. + gp[EF_CP0_STATUS] = regs->cp0_status;
  9469. + gp[EF_CP0_CAUSE] = regs->cp0_cause;
  9470. + gp[EF_UNUSED0] = 0;
  9471. +}
  9472. +
  9473. /*
  9474. * Create a kernel thread
  9475. */
  9476. --- a/arch/mips/kernel/scall_o32.S
  9477. +++ b/arch/mips/kernel/scall_o32.S
  9478. @@ -121,15 +121,14 @@ reschedule:
  9479. trace_a_syscall:
  9480. SAVE_STATIC
  9481. - sw t2, PT_R1(sp)
  9482. + move s0, t2
  9483. jal syscall_trace
  9484. - lw t2, PT_R1(sp)
  9485. lw a0, PT_R4(sp) # Restore argument registers
  9486. lw a1, PT_R5(sp)
  9487. lw a2, PT_R6(sp)
  9488. lw a3, PT_R7(sp)
  9489. - jalr t2
  9490. + jalr s0
  9491. li t0, -EMAXERRNO - 1 # error?
  9492. sltu t0, t0, v0
  9493. --- a/arch/mips/kernel/setup.c
  9494. +++ b/arch/mips/kernel/setup.c
  9495. @@ -5,7 +5,7 @@
  9496. *
  9497. * Copyright (C) 1995 Linus Torvalds
  9498. * Copyright (C) 1995 Waldorf Electronics
  9499. - * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001 Ralf Baechle
  9500. + * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 01, 05 Ralf Baechle
  9501. * Copyright (C) 1996 Stoned Elipot
  9502. * Copyright (C) 2000, 2001, 2002 Maciej W. Rozycki
  9503. */
  9504. @@ -71,6 +71,8 @@ extern void * __rd_start, * __rd_end;
  9505. extern struct rtc_ops no_rtc_ops;
  9506. struct rtc_ops *rtc_ops;
  9507. +EXPORT_SYMBOL(rtc_ops);
  9508. +
  9509. #ifdef CONFIG_PC_KEYB
  9510. struct kbd_ops *kbd_ops;
  9511. #endif
  9512. @@ -132,10 +134,6 @@ init_arch(int argc, char **argv, char **
  9513. */
  9514. load_mmu();
  9515. - /* Disable coprocessors and set FPU for 16/32 FPR register model */
  9516. - clear_c0_status(ST0_CU1|ST0_CU2|ST0_CU3|ST0_KX|ST0_SX|ST0_FR);
  9517. - set_c0_status(ST0_CU0);
  9518. -
  9519. start_kernel();
  9520. }
  9521. --- a/arch/mips/kernel/traps.c
  9522. +++ b/arch/mips/kernel/traps.c
  9523. @@ -452,9 +452,10 @@ static inline void simulate_ll(struct pt
  9524. }
  9525. ll_task = current;
  9526. + compute_return_epc(regs);
  9527. +
  9528. regs->regs[(opcode & RT) >> 16] = value;
  9529. - compute_return_epc(regs);
  9530. return;
  9531. sig:
  9532. @@ -485,8 +486,8 @@ static inline void simulate_sc(struct pt
  9533. goto sig;
  9534. }
  9535. if (ll_bit == 0 || ll_task != current) {
  9536. - regs->regs[reg] = 0;
  9537. compute_return_epc(regs);
  9538. + regs->regs[reg] = 0;
  9539. return;
  9540. }
  9541. @@ -495,9 +496,9 @@ static inline void simulate_sc(struct pt
  9542. goto sig;
  9543. }
  9544. + compute_return_epc(regs);
  9545. regs->regs[reg] = 1;
  9546. - compute_return_epc(regs);
  9547. return;
  9548. sig:
  9549. @@ -887,12 +888,18 @@ extern asmlinkage int fpu_emulator_resto
  9550. void __init per_cpu_trap_init(void)
  9551. {
  9552. unsigned int cpu = smp_processor_id();
  9553. + unsigned int status_set = ST0_CU0;
  9554. - /* Some firmware leaves the BEV flag set, clear it. */
  9555. - clear_c0_status(ST0_CU3|ST0_CU2|ST0_CU1|ST0_BEV|ST0_KX|ST0_SX|ST0_UX);
  9556. -
  9557. + /*
  9558. + * Disable coprocessors and 64-bit addressing and set FPU for
  9559. + * the 16/32 FPR register model. Reset the BEV flag that some
  9560. + * firmware may have left set and the TS bit (for IP27). Set
  9561. + * XX for ISA IV code to work.
  9562. + */
  9563. if (current_cpu_data.isa_level == MIPS_CPU_ISA_IV)
  9564. - set_c0_status(ST0_XX);
  9565. + status_set |= ST0_XX;
  9566. + change_c0_status(ST0_CU|ST0_FR|ST0_BEV|ST0_TS|ST0_KX|ST0_SX|ST0_UX,
  9567. + status_set);
  9568. /*
  9569. * Some MIPS CPUs have a dedicated interrupt vector which reduces the
  9570. @@ -902,7 +909,7 @@ void __init per_cpu_trap_init(void)
  9571. set_c0_cause(CAUSEF_IV);
  9572. cpu_data[cpu].asid_cache = ASID_FIRST_VERSION;
  9573. - write_c0_context(cpu << 23);
  9574. + TLBMISS_HANDLER_SETUP();
  9575. atomic_inc(&init_mm.mm_count);
  9576. current->active_mm = &init_mm;
  9577. @@ -918,8 +925,6 @@ void __init trap_init(void)
  9578. extern char except_vec4;
  9579. unsigned long i;
  9580. - per_cpu_trap_init();
  9581. -
  9582. /* Copy the generic exception handler code to it's final destination. */
  9583. memcpy((void *)(KSEG0 + 0x80), &except_vec1_generic, 0x80);
  9584. @@ -1020,10 +1025,5 @@ void __init trap_init(void)
  9585. flush_icache_range(KSEG0, KSEG0 + 0x400);
  9586. - atomic_inc(&init_mm.mm_count); /* XXX UP? */
  9587. - current->active_mm = &init_mm;
  9588. -
  9589. - /* XXX Must be done for all CPUs */
  9590. - current_cpu_data.asid_cache = ASID_FIRST_VERSION;
  9591. - TLBMISS_HANDLER_SETUP();
  9592. + per_cpu_trap_init();
  9593. }
  9594. --- a/arch/mips/lib/rtc-no.c
  9595. +++ b/arch/mips/lib/rtc-no.c
  9596. @@ -6,10 +6,9 @@
  9597. * Stub RTC routines to keep Linux from crashing on machine which don't
  9598. * have a RTC chip.
  9599. *
  9600. - * Copyright (C) 1998, 2001 by Ralf Baechle
  9601. + * Copyright (C) 1998, 2001, 2005 by Ralf Baechle
  9602. */
  9603. #include <linux/kernel.h>
  9604. -#include <linux/module.h>
  9605. #include <linux/mc146818rtc.h>
  9606. static unsigned int shouldnt_happen(void)
  9607. @@ -29,5 +28,3 @@ struct rtc_ops no_rtc_ops = {
  9608. .rtc_write_data = (void *) &shouldnt_happen,
  9609. .rtc_bcd_mode = (void *) &shouldnt_happen
  9610. };
  9611. -
  9612. -EXPORT_SYMBOL(rtc_ops);
  9613. --- a/arch/mips/lib/rtc-std.c
  9614. +++ b/arch/mips/lib/rtc-std.c
  9615. @@ -5,9 +5,8 @@
  9616. *
  9617. * RTC routines for PC style attached Dallas chip.
  9618. *
  9619. - * Copyright (C) 1998, 2001 by Ralf Baechle
  9620. + * Copyright (C) 1998, 2001, 05 by Ralf Baechle
  9621. */
  9622. -#include <linux/module.h>
  9623. #include <linux/mc146818rtc.h>
  9624. #include <asm/io.h>
  9625. @@ -33,5 +32,3 @@ struct rtc_ops std_rtc_ops = {
  9626. &std_rtc_write_data,
  9627. &std_rtc_bcd_mode
  9628. };
  9629. -
  9630. -EXPORT_SYMBOL(rtc_ops);
  9631. --- a/arch/mips/Makefile
  9632. +++ b/arch/mips/Makefile
  9633. @@ -209,7 +209,7 @@ LOADADDR := 0x80080000
  9634. endif
  9635. #
  9636. -# Au1000 (Alchemy Semi PB1000) eval board
  9637. +# Au1x AMD Alchemy eval boards
  9638. #
  9639. ifdef CONFIG_MIPS_PB1000
  9640. LIBS += arch/mips/au1000/pb1000/pb1000.o \
  9641. @@ -218,9 +218,6 @@ SUBDIRS += arch/mips/au1000/pb1000 arch
  9642. LOADADDR := 0x80100000
  9643. endif
  9644. -#
  9645. -# Au1100 (Alchemy Semi PB1100) eval board
  9646. -#
  9647. ifdef CONFIG_MIPS_PB1100
  9648. LIBS += arch/mips/au1000/pb1100/pb1100.o \
  9649. arch/mips/au1000/common/au1000.o
  9650. @@ -228,9 +225,6 @@ SUBDIRS += arch/mips/au1000/pb1100
  9651. LOADADDR += 0x80100000
  9652. endif
  9653. -#
  9654. -# Au1500 (Alchemy Semi PB1500) eval board
  9655. -#
  9656. ifdef CONFIG_MIPS_PB1500
  9657. LIBS += arch/mips/au1000/pb1500/pb1500.o \
  9658. arch/mips/au1000/common/au1000.o
  9659. @@ -238,9 +232,6 @@ SUBDIRS += arch/mips/au1000/pb1500 arch
  9660. LOADADDR := 0x80100000
  9661. endif
  9662. -#
  9663. -# Au1x00 (AMD/Alchemy) eval boards
  9664. -#
  9665. ifdef CONFIG_MIPS_DB1000
  9666. LIBS += arch/mips/au1000/db1x00/db1x00.o \
  9667. arch/mips/au1000/common/au1000.o
  9668. @@ -311,6 +302,27 @@ SUBDIRS += arch/mips/au1000/pb1550
  9669. LOADADDR += 0x80100000
  9670. endif
  9671. +ifdef CONFIG_MIPS_PB1200
  9672. +LIBS += arch/mips/au1000/pb1200/pb1200.o \
  9673. + arch/mips/au1000/common/au1000.o
  9674. +SUBDIRS += arch/mips/au1000/pb1200 arch/mips/au1000/common
  9675. +LOADADDR += 0x80100000
  9676. +endif
  9677. +
  9678. +ifdef CONFIG_MIPS_DB1200
  9679. +LIBS += arch/mips/au1000/pb1200/pb1200.o \
  9680. + arch/mips/au1000/common/au1000.o
  9681. +SUBDIRS += arch/mips/au1000/pb1200 arch/mips/au1000/common
  9682. +LOADADDR += 0x80100000
  9683. +endif
  9684. +
  9685. +ifdef CONFIG_MIPS_FICMMP
  9686. +LIBS += arch/mips/au1000/ficmmp/ficmmp.o \
  9687. + arch/mips/au1000/common/au1000.o
  9688. +SUBDIRS += arch/mips/au1000/ficmmp arch/mips/au1000/common
  9689. +LOADADDR += 0x80100000
  9690. +endif
  9691. +
  9692. #
  9693. # Cogent CSB250
  9694. --- a/arch/mips/mm/cerr-sb1.c
  9695. +++ b/arch/mips/mm/cerr-sb1.c
  9696. @@ -252,14 +252,14 @@ static const uint8_t parity[256] = {
  9697. /* Masks to select bits for Hamming parity, mask_72_64[i] for bit[i] */
  9698. static const uint64_t mask_72_64[8] = {
  9699. - 0x0738C808099264FFL,
  9700. - 0x38C808099264FF07L,
  9701. - 0xC808099264FF0738L,
  9702. - 0x08099264FF0738C8L,
  9703. - 0x099264FF0738C808L,
  9704. - 0x9264FF0738C80809L,
  9705. - 0x64FF0738C8080992L,
  9706. - 0xFF0738C808099264L
  9707. + 0x0738C808099264FFULL,
  9708. + 0x38C808099264FF07ULL,
  9709. + 0xC808099264FF0738ULL,
  9710. + 0x08099264FF0738C8ULL,
  9711. + 0x099264FF0738C808ULL,
  9712. + 0x9264FF0738C80809ULL,
  9713. + 0x64FF0738C8080992ULL,
  9714. + 0xFF0738C808099264ULL
  9715. };
  9716. /* Calculate the parity on a range of bits */
  9717. @@ -331,9 +331,9 @@ static uint32_t extract_ic(unsigned shor
  9718. ((lru >> 4) & 0x3),
  9719. ((lru >> 6) & 0x3));
  9720. }
  9721. - va = (taglo & 0xC0000FFFFFFFE000) | addr;
  9722. + va = (taglo & 0xC0000FFFFFFFE000ULL) | addr;
  9723. if ((taglo & (1 << 31)) && (((taglo >> 62) & 0x3) == 3))
  9724. - va |= 0x3FFFF00000000000;
  9725. + va |= 0x3FFFF00000000000ULL;
  9726. valid = ((taghi >> 29) & 1);
  9727. if (valid) {
  9728. tlo_tmp = taglo & 0xfff3ff;
  9729. @@ -474,7 +474,7 @@ static uint32_t extract_dc(unsigned shor
  9730. : "r" ((way << 13) | addr));
  9731. taglo = ((unsigned long long)taglohi << 32) | taglolo;
  9732. - pa = (taglo & 0xFFFFFFE000) | addr;
  9733. + pa = (taglo & 0xFFFFFFE000ULL) | addr;
  9734. if (way == 0) {
  9735. lru = (taghi >> 14) & 0xff;
  9736. prom_printf("[Bank %d Set 0x%02x] LRU > %d %d %d %d > MRU\n",
  9737. --- a/arch/mips/mm/c-r4k.c
  9738. +++ b/arch/mips/mm/c-r4k.c
  9739. @@ -867,9 +867,16 @@ static void __init probe_pcache(void)
  9740. * normally they'd suffer from aliases but magic in the hardware deals
  9741. * with that for us so we don't need to take care ourselves.
  9742. */
  9743. - if (c->cputype != CPU_R10000 && c->cputype != CPU_R12000)
  9744. - if (c->dcache.waysize > PAGE_SIZE)
  9745. - c->dcache.flags |= MIPS_CACHE_ALIASES;
  9746. + switch (c->cputype) {
  9747. + case CPU_R10000:
  9748. + case CPU_R12000:
  9749. + break;
  9750. + case CPU_24K:
  9751. + if (!(read_c0_config7() & (1 << 16)))
  9752. + default:
  9753. + if (c->dcache.waysize > PAGE_SIZE)
  9754. + c->dcache.flags |= MIPS_CACHE_ALIASES;
  9755. + }
  9756. switch (c->cputype) {
  9757. case CPU_20KC:
  9758. @@ -1069,9 +1076,6 @@ void __init ld_mmu_r4xx0(void)
  9759. probe_pcache();
  9760. setup_scache();
  9761. - if (c->dcache.sets * c->dcache.ways > PAGE_SIZE)
  9762. - c->dcache.flags |= MIPS_CACHE_ALIASES;
  9763. -
  9764. r4k_blast_dcache_page_setup();
  9765. r4k_blast_dcache_page_indexed_setup();
  9766. r4k_blast_dcache_setup();
  9767. --- a/arch/mips/mm/tlbex-mips32.S
  9768. +++ b/arch/mips/mm/tlbex-mips32.S
  9769. @@ -196,7 +196,7 @@
  9770. .set noat; \
  9771. SAVE_ALL; \
  9772. mfc0 a2, CP0_BADVADDR; \
  9773. - STI; \
  9774. + KMODE; \
  9775. .set at; \
  9776. move a0, sp; \
  9777. jal do_page_fault; \
  9778. --- a/arch/mips/mm/tlbex-r4k.S
  9779. +++ b/arch/mips/mm/tlbex-r4k.S
  9780. @@ -184,13 +184,10 @@
  9781. P_MTC0 k0, CP0_ENTRYLO0 # load it
  9782. PTE_SRL k1, k1, 6 # convert to entrylo1
  9783. P_MTC0 k1, CP0_ENTRYLO1 # load it
  9784. - b 1f
  9785. - rm9000_tlb_hazard
  9786. + mtc0_tlbw_hazard
  9787. tlbwr # write random tlb entry
  9788. -1:
  9789. - nop
  9790. - rm9000_tlb_hazard
  9791. - eret # return from trap
  9792. + tlbw_eret_hazard
  9793. + eret
  9794. END(except_vec0_r4000)
  9795. /* TLB refill, EXL == 0, R4600 version */
  9796. @@ -468,13 +465,9 @@ invalid_tlbl:
  9797. PTE_PRESENT(k0, k1, nopage_tlbl)
  9798. PTE_MAKEVALID(k0, k1)
  9799. PTE_RELOAD(k1, k0)
  9800. - rm9000_tlb_hazard
  9801. - nop
  9802. - b 1f
  9803. - tlbwi
  9804. -1:
  9805. - nop
  9806. - rm9000_tlb_hazard
  9807. + mtc0_tlbw_hazard
  9808. + tlbwi
  9809. + tlbw_eret_hazard
  9810. .set mips3
  9811. eret
  9812. .set mips0
  9813. @@ -496,13 +489,9 @@ nopage_tlbl:
  9814. PTE_WRITABLE(k0, k1, nopage_tlbs)
  9815. PTE_MAKEWRITE(k0, k1)
  9816. PTE_RELOAD(k1, k0)
  9817. - rm9000_tlb_hazard
  9818. - nop
  9819. - b 1f
  9820. - tlbwi
  9821. -1:
  9822. - nop
  9823. - rm9000_tlb_hazard
  9824. + mtc0_tlbw_hazard
  9825. + tlbwi
  9826. + tlbw_eret_hazard
  9827. .set mips3
  9828. eret
  9829. .set mips0
  9830. @@ -529,13 +518,9 @@ nopage_tlbs:
  9831. /* Now reload the entry into the tlb. */
  9832. PTE_RELOAD(k1, k0)
  9833. - rm9000_tlb_hazard
  9834. - nop
  9835. - b 1f
  9836. - tlbwi
  9837. -1:
  9838. - rm9000_tlb_hazard
  9839. - nop
  9840. + mtc0_tlbw_hazard
  9841. + tlbwi
  9842. + tlbw_eret_hazard
  9843. .set mips3
  9844. eret
  9845. .set mips0
  9846. --- a/arch/mips/mm/tlb-r4k.c
  9847. +++ b/arch/mips/mm/tlb-r4k.c
  9848. @@ -3,17 +3,12 @@
  9849. * License. See the file "COPYING" in the main directory of this archive
  9850. * for more details.
  9851. *
  9852. - * r4xx0.c: R4000 processor variant specific MMU/Cache routines.
  9853. - *
  9854. * Copyright (C) 1996 David S. Miller ([email protected])
  9855. * Copyright (C) 1997, 1998, 1999, 2000 Ralf Baechle [email protected]
  9856. - *
  9857. - * To do:
  9858. - *
  9859. - * - this code is a overbloated pig
  9860. - * - many of the bug workarounds are not efficient at all, but at
  9861. - * least they are functional ...
  9862. + * Carsten Langgaard, [email protected]
  9863. + * Copyright (C) 2002 MIPS Technologies, Inc. All rights reserved.
  9864. */
  9865. +#include <linux/config.h>
  9866. #include <linux/init.h>
  9867. #include <linux/sched.h>
  9868. #include <linux/mm.h>
  9869. @@ -25,9 +20,6 @@
  9870. #include <asm/pgtable.h>
  9871. #include <asm/system.h>
  9872. -#undef DEBUG_TLB
  9873. -#undef DEBUG_TLBUPDATE
  9874. -
  9875. extern char except_vec0_nevada, except_vec0_r4000, except_vec0_r4600;
  9876. /* CP0 hazard avoidance. */
  9877. @@ -41,33 +33,23 @@ void local_flush_tlb_all(void)
  9878. unsigned long old_ctx;
  9879. int entry;
  9880. -#ifdef DEBUG_TLB
  9881. - printk("[tlball]");
  9882. -#endif
  9883. -
  9884. local_irq_save(flags);
  9885. /* Save old context and create impossible VPN2 value */
  9886. old_ctx = read_c0_entryhi();
  9887. write_c0_entrylo0(0);
  9888. write_c0_entrylo1(0);
  9889. - BARRIER;
  9890. entry = read_c0_wired();
  9891. /* Blast 'em all away. */
  9892. while (entry < current_cpu_data.tlbsize) {
  9893. - /*
  9894. - * Make sure all entries differ. If they're not different
  9895. - * MIPS32 will take revenge ...
  9896. - */
  9897. write_c0_entryhi(KSEG0 + entry*0x2000);
  9898. write_c0_index(entry);
  9899. - BARRIER;
  9900. + mtc0_tlbw_hazard();
  9901. tlb_write_indexed();
  9902. - BARRIER;
  9903. entry++;
  9904. }
  9905. - BARRIER;
  9906. + tlbw_use_hazard();
  9907. write_c0_entryhi(old_ctx);
  9908. local_irq_restore(flags);
  9909. }
  9910. @@ -76,12 +58,8 @@ void local_flush_tlb_mm(struct mm_struct
  9911. {
  9912. int cpu = smp_processor_id();
  9913. - if (cpu_context(cpu, mm) != 0) {
  9914. -#ifdef DEBUG_TLB
  9915. - printk("[tlbmm<%d>]", cpu_context(cpu, mm));
  9916. -#endif
  9917. + if (cpu_context(cpu, mm) != 0)
  9918. drop_mmu_context(mm,cpu);
  9919. - }
  9920. }
  9921. void local_flush_tlb_range(struct mm_struct *mm, unsigned long start,
  9922. @@ -93,10 +71,6 @@ void local_flush_tlb_range(struct mm_str
  9923. unsigned long flags;
  9924. int size;
  9925. -#ifdef DEBUG_TLB
  9926. - printk("[tlbrange<%02x,%08lx,%08lx>]",
  9927. - cpu_asid(cpu, mm), start, end);
  9928. -#endif
  9929. local_irq_save(flags);
  9930. size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
  9931. size = (size + 1) >> 1;
  9932. @@ -112,7 +86,7 @@ void local_flush_tlb_range(struct mm_str
  9933. write_c0_entryhi(start | newpid);
  9934. start += (PAGE_SIZE << 1);
  9935. - BARRIER;
  9936. + mtc0_tlbw_hazard();
  9937. tlb_probe();
  9938. BARRIER;
  9939. idx = read_c0_index();
  9940. @@ -122,10 +96,10 @@ void local_flush_tlb_range(struct mm_str
  9941. continue;
  9942. /* Make sure all entries differ. */
  9943. write_c0_entryhi(KSEG0 + idx*0x2000);
  9944. - BARRIER;
  9945. + mtc0_tlbw_hazard();
  9946. tlb_write_indexed();
  9947. - BARRIER;
  9948. }
  9949. + tlbw_use_hazard();
  9950. write_c0_entryhi(oldpid);
  9951. } else {
  9952. drop_mmu_context(mm, cpu);
  9953. @@ -138,34 +112,30 @@ void local_flush_tlb_page(struct vm_area
  9954. {
  9955. int cpu = smp_processor_id();
  9956. - if (!vma || cpu_context(cpu, vma->vm_mm) != 0) {
  9957. + if (cpu_context(cpu, vma->vm_mm) != 0) {
  9958. unsigned long flags;
  9959. - int oldpid, newpid, idx;
  9960. + unsigned long oldpid, newpid, idx;
  9961. -#ifdef DEBUG_TLB
  9962. - printk("[tlbpage<%d,%08lx>]", cpu_context(cpu, vma->vm_mm),
  9963. - page);
  9964. -#endif
  9965. newpid = cpu_asid(cpu, vma->vm_mm);
  9966. page &= (PAGE_MASK << 1);
  9967. local_irq_save(flags);
  9968. oldpid = read_c0_entryhi();
  9969. write_c0_entryhi(page | newpid);
  9970. - BARRIER;
  9971. + mtc0_tlbw_hazard();
  9972. tlb_probe();
  9973. BARRIER;
  9974. idx = read_c0_index();
  9975. write_c0_entrylo0(0);
  9976. write_c0_entrylo1(0);
  9977. - if(idx < 0)
  9978. + if (idx < 0)
  9979. goto finish;
  9980. /* Make sure all entries differ. */
  9981. write_c0_entryhi(KSEG0+idx*0x2000);
  9982. - BARRIER;
  9983. + mtc0_tlbw_hazard();
  9984. tlb_write_indexed();
  9985. + tlbw_use_hazard();
  9986. finish:
  9987. - BARRIER;
  9988. write_c0_entryhi(oldpid);
  9989. local_irq_restore(flags);
  9990. }
  9991. @@ -185,7 +155,7 @@ void local_flush_tlb_one(unsigned long p
  9992. local_irq_save(flags);
  9993. write_c0_entryhi(page);
  9994. - BARRIER;
  9995. + mtc0_tlbw_hazard();
  9996. tlb_probe();
  9997. BARRIER;
  9998. idx = read_c0_index();
  9999. @@ -194,18 +164,19 @@ void local_flush_tlb_one(unsigned long p
  10000. if (idx >= 0) {
  10001. /* Make sure all entries differ. */
  10002. write_c0_entryhi(KSEG0+idx*0x2000);
  10003. + mtc0_tlbw_hazard();
  10004. tlb_write_indexed();
  10005. + tlbw_use_hazard();
  10006. }
  10007. - BARRIER;
  10008. write_c0_entryhi(oldpid);
  10009. +
  10010. local_irq_restore(flags);
  10011. }
  10012. EXPORT_SYMBOL(local_flush_tlb_one);
  10013. -/* We will need multiple versions of update_mmu_cache(), one that just
  10014. - * updates the TLB with the new pte(s), and another which also checks
  10015. - * for the R4k "end of page" hardware bug and does the needy.
  10016. +/*
  10017. + * Updates the TLB with the new pte(s).
  10018. */
  10019. void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
  10020. {
  10021. @@ -223,25 +194,16 @@ void __update_tlb(struct vm_area_struct
  10022. pid = read_c0_entryhi() & ASID_MASK;
  10023. -#ifdef DEBUG_TLB
  10024. - if ((pid != cpu_asid(cpu, vma->vm_mm)) ||
  10025. - (cpu_context(vma->vm_mm) == 0)) {
  10026. - printk("update_mmu_cache: Wheee, bogus tlbpid mmpid=%d "
  10027. - "tlbpid=%d\n", (int) (cpu_asid(cpu, vma->vm_mm)), pid);
  10028. - }
  10029. -#endif
  10030. -
  10031. local_irq_save(flags);
  10032. address &= (PAGE_MASK << 1);
  10033. write_c0_entryhi(address | pid);
  10034. pgdp = pgd_offset(vma->vm_mm, address);
  10035. - BARRIER;
  10036. + mtc0_tlbw_hazard();
  10037. tlb_probe();
  10038. BARRIER;
  10039. pmdp = pmd_offset(pgdp, address);
  10040. idx = read_c0_index();
  10041. ptep = pte_offset(pmdp, address);
  10042. - BARRIER;
  10043. #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
  10044. write_c0_entrylo0(ptep->pte_high);
  10045. ptep++;
  10046. @@ -251,15 +213,13 @@ void __update_tlb(struct vm_area_struct
  10047. write_c0_entrylo1(pte_val(*ptep) >> 6);
  10048. #endif
  10049. write_c0_entryhi(address | pid);
  10050. - BARRIER;
  10051. - if (idx < 0) {
  10052. + mtc0_tlbw_hazard();
  10053. + if (idx < 0)
  10054. tlb_write_random();
  10055. - } else {
  10056. + else
  10057. tlb_write_indexed();
  10058. - }
  10059. - BARRIER;
  10060. + tlbw_use_hazard();
  10061. write_c0_entryhi(pid);
  10062. - BARRIER;
  10063. local_irq_restore(flags);
  10064. }
  10065. @@ -279,24 +239,26 @@ static void r4k_update_mmu_cache_hwbug(s
  10066. asid = read_c0_entryhi() & ASID_MASK;
  10067. write_c0_entryhi(address | asid);
  10068. pgdp = pgd_offset(vma->vm_mm, address);
  10069. + mtc0_tlbw_hazard();
  10070. tlb_probe();
  10071. + BARRIER;
  10072. pmdp = pmd_offset(pgdp, address);
  10073. idx = read_c0_index();
  10074. ptep = pte_offset(pmdp, address);
  10075. write_c0_entrylo0(pte_val(*ptep++) >> 6);
  10076. write_c0_entrylo1(pte_val(*ptep) >> 6);
  10077. - BARRIER;
  10078. + mtc0_tlbw_hazard();
  10079. if (idx < 0)
  10080. tlb_write_random();
  10081. else
  10082. tlb_write_indexed();
  10083. - BARRIER;
  10084. + tlbw_use_hazard();
  10085. local_irq_restore(flags);
  10086. }
  10087. #endif
  10088. void __init add_wired_entry(unsigned long entrylo0, unsigned long entrylo1,
  10089. - unsigned long entryhi, unsigned long pagemask)
  10090. + unsigned long entryhi, unsigned long pagemask)
  10091. {
  10092. unsigned long flags;
  10093. unsigned long wired;
  10094. @@ -315,9 +277,9 @@ void __init add_wired_entry(unsigned lon
  10095. write_c0_entryhi(entryhi);
  10096. write_c0_entrylo0(entrylo0);
  10097. write_c0_entrylo1(entrylo1);
  10098. - BARRIER;
  10099. + mtc0_tlbw_hazard();
  10100. tlb_write_indexed();
  10101. - BARRIER;
  10102. + tlbw_use_hazard();
  10103. write_c0_entryhi(old_ctx);
  10104. BARRIER;
  10105. @@ -355,17 +317,15 @@ __init int add_temporary_entry(unsigned
  10106. }
  10107. write_c0_index(temp_tlb_entry);
  10108. - BARRIER;
  10109. write_c0_pagemask(pagemask);
  10110. write_c0_entryhi(entryhi);
  10111. write_c0_entrylo0(entrylo0);
  10112. write_c0_entrylo1(entrylo1);
  10113. - BARRIER;
  10114. + mtc0_tlbw_hazard();
  10115. tlb_write_indexed();
  10116. - BARRIER;
  10117. + tlbw_use_hazard();
  10118. write_c0_entryhi(old_ctx);
  10119. - BARRIER;
  10120. write_c0_pagemask(old_pagemask);
  10121. out:
  10122. local_irq_restore(flags);
  10123. @@ -375,7 +335,7 @@ out:
  10124. static void __init probe_tlb(unsigned long config)
  10125. {
  10126. struct cpuinfo_mips *c = &current_cpu_data;
  10127. - unsigned int reg;
  10128. + unsigned int config1;
  10129. /*
  10130. * If this isn't a MIPS32 / MIPS64 compliant CPU. Config 1 register
  10131. @@ -385,16 +345,16 @@ static void __init probe_tlb(unsigned lo
  10132. if ((c->processor_id & 0xff0000) == PRID_COMP_LEGACY)
  10133. return;
  10134. - reg = read_c0_config1();
  10135. + config1 = read_c0_config1();
  10136. if (!((config >> 7) & 3))
  10137. panic("No TLB present");
  10138. - c->tlbsize = ((reg >> 25) & 0x3f) + 1;
  10139. + c->tlbsize = ((config1 >> 25) & 0x3f) + 1;
  10140. }
  10141. void __init r4k_tlb_init(void)
  10142. {
  10143. - u32 config = read_c0_config();
  10144. + unsigned int config = read_c0_config();
  10145. /*
  10146. * You should never change this register:
  10147. --- a/arch/mips64/defconfig
  10148. +++ b/arch/mips64/defconfig
  10149. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  10150. # CONFIG_MIPS_PB1000 is not set
  10151. # CONFIG_MIPS_PB1100 is not set
  10152. # CONFIG_MIPS_PB1500 is not set
  10153. -# CONFIG_MIPS_HYDROGEN3 is not set
  10154. # CONFIG_MIPS_PB1550 is not set
  10155. +# CONFIG_MIPS_HYDROGEN3 is not set
  10156. # CONFIG_MIPS_XXS1500 is not set
  10157. # CONFIG_MIPS_MTX1 is not set
  10158. # CONFIG_COGENT_CSB250 is not set
  10159. @@ -470,9 +470,11 @@ CONFIG_SCSI_LOGGING=y
  10160. # CONFIG_SCSI_MEGARAID is not set
  10161. # CONFIG_SCSI_MEGARAID2 is not set
  10162. # CONFIG_SCSI_SATA is not set
  10163. +# CONFIG_SCSI_SATA_AHCI is not set
  10164. # CONFIG_SCSI_SATA_SVW is not set
  10165. # CONFIG_SCSI_ATA_PIIX is not set
  10166. # CONFIG_SCSI_SATA_NV is not set
  10167. +# CONFIG_SCSI_SATA_QSTOR is not set
  10168. # CONFIG_SCSI_SATA_PROMISE is not set
  10169. # CONFIG_SCSI_SATA_SX4 is not set
  10170. # CONFIG_SCSI_SATA_SIL is not set
  10171. @@ -658,7 +660,6 @@ CONFIG_SERIAL=y
  10172. CONFIG_SERIAL_CONSOLE=y
  10173. # CONFIG_SERIAL_EXTENDED is not set
  10174. # CONFIG_SERIAL_NONSTANDARD is not set
  10175. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  10176. CONFIG_UNIX98_PTYS=y
  10177. CONFIG_UNIX98_PTY_COUNT=256
  10178. --- a/arch/mips64/defconfig-atlas
  10179. +++ b/arch/mips64/defconfig-atlas
  10180. @@ -28,8 +28,8 @@ CONFIG_EXPERIMENTAL=y
  10181. # CONFIG_MIPS_PB1000 is not set
  10182. # CONFIG_MIPS_PB1100 is not set
  10183. # CONFIG_MIPS_PB1500 is not set
  10184. -# CONFIG_MIPS_HYDROGEN3 is not set
  10185. # CONFIG_MIPS_PB1550 is not set
  10186. +# CONFIG_MIPS_HYDROGEN3 is not set
  10187. # CONFIG_MIPS_XXS1500 is not set
  10188. # CONFIG_MIPS_MTX1 is not set
  10189. # CONFIG_COGENT_CSB250 is not set
  10190. @@ -232,11 +232,6 @@ CONFIG_IP_PNP=y
  10191. #
  10192. # CONFIG_IPX is not set
  10193. # CONFIG_ATALK is not set
  10194. -
  10195. -#
  10196. -# Appletalk devices
  10197. -#
  10198. -# CONFIG_DEV_APPLETALK is not set
  10199. # CONFIG_DECNET is not set
  10200. # CONFIG_BRIDGE is not set
  10201. # CONFIG_X25 is not set
  10202. @@ -314,9 +309,11 @@ CONFIG_SD_EXTRA_DEVS=40
  10203. # CONFIG_SCSI_MEGARAID is not set
  10204. # CONFIG_SCSI_MEGARAID2 is not set
  10205. # CONFIG_SCSI_SATA is not set
  10206. +# CONFIG_SCSI_SATA_AHCI is not set
  10207. # CONFIG_SCSI_SATA_SVW is not set
  10208. # CONFIG_SCSI_ATA_PIIX is not set
  10209. # CONFIG_SCSI_SATA_NV is not set
  10210. +# CONFIG_SCSI_SATA_QSTOR is not set
  10211. # CONFIG_SCSI_SATA_PROMISE is not set
  10212. # CONFIG_SCSI_SATA_SX4 is not set
  10213. # CONFIG_SCSI_SATA_SIL is not set
  10214. @@ -474,7 +471,6 @@ CONFIG_SERIAL=y
  10215. CONFIG_SERIAL_CONSOLE=y
  10216. # CONFIG_SERIAL_EXTENDED is not set
  10217. # CONFIG_SERIAL_NONSTANDARD is not set
  10218. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  10219. CONFIG_UNIX98_PTYS=y
  10220. CONFIG_UNIX98_PTY_COUNT=256
  10221. --- a/arch/mips64/defconfig-decstation
  10222. +++ b/arch/mips64/defconfig-decstation
  10223. @@ -28,8 +28,8 @@ CONFIG_EXPERIMENTAL=y
  10224. # CONFIG_MIPS_PB1000 is not set
  10225. # CONFIG_MIPS_PB1100 is not set
  10226. # CONFIG_MIPS_PB1500 is not set
  10227. -# CONFIG_MIPS_HYDROGEN3 is not set
  10228. # CONFIG_MIPS_PB1550 is not set
  10229. +# CONFIG_MIPS_HYDROGEN3 is not set
  10230. # CONFIG_MIPS_XXS1500 is not set
  10231. # CONFIG_MIPS_MTX1 is not set
  10232. # CONFIG_COGENT_CSB250 is not set
  10233. @@ -224,11 +224,6 @@ CONFIG_IP_PNP_BOOTP=y
  10234. #
  10235. # CONFIG_IPX is not set
  10236. # CONFIG_ATALK is not set
  10237. -
  10238. -#
  10239. -# Appletalk devices
  10240. -#
  10241. -# CONFIG_DEV_APPLETALK is not set
  10242. # CONFIG_DECNET is not set
  10243. # CONFIG_BRIDGE is not set
  10244. # CONFIG_X25 is not set
  10245. @@ -307,9 +302,11 @@ CONFIG_SCSI_DECNCR=y
  10246. # CONFIG_SCSI_MEGARAID is not set
  10247. # CONFIG_SCSI_MEGARAID2 is not set
  10248. # CONFIG_SCSI_SATA is not set
  10249. +# CONFIG_SCSI_SATA_AHCI is not set
  10250. # CONFIG_SCSI_SATA_SVW is not set
  10251. # CONFIG_SCSI_ATA_PIIX is not set
  10252. # CONFIG_SCSI_SATA_NV is not set
  10253. +# CONFIG_SCSI_SATA_QSTOR is not set
  10254. # CONFIG_SCSI_SATA_PROMISE is not set
  10255. # CONFIG_SCSI_SATA_SX4 is not set
  10256. # CONFIG_SCSI_SATA_SIL is not set
  10257. @@ -477,7 +474,6 @@ CONFIG_SERIAL_DEC=y
  10258. CONFIG_SERIAL_DEC_CONSOLE=y
  10259. # CONFIG_DZ is not set
  10260. CONFIG_ZS=y
  10261. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  10262. CONFIG_UNIX98_PTYS=y
  10263. CONFIG_UNIX98_PTY_COUNT=256
  10264. --- a/arch/mips64/defconfig-ip22
  10265. +++ b/arch/mips64/defconfig-ip22
  10266. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  10267. # CONFIG_MIPS_PB1000 is not set
  10268. # CONFIG_MIPS_PB1100 is not set
  10269. # CONFIG_MIPS_PB1500 is not set
  10270. -# CONFIG_MIPS_HYDROGEN3 is not set
  10271. # CONFIG_MIPS_PB1550 is not set
  10272. +# CONFIG_MIPS_HYDROGEN3 is not set
  10273. # CONFIG_MIPS_XXS1500 is not set
  10274. # CONFIG_MIPS_MTX1 is not set
  10275. # CONFIG_COGENT_CSB250 is not set
  10276. @@ -235,11 +235,6 @@ CONFIG_IP_PNP_BOOTP=y
  10277. #
  10278. # CONFIG_IPX is not set
  10279. # CONFIG_ATALK is not set
  10280. -
  10281. -#
  10282. -# Appletalk devices
  10283. -#
  10284. -# CONFIG_DEV_APPLETALK is not set
  10285. # CONFIG_DECNET is not set
  10286. # CONFIG_BRIDGE is not set
  10287. # CONFIG_X25 is not set
  10288. @@ -319,9 +314,11 @@ CONFIG_SGIWD93_SCSI=y
  10289. # CONFIG_SCSI_MEGARAID is not set
  10290. # CONFIG_SCSI_MEGARAID2 is not set
  10291. # CONFIG_SCSI_SATA is not set
  10292. +# CONFIG_SCSI_SATA_AHCI is not set
  10293. # CONFIG_SCSI_SATA_SVW is not set
  10294. # CONFIG_SCSI_ATA_PIIX is not set
  10295. # CONFIG_SCSI_SATA_NV is not set
  10296. +# CONFIG_SCSI_SATA_QSTOR is not set
  10297. # CONFIG_SCSI_SATA_PROMISE is not set
  10298. # CONFIG_SCSI_SATA_SX4 is not set
  10299. # CONFIG_SCSI_SATA_SIL is not set
  10300. @@ -488,7 +485,6 @@ CONFIG_SERIAL_NONSTANDARD=y
  10301. # CONFIG_SERIAL_TXX9_CONSOLE is not set
  10302. # CONFIG_TXX927_SERIAL is not set
  10303. CONFIG_IP22_SERIAL=y
  10304. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  10305. CONFIG_UNIX98_PTYS=y
  10306. CONFIG_UNIX98_PTY_COUNT=256
  10307. --- a/arch/mips64/defconfig-ip27
  10308. +++ b/arch/mips64/defconfig-ip27
  10309. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  10310. # CONFIG_MIPS_PB1000 is not set
  10311. # CONFIG_MIPS_PB1100 is not set
  10312. # CONFIG_MIPS_PB1500 is not set
  10313. -# CONFIG_MIPS_HYDROGEN3 is not set
  10314. # CONFIG_MIPS_PB1550 is not set
  10315. +# CONFIG_MIPS_HYDROGEN3 is not set
  10316. # CONFIG_MIPS_XXS1500 is not set
  10317. # CONFIG_MIPS_MTX1 is not set
  10318. # CONFIG_COGENT_CSB250 is not set
  10319. @@ -470,9 +470,11 @@ CONFIG_SCSI_LOGGING=y
  10320. # CONFIG_SCSI_MEGARAID is not set
  10321. # CONFIG_SCSI_MEGARAID2 is not set
  10322. # CONFIG_SCSI_SATA is not set
  10323. +# CONFIG_SCSI_SATA_AHCI is not set
  10324. # CONFIG_SCSI_SATA_SVW is not set
  10325. # CONFIG_SCSI_ATA_PIIX is not set
  10326. # CONFIG_SCSI_SATA_NV is not set
  10327. +# CONFIG_SCSI_SATA_QSTOR is not set
  10328. # CONFIG_SCSI_SATA_PROMISE is not set
  10329. # CONFIG_SCSI_SATA_SX4 is not set
  10330. # CONFIG_SCSI_SATA_SIL is not set
  10331. @@ -658,7 +660,6 @@ CONFIG_SERIAL=y
  10332. CONFIG_SERIAL_CONSOLE=y
  10333. # CONFIG_SERIAL_EXTENDED is not set
  10334. # CONFIG_SERIAL_NONSTANDARD is not set
  10335. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  10336. CONFIG_UNIX98_PTYS=y
  10337. CONFIG_UNIX98_PTY_COUNT=256
  10338. --- a/arch/mips64/defconfig-jaguar
  10339. +++ b/arch/mips64/defconfig-jaguar
  10340. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  10341. # CONFIG_MIPS_PB1000 is not set
  10342. # CONFIG_MIPS_PB1100 is not set
  10343. # CONFIG_MIPS_PB1500 is not set
  10344. -# CONFIG_MIPS_HYDROGEN3 is not set
  10345. # CONFIG_MIPS_PB1550 is not set
  10346. +# CONFIG_MIPS_HYDROGEN3 is not set
  10347. # CONFIG_MIPS_XXS1500 is not set
  10348. # CONFIG_MIPS_MTX1 is not set
  10349. # CONFIG_COGENT_CSB250 is not set
  10350. @@ -227,11 +227,6 @@ CONFIG_IP_PNP_DHCP=y
  10351. #
  10352. # CONFIG_IPX is not set
  10353. # CONFIG_ATALK is not set
  10354. -
  10355. -#
  10356. -# Appletalk devices
  10357. -#
  10358. -# CONFIG_DEV_APPLETALK is not set
  10359. # CONFIG_DECNET is not set
  10360. # CONFIG_BRIDGE is not set
  10361. # CONFIG_X25 is not set
  10362. @@ -403,7 +398,6 @@ CONFIG_SERIAL_NONSTANDARD=y
  10363. # CONFIG_SERIAL_TXX9 is not set
  10364. # CONFIG_SERIAL_TXX9_CONSOLE is not set
  10365. # CONFIG_TXX927_SERIAL is not set
  10366. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  10367. CONFIG_UNIX98_PTYS=y
  10368. CONFIG_UNIX98_PTY_COUNT=256
  10369. --- a/arch/mips64/defconfig-malta
  10370. +++ b/arch/mips64/defconfig-malta
  10371. @@ -22,16 +22,19 @@ CONFIG_KMOD=y
  10372. #
  10373. # CONFIG_ACER_PICA_61 is not set
  10374. # CONFIG_MIPS_BOSPORUS is not set
  10375. +# CONFIG_MIPS_FICMMP is not set
  10376. # CONFIG_MIPS_MIRAGE is not set
  10377. # CONFIG_MIPS_DB1000 is not set
  10378. # CONFIG_MIPS_DB1100 is not set
  10379. # CONFIG_MIPS_DB1500 is not set
  10380. # CONFIG_MIPS_DB1550 is not set
  10381. +# CONFIG_MIPS_DB1200 is not set
  10382. # CONFIG_MIPS_PB1000 is not set
  10383. # CONFIG_MIPS_PB1100 is not set
  10384. # CONFIG_MIPS_PB1500 is not set
  10385. -# CONFIG_MIPS_HYDROGEN3 is not set
  10386. # CONFIG_MIPS_PB1550 is not set
  10387. +# CONFIG_MIPS_PB1200 is not set
  10388. +# CONFIG_MIPS_HYDROGEN3 is not set
  10389. # CONFIG_MIPS_XXS1500 is not set
  10390. # CONFIG_MIPS_MTX1 is not set
  10391. # CONFIG_COGENT_CSB250 is not set
  10392. @@ -146,9 +149,9 @@ CONFIG_KCORE_ELF=y
  10393. CONFIG_BINFMT_ELF=y
  10394. CONFIG_MIPS32_COMPAT=y
  10395. CONFIG_MIPS32_O32=y
  10396. -# CONFIG_MIPS32_N32 is not set
  10397. +CONFIG_MIPS32_N32=y
  10398. CONFIG_BINFMT_ELF32=y
  10399. -# CONFIG_BINFMT_MISC is not set
  10400. +CONFIG_BINFMT_MISC=y
  10401. # CONFIG_OOM_KILLER is not set
  10402. # CONFIG_CMDLINE_BOOL is not set
  10403. @@ -235,11 +238,6 @@ CONFIG_IP_PNP_BOOTP=y
  10404. #
  10405. # CONFIG_IPX is not set
  10406. # CONFIG_ATALK is not set
  10407. -
  10408. -#
  10409. -# Appletalk devices
  10410. -#
  10411. -# CONFIG_DEV_APPLETALK is not set
  10412. # CONFIG_DECNET is not set
  10413. # CONFIG_BRIDGE is not set
  10414. # CONFIG_X25 is not set
  10415. @@ -271,8 +269,83 @@ CONFIG_IP_PNP_BOOTP=y
  10416. #
  10417. # ATA/IDE/MFM/RLL support
  10418. #
  10419. -# CONFIG_IDE is not set
  10420. +CONFIG_IDE=y
  10421. +
  10422. +#
  10423. +# IDE, ATA and ATAPI Block devices
  10424. +#
  10425. +CONFIG_BLK_DEV_IDE=y
  10426. +
  10427. +#
  10428. +# Please see Documentation/ide.txt for help/info on IDE drives
  10429. +#
  10430. +# CONFIG_BLK_DEV_HD_IDE is not set
  10431. # CONFIG_BLK_DEV_HD is not set
  10432. +# CONFIG_BLK_DEV_IDE_SATA is not set
  10433. +CONFIG_BLK_DEV_IDEDISK=y
  10434. +# CONFIG_IDEDISK_MULTI_MODE is not set
  10435. +# CONFIG_IDEDISK_STROKE is not set
  10436. +# CONFIG_BLK_DEV_IDECS is not set
  10437. +# CONFIG_BLK_DEV_DELKIN is not set
  10438. +CONFIG_BLK_DEV_IDECD=y
  10439. +CONFIG_BLK_DEV_IDETAPE=y
  10440. +CONFIG_BLK_DEV_IDEFLOPPY=y
  10441. +# CONFIG_BLK_DEV_IDESCSI is not set
  10442. +# CONFIG_IDE_TASK_IOCTL is not set
  10443. +
  10444. +#
  10445. +# IDE chipset support/bugfixes
  10446. +#
  10447. +# CONFIG_BLK_DEV_CMD640 is not set
  10448. +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
  10449. +# CONFIG_BLK_DEV_ISAPNP is not set
  10450. +CONFIG_BLK_DEV_IDEPCI=y
  10451. +CONFIG_BLK_DEV_GENERIC=y
  10452. +CONFIG_IDEPCI_SHARE_IRQ=y
  10453. +CONFIG_BLK_DEV_IDEDMA_PCI=y
  10454. +# CONFIG_BLK_DEV_OFFBOARD is not set
  10455. +CONFIG_BLK_DEV_IDEDMA_FORCED=y
  10456. +CONFIG_IDEDMA_PCI_AUTO=y
  10457. +# CONFIG_IDEDMA_ONLYDISK is not set
  10458. +CONFIG_BLK_DEV_IDEDMA=y
  10459. +# CONFIG_IDEDMA_PCI_WIP is not set
  10460. +# CONFIG_BLK_DEV_ADMA100 is not set
  10461. +# CONFIG_BLK_DEV_AEC62XX is not set
  10462. +# CONFIG_BLK_DEV_ALI15X3 is not set
  10463. +# CONFIG_WDC_ALI15X3 is not set
  10464. +# CONFIG_BLK_DEV_AMD74XX is not set
  10465. +# CONFIG_AMD74XX_OVERRIDE is not set
  10466. +# CONFIG_BLK_DEV_ATIIXP is not set
  10467. +# CONFIG_BLK_DEV_CMD64X is not set
  10468. +# CONFIG_BLK_DEV_TRIFLEX is not set
  10469. +# CONFIG_BLK_DEV_CY82C693 is not set
  10470. +# CONFIG_BLK_DEV_CS5530 is not set
  10471. +# CONFIG_BLK_DEV_HPT34X is not set
  10472. +# CONFIG_HPT34X_AUTODMA is not set
  10473. +# CONFIG_BLK_DEV_HPT366 is not set
  10474. +CONFIG_BLK_DEV_PIIX=y
  10475. +# CONFIG_BLK_DEV_NS87415 is not set
  10476. +# CONFIG_BLK_DEV_OPTI621 is not set
  10477. +# CONFIG_BLK_DEV_PDC202XX_OLD is not set
  10478. +# CONFIG_PDC202XX_BURST is not set
  10479. +# CONFIG_BLK_DEV_PDC202XX_NEW is not set
  10480. +# CONFIG_BLK_DEV_RZ1000 is not set
  10481. +# CONFIG_BLK_DEV_SC1200 is not set
  10482. +# CONFIG_BLK_DEV_SVWKS is not set
  10483. +# CONFIG_BLK_DEV_SIIMAGE is not set
  10484. +# CONFIG_BLK_DEV_SIS5513 is not set
  10485. +# CONFIG_BLK_DEV_SLC90E66 is not set
  10486. +# CONFIG_BLK_DEV_TRM290 is not set
  10487. +# CONFIG_BLK_DEV_VIA82CXXX is not set
  10488. +# CONFIG_IDE_CHIPSETS is not set
  10489. +CONFIG_IDEDMA_AUTO=y
  10490. +# CONFIG_IDEDMA_IVB is not set
  10491. +# CONFIG_DMA_NONPCI is not set
  10492. +# CONFIG_BLK_DEV_ATARAID is not set
  10493. +# CONFIG_BLK_DEV_ATARAID_PDC is not set
  10494. +# CONFIG_BLK_DEV_ATARAID_HPT is not set
  10495. +# CONFIG_BLK_DEV_ATARAID_MEDLEY is not set
  10496. +# CONFIG_BLK_DEV_ATARAID_SII is not set
  10497. #
  10498. # SCSI support
  10499. @@ -317,9 +390,11 @@ CONFIG_SD_EXTRA_DEVS=40
  10500. # CONFIG_SCSI_MEGARAID is not set
  10501. # CONFIG_SCSI_MEGARAID2 is not set
  10502. # CONFIG_SCSI_SATA is not set
  10503. +# CONFIG_SCSI_SATA_AHCI is not set
  10504. # CONFIG_SCSI_SATA_SVW is not set
  10505. # CONFIG_SCSI_ATA_PIIX is not set
  10506. # CONFIG_SCSI_SATA_NV is not set
  10507. +# CONFIG_SCSI_SATA_QSTOR is not set
  10508. # CONFIG_SCSI_SATA_PROMISE is not set
  10509. # CONFIG_SCSI_SATA_SX4 is not set
  10510. # CONFIG_SCSI_SATA_SIL is not set
  10511. @@ -477,7 +552,6 @@ CONFIG_SERIAL=y
  10512. CONFIG_SERIAL_CONSOLE=y
  10513. # CONFIG_SERIAL_EXTENDED is not set
  10514. # CONFIG_SERIAL_NONSTANDARD is not set
  10515. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  10516. CONFIG_UNIX98_PTYS=y
  10517. CONFIG_UNIX98_PTY_COUNT=256
  10518. --- a/arch/mips64/defconfig-ocelotc
  10519. +++ b/arch/mips64/defconfig-ocelotc
  10520. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  10521. # CONFIG_MIPS_PB1000 is not set
  10522. # CONFIG_MIPS_PB1100 is not set
  10523. # CONFIG_MIPS_PB1500 is not set
  10524. -# CONFIG_MIPS_HYDROGEN3 is not set
  10525. # CONFIG_MIPS_PB1550 is not set
  10526. +# CONFIG_MIPS_HYDROGEN3 is not set
  10527. # CONFIG_MIPS_XXS1500 is not set
  10528. # CONFIG_MIPS_MTX1 is not set
  10529. # CONFIG_COGENT_CSB250 is not set
  10530. @@ -231,11 +231,6 @@ CONFIG_IP_PNP_DHCP=y
  10531. #
  10532. # CONFIG_IPX is not set
  10533. # CONFIG_ATALK is not set
  10534. -
  10535. -#
  10536. -# Appletalk devices
  10537. -#
  10538. -# CONFIG_DEV_APPLETALK is not set
  10539. # CONFIG_DECNET is not set
  10540. # CONFIG_BRIDGE is not set
  10541. # CONFIG_X25 is not set
  10542. @@ -453,7 +448,6 @@ CONFIG_SERIAL_NONSTANDARD=y
  10543. # CONFIG_SERIAL_TXX9 is not set
  10544. # CONFIG_SERIAL_TXX9_CONSOLE is not set
  10545. # CONFIG_TXX927_SERIAL is not set
  10546. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  10547. CONFIG_UNIX98_PTYS=y
  10548. CONFIG_UNIX98_PTY_COUNT=256
  10549. --- a/arch/mips64/defconfig-sb1250-swarm
  10550. +++ b/arch/mips64/defconfig-sb1250-swarm
  10551. @@ -30,8 +30,8 @@ CONFIG_KMOD=y
  10552. # CONFIG_MIPS_PB1000 is not set
  10553. # CONFIG_MIPS_PB1100 is not set
  10554. # CONFIG_MIPS_PB1500 is not set
  10555. -# CONFIG_MIPS_HYDROGEN3 is not set
  10556. # CONFIG_MIPS_PB1550 is not set
  10557. +# CONFIG_MIPS_HYDROGEN3 is not set
  10558. # CONFIG_MIPS_XXS1500 is not set
  10559. # CONFIG_MIPS_MTX1 is not set
  10560. # CONFIG_COGENT_CSB250 is not set
  10561. @@ -90,6 +90,7 @@ CONFIG_SIBYTE_CFE=y
  10562. # CONFIG_SIBYTE_TBPROF is not set
  10563. CONFIG_SIBYTE_GENBUS_IDE=y
  10564. CONFIG_SMP_CAPABLE=y
  10565. +CONFIG_MIPS_RTC=y
  10566. # CONFIG_SNI_RM200_PCI is not set
  10567. # CONFIG_TANBAC_TB0226 is not set
  10568. # CONFIG_TANBAC_TB0229 is not set
  10569. @@ -253,11 +254,6 @@ CONFIG_INET=y
  10570. #
  10571. # CONFIG_IPX is not set
  10572. # CONFIG_ATALK is not set
  10573. -
  10574. -#
  10575. -# Appletalk devices
  10576. -#
  10577. -# CONFIG_DEV_APPLETALK is not set
  10578. # CONFIG_DECNET is not set
  10579. # CONFIG_BRIDGE is not set
  10580. # CONFIG_X25 is not set
  10581. @@ -432,7 +428,6 @@ CONFIG_SERIAL_NONSTANDARD=y
  10582. CONFIG_SIBYTE_SB1250_DUART=y
  10583. CONFIG_SIBYTE_SB1250_DUART_CONSOLE=y
  10584. CONFIG_SERIAL_CONSOLE=y
  10585. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  10586. CONFIG_UNIX98_PTYS=y
  10587. CONFIG_UNIX98_PTY_COUNT=256
  10588. --- a/arch/mips64/defconfig-sead
  10589. +++ b/arch/mips64/defconfig-sead
  10590. @@ -28,8 +28,8 @@ CONFIG_EXPERIMENTAL=y
  10591. # CONFIG_MIPS_PB1000 is not set
  10592. # CONFIG_MIPS_PB1100 is not set
  10593. # CONFIG_MIPS_PB1500 is not set
  10594. -# CONFIG_MIPS_HYDROGEN3 is not set
  10595. # CONFIG_MIPS_PB1550 is not set
  10596. +# CONFIG_MIPS_HYDROGEN3 is not set
  10597. # CONFIG_MIPS_XXS1500 is not set
  10598. # CONFIG_MIPS_MTX1 is not set
  10599. # CONFIG_COGENT_CSB250 is not set
  10600. @@ -242,7 +242,6 @@ CONFIG_SERIAL=y
  10601. CONFIG_SERIAL_CONSOLE=y
  10602. # CONFIG_SERIAL_EXTENDED is not set
  10603. # CONFIG_SERIAL_NONSTANDARD is not set
  10604. -# CONFIG_MIPS_HYDROGEN3_BUTTONS is not set
  10605. # CONFIG_UNIX98_PTYS is not set
  10606. #
  10607. --- a/arch/mips64/kernel/binfmt_elfn32.c
  10608. +++ b/arch/mips64/kernel/binfmt_elfn32.c
  10609. @@ -116,4 +116,7 @@ MODULE_AUTHOR("Ralf Baechle (ralf@linux-
  10610. #undef MODULE_DESCRIPTION
  10611. #undef MODULE_AUTHOR
  10612. +#undef TASK_SIZE
  10613. +#define TASK_SIZE TASK_SIZE32
  10614. +
  10615. #include "../../../fs/binfmt_elf.c"
  10616. --- a/arch/mips64/kernel/binfmt_elfo32.c
  10617. +++ b/arch/mips64/kernel/binfmt_elfo32.c
  10618. @@ -137,4 +137,7 @@ MODULE_AUTHOR("Ralf Baechle (ralf@linux-
  10619. #undef MODULE_DESCRIPTION
  10620. #undef MODULE_AUTHOR
  10621. +#undef TASK_SIZE
  10622. +#define TASK_SIZE TASK_SIZE32
  10623. +
  10624. #include "../../../fs/binfmt_elf.c"
  10625. --- a/arch/mips64/kernel/head.S
  10626. +++ b/arch/mips64/kernel/head.S
  10627. @@ -91,6 +91,21 @@ EXPORT(_stext)
  10628. __INIT
  10629. NESTED(kernel_entry, 16, sp) # kernel entry point
  10630. + .set push
  10631. + /*
  10632. + * For the moment disable interrupts, mark the kernel mode and
  10633. + * set ST0_KX so that the CPU does not spit fire when using
  10634. + * 64-bit addresses. A full initialization of the CPU's status
  10635. + * register is done later in per_cpu_trap_init().
  10636. + */
  10637. + mfc0 t0, CP0_STATUS
  10638. + or t0, ST0_CU0|ST0_KX|0x1f
  10639. + xor t0, 0x1f
  10640. + mtc0 t0, CP0_STATUS
  10641. +
  10642. + .set noreorder
  10643. + sll zero,3 # ehb
  10644. + .set reorder
  10645. ori sp, 0xf # align stack on 16 byte.
  10646. xori sp, 0xf
  10647. @@ -103,8 +118,6 @@ NESTED(kernel_entry, 16, sp) # kernel
  10648. ARC64_TWIDDLE_PC
  10649. - CLI # disable interrupts
  10650. -
  10651. /*
  10652. * The firmware/bootloader passes argc/argp/envp
  10653. * to us as arguments. But clear bss first because
  10654. @@ -125,6 +138,7 @@ NESTED(kernel_entry, 16, sp) # kernel
  10655. dsubu sp, 4*SZREG # init stack pointer
  10656. j init_arch
  10657. + .set pop
  10658. END(kernel_entry)
  10659. #ifdef CONFIG_SMP
  10660. @@ -133,6 +147,23 @@ NESTED(kernel_entry, 16, sp) # kernel
  10661. * function after setting up the stack and gp registers.
  10662. */
  10663. NESTED(smp_bootstrap, 16, sp)
  10664. + .set push
  10665. + /*
  10666. + * For the moment disable interrupts and bootstrap exception
  10667. + * vectors, mark the kernel mode and set ST0_KX so that the CPU
  10668. + * does not spit fire when using 64-bit addresses. A full
  10669. + * initialization of the CPU's status register is done later in
  10670. + * per_cpu_trap_init().
  10671. + */
  10672. + mfc0 t0, CP0_STATUS
  10673. + or t0, ST0_CU0|ST0_BEV|ST0_KX|0x1f
  10674. + xor t0, ST0_BEV|0x1f
  10675. + mtc0 t0, CP0_STATUS
  10676. +
  10677. + .set noreorder
  10678. + sll zero,3 # ehb
  10679. + .set reorder
  10680. +
  10681. #ifdef CONFIG_SGI_IP27
  10682. GET_NASID_ASM t1
  10683. dli t0, KLDIR_OFFSET + (KLI_KERN_VARS * KLDIR_ENT_SIZE) + \
  10684. @@ -146,19 +177,8 @@ NESTED(smp_bootstrap, 16, sp)
  10685. ARC64_TWIDDLE_PC
  10686. #endif /* CONFIG_SGI_IP27 */
  10687. - CLI
  10688. -
  10689. - /*
  10690. - * For the moment set ST0_KU so the CPU will not spit fire when
  10691. - * executing 64-bit instructions. The full initialization of the
  10692. - * CPU's status register is done later in per_cpu_trap_init().
  10693. - */
  10694. - mfc0 t0, CP0_STATUS
  10695. - or t0, ST0_KX
  10696. - mtc0 t0, CP0_STATUS
  10697. -
  10698. jal start_secondary # XXX: IP27: cboot
  10699. -
  10700. + .set pop
  10701. END(smp_bootstrap)
  10702. #endif /* CONFIG_SMP */
  10703. --- a/arch/mips64/kernel/ioctl32.c
  10704. +++ b/arch/mips64/kernel/ioctl32.c
  10705. @@ -2352,7 +2352,7 @@ static struct ioctl32_list ioctl32_handl
  10706. IOCTL32_HANDLER(AUTOFS_IOC_SETTIMEOUT32, ioc_settimeout),
  10707. IOCTL32_DEFAULT(AUTOFS_IOC_EXPIRE),
  10708. IOCTL32_DEFAULT(AUTOFS_IOC_EXPIRE_MULTI),
  10709. - IOCTL32_DEFAULT(AUTOFS_IOC_PROTSUBVER),
  10710. + IOCTL32_DEFAULT(AUTOFS_IOC_PROTOSUBVER),
  10711. IOCTL32_DEFAULT(AUTOFS_IOC_ASKREGHOST),
  10712. IOCTL32_DEFAULT(AUTOFS_IOC_TOGGLEREGHOST),
  10713. IOCTL32_DEFAULT(AUTOFS_IOC_ASKUMOUNT),
  10714. --- a/arch/mips64/kernel/linux32.c
  10715. +++ b/arch/mips64/kernel/linux32.c
  10716. @@ -1101,6 +1101,7 @@ do_readv_writev32(int type, struct file
  10717. * specially as they have atomicity guarantees and can handle
  10718. * iovec's natively
  10719. */
  10720. + inode = file->f_dentry->d_inode;
  10721. if (inode->i_sock) {
  10722. int err;
  10723. err = sock_readv_writev(type, inode, file, iov, count, tot_len);
  10724. @@ -1187,72 +1188,19 @@ bad_file:
  10725. lseek back to original location. They fail just like lseek does on
  10726. non-seekable files. */
  10727. -asmlinkage ssize_t sys32_pread(unsigned int fd, char * buf,
  10728. - size_t count, u32 unused, u64 a4, u64 a5)
  10729. +asmlinkage ssize_t sys32_pread(unsigned int fd, char *buf,
  10730. + size_t count, u32 unused, u64 a4, u64 a5)
  10731. {
  10732. - ssize_t ret;
  10733. - struct file * file;
  10734. - ssize_t (*read)(struct file *, char *, size_t, loff_t *);
  10735. - loff_t pos;
  10736. -
  10737. - ret = -EBADF;
  10738. - file = fget(fd);
  10739. - if (!file)
  10740. - goto bad_file;
  10741. - if (!(file->f_mode & FMODE_READ))
  10742. - goto out;
  10743. - pos = merge_64(a4, a5);
  10744. - ret = locks_verify_area(FLOCK_VERIFY_READ, file->f_dentry->d_inode,
  10745. - file, pos, count);
  10746. - if (ret)
  10747. - goto out;
  10748. - ret = -EINVAL;
  10749. - if (!file->f_op || !(read = file->f_op->read))
  10750. - goto out;
  10751. - if (pos < 0)
  10752. - goto out;
  10753. - ret = read(file, buf, count, &pos);
  10754. - if (ret > 0)
  10755. - dnotify_parent(file->f_dentry, DN_ACCESS);
  10756. -out:
  10757. - fput(file);
  10758. -bad_file:
  10759. - return ret;
  10760. + return sys_pread(fd, buf, count, merge_64(a4, a5));
  10761. }
  10762. asmlinkage ssize_t sys32_pwrite(unsigned int fd, const char * buf,
  10763. size_t count, u32 unused, u64 a4, u64 a5)
  10764. {
  10765. - ssize_t ret;
  10766. - struct file * file;
  10767. - ssize_t (*write)(struct file *, const char *, size_t, loff_t *);
  10768. - loff_t pos;
  10769. + return sys_pwrite(fd, buf, count, merge_64(a4, a5));
  10770. +}
  10771. - ret = -EBADF;
  10772. - file = fget(fd);
  10773. - if (!file)
  10774. - goto bad_file;
  10775. - if (!(file->f_mode & FMODE_WRITE))
  10776. - goto out;
  10777. - pos = merge_64(a4, a5);
  10778. - ret = locks_verify_area(FLOCK_VERIFY_WRITE, file->f_dentry->d_inode,
  10779. - file, pos, count);
  10780. - if (ret)
  10781. - goto out;
  10782. - ret = -EINVAL;
  10783. - if (!file->f_op || !(write = file->f_op->write))
  10784. - goto out;
  10785. - if (pos < 0)
  10786. - goto out;
  10787. - ret = write(file, buf, count, &pos);
  10788. - if (ret > 0)
  10789. - dnotify_parent(file->f_dentry, DN_MODIFY);
  10790. -out:
  10791. - fput(file);
  10792. -bad_file:
  10793. - return ret;
  10794. -}
  10795. /*
  10796. * Ooo, nasty. We need here to frob 32-bit unsigned longs to
  10797. * 64-bit unsigned longs.
  10798. --- a/arch/mips64/kernel/process.c
  10799. +++ b/arch/mips64/kernel/process.c
  10800. @@ -125,6 +125,25 @@ int dump_fpu(struct pt_regs *regs, elf_f
  10801. return 1;
  10802. }
  10803. +void dump_regs(elf_greg_t *gp, struct pt_regs *regs)
  10804. +{
  10805. + int i;
  10806. +
  10807. + for (i = 0; i < EF_REG0; i++)
  10808. + gp[i] = 0;
  10809. + gp[EF_REG0] = 0;
  10810. + for (i = 1; i <= 31; i++)
  10811. + gp[EF_REG0 + i] = regs->regs[i];
  10812. + gp[EF_REG26] = 0;
  10813. + gp[EF_REG27] = 0;
  10814. + gp[EF_LO] = regs->lo;
  10815. + gp[EF_HI] = regs->hi;
  10816. + gp[EF_CP0_EPC] = regs->cp0_epc;
  10817. + gp[EF_CP0_BADVADDR] = regs->cp0_badvaddr;
  10818. + gp[EF_CP0_STATUS] = regs->cp0_status;
  10819. + gp[EF_CP0_CAUSE] = regs->cp0_cause;
  10820. +}
  10821. +
  10822. /*
  10823. * Create a kernel thread
  10824. */
  10825. --- a/arch/mips64/kernel/scall_64.S
  10826. +++ b/arch/mips64/kernel/scall_64.S
  10827. @@ -102,15 +102,14 @@ _64_reschedule:
  10828. trace_a_syscall:
  10829. SAVE_STATIC
  10830. - sd t2,PT_R1(sp)
  10831. + move s0, t2
  10832. jal syscall_trace
  10833. - ld t2,PT_R1(sp)
  10834. ld a0, PT_R4(sp) # Restore argument registers
  10835. ld a1, PT_R5(sp)
  10836. ld a2, PT_R6(sp)
  10837. ld a3, PT_R7(sp)
  10838. - jalr t2
  10839. + jalr s0
  10840. li t0, -EMAXERRNO - 1 # error?
  10841. sltu t0, t0, v0
  10842. --- a/arch/mips64/kernel/scall_n32.S
  10843. +++ b/arch/mips64/kernel/scall_n32.S
  10844. @@ -106,15 +106,14 @@ n32_reschedule:
  10845. trace_a_syscall:
  10846. SAVE_STATIC
  10847. - sd t2,PT_R1(sp)
  10848. + move s0, t2
  10849. jal syscall_trace
  10850. - ld t2,PT_R1(sp)
  10851. ld a0, PT_R4(sp) # Restore argument registers
  10852. ld a1, PT_R5(sp)
  10853. ld a2, PT_R6(sp)
  10854. ld a3, PT_R7(sp)
  10855. - jalr t2
  10856. + jalr s0
  10857. li t0, -EMAXERRNO - 1 # error?
  10858. sltu t0, t0, v0
  10859. --- a/arch/mips64/kernel/scall_o32.S
  10860. +++ b/arch/mips64/kernel/scall_o32.S
  10861. @@ -118,9 +118,8 @@ trace_a_syscall:
  10862. sd a6, PT_R10(sp)
  10863. sd a7, PT_R11(sp)
  10864. - sd t2,PT_R1(sp)
  10865. + move s0, t2
  10866. jal syscall_trace
  10867. - ld t2,PT_R1(sp)
  10868. ld a0, PT_R4(sp) # Restore argument registers
  10869. ld a1, PT_R5(sp)
  10870. @@ -129,7 +128,7 @@ trace_a_syscall:
  10871. ld a4, PT_R8(sp)
  10872. ld a5, PT_R9(sp)
  10873. - jalr t2
  10874. + jalr s0
  10875. li t0, -EMAXERRNO - 1 # error?
  10876. sltu t0, t0, v0
  10877. @@ -576,6 +575,8 @@ out: jr ra
  10878. sys_call_table:
  10879. syscalltable
  10880. + .purgem sys
  10881. +
  10882. .macro sys function, nargs
  10883. .byte \nargs
  10884. .endm
  10885. --- a/arch/mips64/kernel/setup.c
  10886. +++ b/arch/mips64/kernel/setup.c
  10887. @@ -129,14 +129,6 @@ asmlinkage void __init init_arch(int arg
  10888. */
  10889. load_mmu();
  10890. - /*
  10891. - * On IP27, I am seeing the TS bit set when the kernel is loaded.
  10892. - * Maybe because the kernel is in ckseg0 and not xkphys? Clear it
  10893. - * anyway ...
  10894. - */
  10895. - clear_c0_status(ST0_BEV|ST0_TS|ST0_CU1|ST0_CU2|ST0_CU3);
  10896. - set_c0_status(ST0_CU0|ST0_KX|ST0_SX|ST0_FR);
  10897. -
  10898. start_kernel();
  10899. }
  10900. --- a/arch/mips64/kernel/signal_n32.c
  10901. +++ b/arch/mips64/kernel/signal_n32.c
  10902. @@ -68,7 +68,7 @@ struct rt_sigframe_n32 {
  10903. };
  10904. extern asmlinkage int restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc);
  10905. -extern int inline setup_sigcontext(struct pt_regs *regs, struct sigcontext *sc);
  10906. +extern int setup_sigcontext(struct pt_regs *regs, struct sigcontext *sc);
  10907. asmlinkage void sysn32_rt_sigreturn(abi64_no_regargs, struct pt_regs regs)
  10908. {
  10909. --- a/arch/mips64/kernel/traps.c
  10910. +++ b/arch/mips64/kernel/traps.c
  10911. @@ -462,9 +462,10 @@ static inline void simulate_ll(struct pt
  10912. }
  10913. ll_task = current;
  10914. + compute_return_epc(regs);
  10915. +
  10916. regs->regs[(opcode & RT) >> 16] = value;
  10917. - compute_return_epc(regs);
  10918. return;
  10919. sig:
  10920. @@ -495,8 +496,8 @@ static inline void simulate_sc(struct pt
  10921. goto sig;
  10922. }
  10923. if (ll_bit == 0 || ll_task != current) {
  10924. - regs->regs[reg] = 0;
  10925. compute_return_epc(regs);
  10926. + regs->regs[reg] = 0;
  10927. return;
  10928. }
  10929. @@ -505,9 +506,9 @@ static inline void simulate_sc(struct pt
  10930. goto sig;
  10931. }
  10932. + compute_return_epc(regs);
  10933. regs->regs[reg] = 1;
  10934. - compute_return_epc(regs);
  10935. return;
  10936. sig:
  10937. @@ -809,13 +810,18 @@ extern asmlinkage int fpu_emulator_resto
  10938. void __init per_cpu_trap_init(void)
  10939. {
  10940. unsigned int cpu = smp_processor_id();
  10941. + unsigned int status_set = ST0_CU0|ST0_FR|ST0_KX|ST0_SX|ST0_UX;
  10942. - /* Some firmware leaves the BEV flag set, clear it. */
  10943. - clear_c0_status(ST0_CU1|ST0_CU2|ST0_CU3|ST0_BEV);
  10944. - set_c0_status(ST0_CU0|ST0_FR|ST0_KX|ST0_SX|ST0_UX);
  10945. -
  10946. + /*
  10947. + * Disable coprocessors, enable 64-bit addressing and set FPU
  10948. + * for the 32/32 FPR register model. Reset the BEV flag that
  10949. + * some firmware may have left set and the TS bit (for IP27).
  10950. + * Set XX for ISA IV code to work.
  10951. + */
  10952. if (current_cpu_data.isa_level == MIPS_CPU_ISA_IV)
  10953. - set_c0_status(ST0_XX);
  10954. + status_set |= ST0_XX;
  10955. + change_c0_status(ST0_CU|ST0_FR|ST0_BEV|ST0_TS|ST0_KX|ST0_SX|ST0_UX,
  10956. + status_set);
  10957. /*
  10958. * Some MIPS CPUs have a dedicated interrupt vector which reduces the
  10959. @@ -825,13 +831,11 @@ void __init per_cpu_trap_init(void)
  10960. set_c0_cause(CAUSEF_IV);
  10961. cpu_data[cpu].asid_cache = ASID_FIRST_VERSION;
  10962. - write_c0_context(((long)(&pgd_current[cpu])) << 23);
  10963. - write_c0_wired(0);
  10964. + TLBMISS_HANDLER_SETUP();
  10965. atomic_inc(&init_mm.mm_count);
  10966. current->active_mm = &init_mm;
  10967. - if (current->mm)
  10968. - BUG();
  10969. + BUG_ON(current->mm);
  10970. enter_lazy_tlb(&init_mm, current, cpu);
  10971. }
  10972. @@ -842,8 +846,6 @@ void __init trap_init(void)
  10973. extern char except_vec4;
  10974. unsigned long i;
  10975. - per_cpu_trap_init();
  10976. -
  10977. /* Copy the generic exception handlers to their final destination. */
  10978. memcpy((void *) KSEG0 , &except_vec0_generic, 0x80);
  10979. memcpy((void *)(KSEG0 + 0x180), &except_vec3_generic, 0x80);
  10980. @@ -933,6 +935,5 @@ void __init trap_init(void)
  10981. flush_icache_range(KSEG0, KSEG0 + 0x400);
  10982. - atomic_inc(&init_mm.mm_count); /* XXX UP? */
  10983. - current->active_mm = &init_mm;
  10984. + per_cpu_trap_init();
  10985. }
  10986. --- a/arch/mips64/mm/cerr-sb1.c
  10987. +++ b/arch/mips64/mm/cerr-sb1.c
  10988. @@ -252,14 +252,14 @@ static const uint8_t parity[256] = {
  10989. /* Masks to select bits for Hamming parity, mask_72_64[i] for bit[i] */
  10990. static const uint64_t mask_72_64[8] = {
  10991. - 0x0738C808099264FFL,
  10992. - 0x38C808099264FF07L,
  10993. - 0xC808099264FF0738L,
  10994. - 0x08099264FF0738C8L,
  10995. - 0x099264FF0738C808L,
  10996. - 0x9264FF0738C80809L,
  10997. - 0x64FF0738C8080992L,
  10998. - 0xFF0738C808099264L
  10999. + 0x0738C808099264FFULL,
  11000. + 0x38C808099264FF07ULL,
  11001. + 0xC808099264FF0738ULL,
  11002. + 0x08099264FF0738C8ULL,
  11003. + 0x099264FF0738C808ULL,
  11004. + 0x9264FF0738C80809ULL,
  11005. + 0x64FF0738C8080992ULL,
  11006. + 0xFF0738C808099264ULL
  11007. };
  11008. /* Calculate the parity on a range of bits */
  11009. @@ -331,9 +331,9 @@ static uint32_t extract_ic(unsigned shor
  11010. ((lru >> 4) & 0x3),
  11011. ((lru >> 6) & 0x3));
  11012. }
  11013. - va = (taglo & 0xC0000FFFFFFFE000) | addr;
  11014. + va = (taglo & 0xC0000FFFFFFFE000ULL) | addr;
  11015. if ((taglo & (1 << 31)) && (((taglo >> 62) & 0x3) == 3))
  11016. - va |= 0x3FFFF00000000000;
  11017. + va |= 0x3FFFF00000000000ULL;
  11018. valid = ((taghi >> 29) & 1);
  11019. if (valid) {
  11020. tlo_tmp = taglo & 0xfff3ff;
  11021. @@ -474,7 +474,7 @@ static uint32_t extract_dc(unsigned shor
  11022. : "r" ((way << 13) | addr));
  11023. taglo = ((unsigned long long)taglohi << 32) | taglolo;
  11024. - pa = (taglo & 0xFFFFFFE000) | addr;
  11025. + pa = (taglo & 0xFFFFFFE000ULL) | addr;
  11026. if (way == 0) {
  11027. lru = (taghi >> 14) & 0xff;
  11028. prom_printf("[Bank %d Set 0x%02x] LRU > %d %d %d %d > MRU\n",
  11029. --- a/arch/mips64/mm/c-r4k.c
  11030. +++ b/arch/mips64/mm/c-r4k.c
  11031. @@ -867,9 +867,16 @@ static void __init probe_pcache(void)
  11032. * normally they'd suffer from aliases but magic in the hardware deals
  11033. * with that for us so we don't need to take care ourselves.
  11034. */
  11035. - if (c->cputype != CPU_R10000 && c->cputype != CPU_R12000)
  11036. - if (c->dcache.waysize > PAGE_SIZE)
  11037. - c->dcache.flags |= MIPS_CACHE_ALIASES;
  11038. + switch (c->cputype) {
  11039. + case CPU_R10000:
  11040. + case CPU_R12000:
  11041. + break;
  11042. + case CPU_24K:
  11043. + if (!(read_c0_config7() & (1 << 16)))
  11044. + default:
  11045. + if (c->dcache.waysize > PAGE_SIZE)
  11046. + c->dcache.flags |= MIPS_CACHE_ALIASES;
  11047. + }
  11048. switch (c->cputype) {
  11049. case CPU_20KC:
  11050. @@ -1070,9 +1077,6 @@ void __init ld_mmu_r4xx0(void)
  11051. setup_scache();
  11052. coherency_setup();
  11053. - if (c->dcache.sets * c->dcache.ways > PAGE_SIZE)
  11054. - c->dcache.flags |= MIPS_CACHE_ALIASES;
  11055. -
  11056. r4k_blast_dcache_page_setup();
  11057. r4k_blast_dcache_page_indexed_setup();
  11058. r4k_blast_dcache_setup();
  11059. --- a/arch/mips64/mm/tlbex-r4k.S
  11060. +++ b/arch/mips64/mm/tlbex-r4k.S
  11061. @@ -125,6 +125,33 @@ LEAF(except_vec1_r4k)
  11062. nop
  11063. END(except_vec1_r4k)
  11064. + __FINIT
  11065. +
  11066. + .align 5
  11067. +LEAF(handle_vec1_r4k)
  11068. + .set noat
  11069. + LOAD_PTE2 k1 k0 9f
  11070. + ld k0, 0(k1) # get even pte
  11071. + ld k1, 8(k1) # get odd pte
  11072. + PTE_RELOAD k0 k1
  11073. + mtc0_tlbw_hazard
  11074. + tlbwr
  11075. + tlbw_eret_hazard
  11076. + eret
  11077. +
  11078. +9: # handle the vmalloc range
  11079. + LOAD_KPTE2 k1 k0 invalid_vmalloc_address
  11080. + ld k0, 0(k1) # get even pte
  11081. + ld k1, 8(k1) # get odd pte
  11082. + PTE_RELOAD k0 k1
  11083. + mtc0_tlbw_hazard
  11084. + tlbwr
  11085. + tlbw_eret_hazard
  11086. + eret
  11087. +END(handle_vec1_r4k)
  11088. +
  11089. + __INIT
  11090. +
  11091. LEAF(except_vec1_sb1)
  11092. #if BCM1250_M3_WAR
  11093. dmfc0 k0, CP0_BADVADDR
  11094. @@ -134,28 +161,24 @@ LEAF(except_vec1_sb1)
  11095. bnez k0, 1f
  11096. #endif
  11097. .set noat
  11098. - dla k0, handle_vec1_r4k
  11099. + dla k0, handle_vec1_sb1
  11100. jr k0
  11101. nop
  11102. 1: eret
  11103. - nop
  11104. END(except_vec1_sb1)
  11105. __FINIT
  11106. .align 5
  11107. -LEAF(handle_vec1_r4k)
  11108. +LEAF(handle_vec1_sb1)
  11109. .set noat
  11110. LOAD_PTE2 k1 k0 9f
  11111. ld k0, 0(k1) # get even pte
  11112. ld k1, 8(k1) # get odd pte
  11113. PTE_RELOAD k0 k1
  11114. - rm9000_tlb_hazard
  11115. - b 1f
  11116. - tlbwr
  11117. -1: nop
  11118. - rm9000_tlb_hazard
  11119. + mtc0_tlbw_hazard
  11120. + tlbwr
  11121. eret
  11122. 9: # handle the vmalloc range
  11123. @@ -163,13 +186,10 @@ LEAF(handle_vec1_r4k)
  11124. ld k0, 0(k1) # get even pte
  11125. ld k1, 8(k1) # get odd pte
  11126. PTE_RELOAD k0 k1
  11127. - rm9000_tlb_hazard
  11128. - b 1f
  11129. - tlbwr
  11130. -1: nop
  11131. - rm9000_tlb_hazard
  11132. + mtc0_tlbw_hazard
  11133. + tlbwr
  11134. eret
  11135. -END(handle_vec1_r4k)
  11136. +END(handle_vec1_sb1)
  11137. __INIT
  11138. @@ -195,10 +215,8 @@ LEAF(handle_vec1_r10k)
  11139. ld k0, 0(k1) # get even pte
  11140. ld k1, 8(k1) # get odd pte
  11141. PTE_RELOAD k0 k1
  11142. - rm9000_tlb_hazard
  11143. - nop
  11144. + mtc0_tlbw_hazard
  11145. tlbwr
  11146. - rm9000_tlb_hazard
  11147. eret
  11148. 9: # handle the vmalloc range
  11149. @@ -206,10 +224,8 @@ LEAF(handle_vec1_r10k)
  11150. ld k0, 0(k1) # get even pte
  11151. ld k1, 8(k1) # get odd pte
  11152. PTE_RELOAD k0 k1
  11153. - rm9000_tlb_hazard
  11154. - nop
  11155. + mtc0_tlbw_hazard
  11156. tlbwr
  11157. - rm9000_tlb_hazard
  11158. eret
  11159. END(handle_vec1_r10k)
  11160. --- a/arch/mips64/mm/tlb-r4k.c
  11161. +++ b/arch/mips64/mm/tlb-r4k.c
  11162. @@ -1,24 +1,12 @@
  11163. /*
  11164. - * Carsten Langgaard, [email protected]
  11165. - * Copyright (C) 2002 MIPS Technologies, Inc. All rights reserved.
  11166. - *
  11167. - * This program is free software; you can distribute it and/or modify it
  11168. - * under the terms of the GNU General Public License (Version 2) as
  11169. - * published by the Free Software Foundation.
  11170. - *
  11171. - * This program is distributed in the hope it will be useful, but WITHOUT
  11172. - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11173. - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  11174. + * This file is subject to the terms and conditions of the GNU General Public
  11175. + * License. See the file "COPYING" in the main directory of this archive
  11176. * for more details.
  11177. *
  11178. - * You should have received a copy of the GNU General Public License along
  11179. - * with this program; if not, write to the Free Software Foundation, Inc.,
  11180. - * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  11181. - *
  11182. - * MIPS64 CPU variant specific MMU routines.
  11183. - * These routine are not optimized in any way, they are done in a generic way
  11184. - * so they can be used on all MIPS64 compliant CPUs, and also done in an
  11185. - * attempt not to break anything for the R4xx0 style CPUs.
  11186. + * Copyright (C) 1996 David S. Miller ([email protected])
  11187. + * Copyright (C) 1997, 1998, 1999, 2000 Ralf Baechle [email protected]
  11188. + * Carsten Langgaard, [email protected]
  11189. + * Copyright (C) 2002 MIPS Technologies, Inc. All rights reserved.
  11190. */
  11191. #include <linux/init.h>
  11192. #include <linux/sched.h>
  11193. @@ -30,9 +18,6 @@
  11194. #include <asm/pgtable.h>
  11195. #include <asm/system.h>
  11196. -#undef DEBUG_TLB
  11197. -#undef DEBUG_TLBUPDATE
  11198. -
  11199. extern void except_vec1_r4k(void);
  11200. /* CP0 hazard avoidance. */
  11201. @@ -46,31 +31,23 @@ void local_flush_tlb_all(void)
  11202. unsigned long old_ctx;
  11203. int entry;
  11204. -#ifdef DEBUG_TLB
  11205. - printk("[tlball]");
  11206. -#endif
  11207. -
  11208. local_irq_save(flags);
  11209. /* Save old context and create impossible VPN2 value */
  11210. old_ctx = read_c0_entryhi();
  11211. - write_c0_entryhi(XKPHYS);
  11212. write_c0_entrylo0(0);
  11213. write_c0_entrylo1(0);
  11214. - BARRIER;
  11215. entry = read_c0_wired();
  11216. /* Blast 'em all away. */
  11217. - while(entry < current_cpu_data.tlbsize) {
  11218. - /* Make sure all entries differ. */
  11219. - write_c0_entryhi(XKPHYS+entry*0x2000);
  11220. + while (entry < current_cpu_data.tlbsize) {
  11221. + write_c0_entryhi(XKPHYS + entry*0x2000);
  11222. write_c0_index(entry);
  11223. - BARRIER;
  11224. + mtc0_tlbw_hazard();
  11225. tlb_write_indexed();
  11226. - BARRIER;
  11227. entry++;
  11228. }
  11229. - BARRIER;
  11230. + tlbw_use_hazard();
  11231. write_c0_entryhi(old_ctx);
  11232. local_irq_restore(flags);
  11233. }
  11234. @@ -79,12 +56,8 @@ void local_flush_tlb_mm(struct mm_struct
  11235. {
  11236. int cpu = smp_processor_id();
  11237. - if (cpu_context(cpu, mm) != 0) {
  11238. -#ifdef DEBUG_TLB
  11239. - printk("[tlbmm<%d>]", mm->context);
  11240. -#endif
  11241. + if (cpu_context(cpu, mm) != 0)
  11242. drop_mmu_context(mm,cpu);
  11243. - }
  11244. }
  11245. void local_flush_tlb_range(struct mm_struct *mm, unsigned long start,
  11246. @@ -96,10 +69,6 @@ void local_flush_tlb_range(struct mm_str
  11247. unsigned long flags;
  11248. int size;
  11249. -#ifdef DEBUG_TLB
  11250. - printk("[tlbrange<%02x,%08lx,%08lx>]", (mm->context & ASID_MASK),
  11251. - start, end);
  11252. -#endif
  11253. local_irq_save(flags);
  11254. size = (end - start + (PAGE_SIZE - 1)) >> PAGE_SHIFT;
  11255. size = (size + 1) >> 1;
  11256. @@ -110,25 +79,25 @@ void local_flush_tlb_range(struct mm_str
  11257. start &= (PAGE_MASK << 1);
  11258. end += ((PAGE_SIZE << 1) - 1);
  11259. end &= (PAGE_MASK << 1);
  11260. - while(start < end) {
  11261. + while (start < end) {
  11262. int idx;
  11263. write_c0_entryhi(start | newpid);
  11264. start += (PAGE_SIZE << 1);
  11265. - BARRIER;
  11266. + mtc0_tlbw_hazard();
  11267. tlb_probe();
  11268. BARRIER;
  11269. idx = read_c0_index();
  11270. write_c0_entrylo0(0);
  11271. write_c0_entrylo1(0);
  11272. - if(idx < 0)
  11273. + if (idx < 0)
  11274. continue;
  11275. /* Make sure all entries differ. */
  11276. write_c0_entryhi(XKPHYS+idx*0x2000);
  11277. - BARRIER;
  11278. + mtc0_tlbw_hazard();
  11279. tlb_write_indexed();
  11280. - BARRIER;
  11281. }
  11282. + tlbw_use_hazard();
  11283. write_c0_entryhi(oldpid);
  11284. } else {
  11285. drop_mmu_context(mm, cpu);
  11286. @@ -145,28 +114,26 @@ void local_flush_tlb_page(struct vm_area
  11287. unsigned long flags;
  11288. unsigned long oldpid, newpid, idx;
  11289. -#ifdef DEBUG_TLB
  11290. - printk("[tlbpage<%d,%08lx>]", vma->vm_mm->context, page);
  11291. -#endif
  11292. newpid = cpu_asid(cpu, vma->vm_mm);
  11293. page &= (PAGE_MASK << 1);
  11294. local_irq_save(flags);
  11295. oldpid = read_c0_entryhi();
  11296. write_c0_entryhi(page | newpid);
  11297. - BARRIER;
  11298. + mtc0_tlbw_hazard();
  11299. tlb_probe();
  11300. BARRIER;
  11301. idx = read_c0_index();
  11302. write_c0_entrylo0(0);
  11303. write_c0_entrylo1(0);
  11304. - if(idx < 0)
  11305. + if (idx < 0)
  11306. goto finish;
  11307. /* Make sure all entries differ. */
  11308. write_c0_entryhi(XKPHYS+idx*0x2000);
  11309. - BARRIER;
  11310. + mtc0_tlbw_hazard();
  11311. tlb_write_indexed();
  11312. + tlbw_use_hazard();
  11313. +
  11314. finish:
  11315. - BARRIER;
  11316. write_c0_entryhi(oldpid);
  11317. local_irq_restore(flags);
  11318. }
  11319. @@ -186,7 +153,7 @@ void local_flush_tlb_one(unsigned long p
  11320. local_irq_save(flags);
  11321. write_c0_entryhi(page);
  11322. - BARRIER;
  11323. + mtc0_tlbw_hazard();
  11324. tlb_probe();
  11325. BARRIER;
  11326. idx = read_c0_index();
  11327. @@ -195,10 +162,12 @@ void local_flush_tlb_one(unsigned long p
  11328. if (idx >= 0) {
  11329. /* Make sure all entries differ. */
  11330. write_c0_entryhi(KSEG0+idx*0x2000);
  11331. + mtc0_tlbw_hazard();
  11332. tlb_write_indexed();
  11333. + tlbw_use_hazard();
  11334. }
  11335. - BARRIER;
  11336. write_c0_entryhi(oldpid);
  11337. +
  11338. local_irq_restore(flags);
  11339. }
  11340. @@ -208,7 +177,6 @@ void local_flush_tlb_one(unsigned long p
  11341. void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
  11342. {
  11343. unsigned long flags;
  11344. - unsigned int asid;
  11345. pgd_t *pgdp;
  11346. pmd_t *pmdp;
  11347. pte_t *ptep;
  11348. @@ -222,70 +190,58 @@ void __update_tlb(struct vm_area_struct
  11349. pid = read_c0_entryhi() & ASID_MASK;
  11350. -#ifdef DEBUG_TLB
  11351. - if ((pid != (cpu_asid(smp_processor_id(), vma->vm_mm))) ||
  11352. - (cpu_context(smp_processor_id(), vma->vm_mm) == 0)) {
  11353. - printk("update_mmu_cache: Wheee, bogus tlbpid mmpid=%d"
  11354. - "tlbpid=%d\n", (int) (cpu_context(smp_processor_id(),
  11355. - vma->vm_mm) & ASID_MASK), pid);
  11356. - }
  11357. -#endif
  11358. -
  11359. local_irq_save(flags);
  11360. address &= (PAGE_MASK << 1);
  11361. - write_c0_entryhi(address | (pid));
  11362. + write_c0_entryhi(address | pid);
  11363. pgdp = pgd_offset(vma->vm_mm, address);
  11364. - BARRIER;
  11365. + mtc0_tlbw_hazard();
  11366. tlb_probe();
  11367. BARRIER;
  11368. pmdp = pmd_offset(pgdp, address);
  11369. idx = read_c0_index();
  11370. ptep = pte_offset(pmdp, address);
  11371. - BARRIER;
  11372. write_c0_entrylo0(pte_val(*ptep++) >> 6);
  11373. write_c0_entrylo1(pte_val(*ptep) >> 6);
  11374. - write_c0_entryhi(address | (pid));
  11375. - BARRIER;
  11376. - if(idx < 0) {
  11377. + write_c0_entryhi(address | pid);
  11378. + mtc0_tlbw_hazard();
  11379. + if (idx < 0)
  11380. tlb_write_random();
  11381. - } else {
  11382. + else
  11383. tlb_write_indexed();
  11384. - }
  11385. - BARRIER;
  11386. + tlbw_use_hazard();
  11387. write_c0_entryhi(pid);
  11388. - BARRIER;
  11389. local_irq_restore(flags);
  11390. }
  11391. -void add_wired_entry(unsigned long entrylo0, unsigned long entrylo1,
  11392. - unsigned long entryhi, unsigned long pagemask)
  11393. +void __init add_wired_entry(unsigned long entrylo0, unsigned long entrylo1,
  11394. + unsigned long entryhi, unsigned long pagemask)
  11395. {
  11396. - unsigned long flags;
  11397. - unsigned long wired;
  11398. - unsigned long old_pagemask;
  11399. - unsigned long old_ctx;
  11400. -
  11401. - local_irq_save(flags);
  11402. - /* Save old context and create impossible VPN2 value */
  11403. - old_ctx = (read_c0_entryhi() & ASID_MASK);
  11404. - old_pagemask = read_c0_pagemask();
  11405. - wired = read_c0_wired();
  11406. - write_c0_wired(wired + 1);
  11407. - write_c0_index(wired);
  11408. - BARRIER;
  11409. - write_c0_pagemask(pagemask);
  11410. - write_c0_entryhi(entryhi);
  11411. - write_c0_entrylo0(entrylo0);
  11412. - write_c0_entrylo1(entrylo1);
  11413. - BARRIER;
  11414. - tlb_write_indexed();
  11415. - BARRIER;
  11416. -
  11417. - write_c0_entryhi(old_ctx);
  11418. - BARRIER;
  11419. - write_c0_pagemask(old_pagemask);
  11420. - local_flush_tlb_all();
  11421. - local_irq_restore(flags);
  11422. + unsigned long flags;
  11423. + unsigned long wired;
  11424. + unsigned long old_pagemask;
  11425. + unsigned long old_ctx;
  11426. +
  11427. + local_irq_save(flags);
  11428. + /* Save old context and create impossible VPN2 value */
  11429. + old_ctx = read_c0_entryhi() & ASID_MASK;
  11430. + old_pagemask = read_c0_pagemask();
  11431. + wired = read_c0_wired();
  11432. + write_c0_wired(wired + 1);
  11433. + write_c0_index(wired);
  11434. + BARRIER;
  11435. + write_c0_pagemask(pagemask);
  11436. + write_c0_entryhi(entryhi);
  11437. + write_c0_entrylo0(entrylo0);
  11438. + write_c0_entrylo1(entrylo1);
  11439. + mtc0_tlbw_hazard();
  11440. + tlb_write_indexed();
  11441. + tlbw_use_hazard();
  11442. +
  11443. + write_c0_entryhi(old_ctx);
  11444. + BARRIER;
  11445. + write_c0_pagemask(old_pagemask);
  11446. + local_flush_tlb_all();
  11447. + local_irq_restore(flags);
  11448. }
  11449. /*
  11450. @@ -317,17 +273,15 @@ __init int add_temporary_entry(unsigned
  11451. }
  11452. write_c0_index(temp_tlb_entry);
  11453. - BARRIER;
  11454. write_c0_pagemask(pagemask);
  11455. write_c0_entryhi(entryhi);
  11456. write_c0_entrylo0(entrylo0);
  11457. write_c0_entrylo1(entrylo1);
  11458. - BARRIER;
  11459. + mtc0_tlbw_hazard();
  11460. tlb_write_indexed();
  11461. - BARRIER;
  11462. + tlbw_use_hazard();
  11463. write_c0_entryhi(old_ctx);
  11464. - BARRIER;
  11465. write_c0_pagemask(old_pagemask);
  11466. out:
  11467. local_irq_restore(flags);
  11468. @@ -348,15 +302,23 @@ static void __init probe_tlb(unsigned lo
  11469. return;
  11470. config1 = read_c0_config1();
  11471. - if (!((config1 >> 7) & 3))
  11472. - panic("No MMU present");
  11473. + if (!((config >> 7) & 3))
  11474. + panic("No TLB present");
  11475. c->tlbsize = ((config1 >> 25) & 0x3f) + 1;
  11476. }
  11477. void __init r4k_tlb_init(void)
  11478. {
  11479. - unsigned long config = read_c0_config();
  11480. + unsigned int config = read_c0_config();
  11481. +
  11482. + /*
  11483. + * You should never change this register:
  11484. + * - On R4600 1.7 the tlbp never hits for pages smaller than
  11485. + * the value in the c0_pagemask register.
  11486. + * - The entire mm handling assumes the c0_pagemask register to
  11487. + * be set for 4kb pages.
  11488. + */
  11489. probe_tlb(config);
  11490. write_c0_pagemask(PM_DEFAULT_MASK);
  11491. write_c0_wired(0);
  11492. --- a/drivers/char/au1000_gpio.c
  11493. +++ b/drivers/char/au1000_gpio.c
  11494. @@ -246,7 +246,7 @@ static struct file_operations au1000gpio
  11495. static struct miscdevice au1000gpio_miscdev =
  11496. {
  11497. - GPIO_MINOR,
  11498. + MISC_DYNAMIC_MINOR,
  11499. "au1000_gpio",
  11500. &au1000gpio_fops
  11501. };
  11502. --- /dev/null
  11503. +++ b/drivers/char/au1550_psc_spi.c
  11504. @@ -0,0 +1,466 @@
  11505. +/*
  11506. + * Driver for Alchemy Au1550 SPI on the PSC.
  11507. + *
  11508. + * Copyright 2004 Embedded Edge, LLC.
  11509. + * [email protected]
  11510. + *
  11511. + * This program is free software; you can redistribute it and/or modify it
  11512. + * under the terms of the GNU General Public License as published by the
  11513. + * Free Software Foundation; either version 2 of the License, or (at your
  11514. + * option) any later version.
  11515. + *
  11516. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  11517. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  11518. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  11519. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  11520. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  11521. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  11522. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  11523. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  11524. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  11525. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  11526. + *
  11527. + * You should have received a copy of the GNU General Public License along
  11528. + * with this program; if not, write to the Free Software Foundation, Inc.,
  11529. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  11530. + */
  11531. +
  11532. +#include <linux/module.h>
  11533. +#include <linux/config.h>
  11534. +#include <linux/types.h>
  11535. +#include <linux/kernel.h>
  11536. +#include <linux/miscdevice.h>
  11537. +#include <linux/init.h>
  11538. +#include <asm/uaccess.h>
  11539. +#include <asm/io.h>
  11540. +#include <asm/au1000.h>
  11541. +#include <asm/au1550_spi.h>
  11542. +#include <asm/au1xxx_psc.h>
  11543. +
  11544. +#ifdef CONFIG_MIPS_PB1550
  11545. +#include <asm/pb1550.h>
  11546. +#endif
  11547. +
  11548. +#ifdef CONFIG_MIPS_DB1550
  11549. +#include <asm/db1x00.h>
  11550. +#endif
  11551. +
  11552. +#ifdef CONFIG_MIPS_PB1200
  11553. +#include <asm/pb1200.h>
  11554. +#endif
  11555. +
  11556. +/* This is just a simple programmed I/O SPI interface on the PSC of the 1550.
  11557. + * We support open, close, write, and ioctl. The SPI is a full duplex
  11558. + * interface, you can't read without writing. So, the write system call
  11559. + * copies the bytes out to the SPI, and whatever is returned is placed
  11560. + * in the same buffer. Kinda weird, maybe we'll change it, but for now
  11561. + * it works OK.
  11562. + * I didn't implement any DMA yet, and it's a debate about the necessity.
  11563. + * The SPI clocks are usually quite fast, so data is sent/received as
  11564. + * quickly as you can stuff the FIFO. The overhead of DMA and interrupts
  11565. + * are usually far greater than the data transfer itself. If, however,
  11566. + * we find applications that move large amounts of data, we may choose
  11567. + * use the overhead of buffering and DMA to do the work.
  11568. + */
  11569. +
  11570. +/* The maximum clock rate specified in the manual is 2mHz.
  11571. +*/
  11572. +#define MAX_BAUD_RATE (2 * 1000000)
  11573. +#define PSC_INTCLK_RATE (32 * 1000000)
  11574. +
  11575. +static int inuse;
  11576. +
  11577. +/* We have to know what the user requested for the data length
  11578. + * so we know how to stuff the fifo. The FIFO is 32 bits wide,
  11579. + * and we have to load it with the bits to go in a single transfer.
  11580. + */
  11581. +static uint spi_datalen;
  11582. +
  11583. +static int
  11584. +au1550spi_master_done( int ms )
  11585. +{
  11586. + int timeout=ms;
  11587. + volatile psc_spi_t *sp;
  11588. +
  11589. + sp = (volatile psc_spi_t *)SPI_PSC_BASE;
  11590. +
  11591. + /* Loop until MD is set or timeout has expired */
  11592. + while(!(sp->psc_spievent & PSC_SPIEVNT_MD) && timeout--) udelay(1000);
  11593. +
  11594. + if ( !timeout )
  11595. + return 0;
  11596. + else
  11597. + sp->psc_spievent |= PSC_SPIEVNT_MD;
  11598. +
  11599. + return 1;
  11600. +}
  11601. +
  11602. +static int
  11603. +au1550spi_open(struct inode *inode, struct file *file)
  11604. +{
  11605. + if (inuse)
  11606. + return -EBUSY;
  11607. +
  11608. + inuse = 1;
  11609. +
  11610. + MOD_INC_USE_COUNT;
  11611. +
  11612. + return 0;
  11613. +}
  11614. +
  11615. +static ssize_t
  11616. +au1550spi_write(struct file *fp, const char *bp, size_t count, loff_t *ppos)
  11617. +{
  11618. + int bytelen, i;
  11619. + size_t rcount, retval;
  11620. + unsigned char sb, *rp, *wp;
  11621. + uint fifoword, pcr, stat;
  11622. + volatile psc_spi_t *sp;
  11623. +
  11624. + /* Get the number of bytes per transfer.
  11625. + */
  11626. + bytelen = ((spi_datalen - 1) / 8) + 1;
  11627. +
  11628. + /* User needs to send us multiple of this count.
  11629. + */
  11630. + if ((count % bytelen) != 0)
  11631. + return -EINVAL;
  11632. +
  11633. + rp = wp = (unsigned char *)bp;
  11634. + retval = rcount = count;
  11635. +
  11636. + /* Reset the FIFO.
  11637. + */
  11638. + sp = (volatile psc_spi_t *)SPI_PSC_BASE;
  11639. + sp->psc_spipcr = (PSC_SPIPCR_RC | PSC_SPIPCR_TC);
  11640. + au_sync();
  11641. + do {
  11642. + pcr = sp->psc_spipcr;
  11643. + au_sync();
  11644. + } while (pcr != 0);
  11645. +
  11646. + /* Prime the transmit FIFO.
  11647. + */
  11648. + while (count > 0) {
  11649. + fifoword = 0;
  11650. + for (i=0; i<bytelen; i++) {
  11651. + fifoword <<= 8;
  11652. + if (get_user(sb, wp) < 0)
  11653. + return -EFAULT;
  11654. + fifoword |= sb;
  11655. + wp++;
  11656. + }
  11657. + count -= bytelen;
  11658. + if (count <= 0)
  11659. + fifoword |= PSC_SPITXRX_LC;
  11660. + sp->psc_spitxrx = fifoword;
  11661. + au_sync();
  11662. + stat = sp->psc_spistat;
  11663. + au_sync();
  11664. + if (stat & PSC_SPISTAT_TF)
  11665. + break;
  11666. + }
  11667. +
  11668. + /* Start the transfer.
  11669. + */
  11670. + sp->psc_spipcr = PSC_SPIPCR_MS;
  11671. + au_sync();
  11672. +
  11673. + /* Now, just keep the transmit fifo full and empty the receive.
  11674. + */
  11675. + while (count > 0) {
  11676. + stat = sp->psc_spistat;
  11677. + au_sync();
  11678. + while ((stat & PSC_SPISTAT_RE) == 0) {
  11679. + fifoword = sp->psc_spitxrx;
  11680. + au_sync();
  11681. + for (i=0; i<bytelen; i++) {
  11682. + sb = fifoword & 0xff;
  11683. + if (put_user(sb, rp) < 0)
  11684. + return -EFAULT;
  11685. + fifoword >>= 8;
  11686. + rp++;
  11687. + }
  11688. + rcount -= bytelen;
  11689. + stat = sp->psc_spistat;
  11690. + au_sync();
  11691. + }
  11692. + if ((stat & PSC_SPISTAT_TF) == 0) {
  11693. + fifoword = 0;
  11694. + for (i=0; i<bytelen; i++) {
  11695. + fifoword <<= 8;
  11696. + if (get_user(sb, wp) < 0)
  11697. + return -EFAULT;
  11698. + fifoword |= sb;
  11699. + wp++;
  11700. + }
  11701. + count -= bytelen;
  11702. + if (count <= 0)
  11703. + fifoword |= PSC_SPITXRX_LC;
  11704. + sp->psc_spitxrx = fifoword;
  11705. + au_sync();
  11706. + }
  11707. + }
  11708. +
  11709. + /* All of the bytes for transmit have been written. Hang
  11710. + * out waiting for any residual bytes that are yet to be
  11711. + * read from the fifo.
  11712. + */
  11713. + while (rcount > 0) {
  11714. + stat = sp->psc_spistat;
  11715. + au_sync();
  11716. + if ((stat & PSC_SPISTAT_RE) == 0) {
  11717. + fifoword = sp->psc_spitxrx;
  11718. + au_sync();
  11719. + for (i=0; i<bytelen; i++) {
  11720. + sb = fifoword & 0xff;
  11721. + if (put_user(sb, rp) < 0)
  11722. + return -EFAULT;
  11723. + fifoword >>= 8;
  11724. + rp++;
  11725. + }
  11726. + rcount -= bytelen;
  11727. + }
  11728. + }
  11729. +
  11730. + /* Wait for MasterDone event. 30ms timeout */
  11731. + if (!au1550spi_master_done(30) ) retval = -EFAULT;
  11732. + return retval;
  11733. +}
  11734. +
  11735. +static int
  11736. +au1550spi_release(struct inode *inode, struct file *file)
  11737. +{
  11738. + MOD_DEC_USE_COUNT;
  11739. +
  11740. + inuse = 0;
  11741. +
  11742. + return 0;
  11743. +}
  11744. +
  11745. +/* Set the baud rate closest to the request, then return the actual
  11746. + * value we are using.
  11747. + */
  11748. +static uint
  11749. +set_baud_rate(uint baud)
  11750. +{
  11751. + uint rate, tmpclk, brg, ctl, stat;
  11752. + volatile psc_spi_t *sp;
  11753. +
  11754. + /* For starters, the input clock is divided by two.
  11755. + */
  11756. + tmpclk = PSC_INTCLK_RATE/2;
  11757. +
  11758. + rate = tmpclk / baud;
  11759. +
  11760. + /* The dividers work as follows:
  11761. + * baud = tmpclk / (2 * (brg + 1))
  11762. + */
  11763. + brg = (rate/2) - 1;
  11764. +
  11765. + /* Test BRG to ensure it will fit into the 6 bits allocated.
  11766. + */
  11767. +
  11768. + /* Make sure the device is disabled while we make the change.
  11769. + */
  11770. + sp = (volatile psc_spi_t *)SPI_PSC_BASE;
  11771. + ctl = sp->psc_spicfg;
  11772. + au_sync();
  11773. + sp->psc_spicfg = ctl & ~PSC_SPICFG_DE_ENABLE;
  11774. + au_sync();
  11775. + ctl = PSC_SPICFG_CLR_BAUD(ctl);
  11776. + ctl |= PSC_SPICFG_SET_BAUD(brg);
  11777. + sp->psc_spicfg = ctl;
  11778. + au_sync();
  11779. +
  11780. + /* If the device was running prior to getting here, wait for
  11781. + * it to restart.
  11782. + */
  11783. + if (ctl & PSC_SPICFG_DE_ENABLE) {
  11784. + do {
  11785. + stat = sp->psc_spistat;
  11786. + au_sync();
  11787. + } while ((stat & PSC_SPISTAT_DR) == 0);
  11788. + }
  11789. +
  11790. + /* Return the actual value.
  11791. + */
  11792. + rate = tmpclk / (2 * (brg + 1));
  11793. +
  11794. + return(rate);
  11795. +}
  11796. +
  11797. +static uint
  11798. +set_word_len(uint len)
  11799. +{
  11800. + uint ctl, stat;
  11801. + volatile psc_spi_t *sp;
  11802. +
  11803. + if ((len < 4) || (len > 24))
  11804. + return -EINVAL;
  11805. +
  11806. + /* Make sure the device is disabled while we make the change.
  11807. + */
  11808. + sp = (volatile psc_spi_t *)SPI_PSC_BASE;
  11809. + ctl = sp->psc_spicfg;
  11810. + au_sync();
  11811. + sp->psc_spicfg = ctl & ~PSC_SPICFG_DE_ENABLE;
  11812. + au_sync();
  11813. + ctl = PSC_SPICFG_CLR_LEN(ctl);
  11814. + ctl |= PSC_SPICFG_SET_LEN(len);
  11815. + sp->psc_spicfg = ctl;
  11816. + au_sync();
  11817. +
  11818. + /* If the device was running prior to getting here, wait for
  11819. + * it to restart.
  11820. + */
  11821. + if (ctl & PSC_SPICFG_DE_ENABLE) {
  11822. + do {
  11823. + stat = sp->psc_spistat;
  11824. + au_sync();
  11825. + } while ((stat & PSC_SPISTAT_DR) == 0);
  11826. + }
  11827. +
  11828. + return 0;
  11829. +}
  11830. +
  11831. +static int
  11832. +au1550spi_ioctl(struct inode *inode, struct file *file,
  11833. + unsigned int cmd, unsigned long arg)
  11834. +{
  11835. + int status;
  11836. + u32 val;
  11837. +
  11838. + status = 0;
  11839. +
  11840. + switch(cmd) {
  11841. + case AU1550SPI_WORD_LEN:
  11842. + status = set_word_len(arg);
  11843. + break;
  11844. +
  11845. + case AU1550SPI_SET_BAUD:
  11846. + if (get_user(val, (u32 *)arg))
  11847. + return -EFAULT;
  11848. +
  11849. + val = set_baud_rate(val);
  11850. + if (put_user(val, (u32 *)arg))
  11851. + return -EFAULT;
  11852. + break;
  11853. +
  11854. + default:
  11855. + status = -ENOIOCTLCMD;
  11856. +
  11857. + }
  11858. +
  11859. + return status;
  11860. +}
  11861. +
  11862. +
  11863. +static struct file_operations au1550spi_fops =
  11864. +{
  11865. + owner: THIS_MODULE,
  11866. + write: au1550spi_write,
  11867. + ioctl: au1550spi_ioctl,
  11868. + open: au1550spi_open,
  11869. + release: au1550spi_release,
  11870. +};
  11871. +
  11872. +
  11873. +static struct miscdevice au1550spi_miscdev =
  11874. +{
  11875. + MISC_DYNAMIC_MINOR,
  11876. + "au1550_spi",
  11877. + &au1550spi_fops
  11878. +};
  11879. +
  11880. +
  11881. +int __init
  11882. +au1550spi_init(void)
  11883. +{
  11884. + uint clk, rate, stat;
  11885. + volatile psc_spi_t *sp;
  11886. +
  11887. + /* Wire up Freq3 as a clock for the SPI. The PSC does
  11888. + * factor of 2 divisor, so run a higher rate so we can
  11889. + * get some granularity to the clock speeds.
  11890. + * We can't do this in board set up because the frequency
  11891. + * is computed too late.
  11892. + */
  11893. + rate = get_au1x00_speed();
  11894. + rate /= PSC_INTCLK_RATE;
  11895. +
  11896. + /* The FRDIV in the frequency control is (FRDIV + 1) * 2
  11897. + */
  11898. + rate /=2;
  11899. + rate--;
  11900. + clk = au_readl(SYS_FREQCTRL1);
  11901. + au_sync();
  11902. + clk &= ~SYS_FC_FRDIV3_MASK;
  11903. + clk |= (rate << SYS_FC_FRDIV3_BIT);
  11904. + clk |= SYS_FC_FE3;
  11905. + au_writel(clk, SYS_FREQCTRL1);
  11906. + au_sync();
  11907. +
  11908. + /* Set up the clock source routing to get Freq3 to PSC0_intclk.
  11909. + */
  11910. + clk = au_readl(SYS_CLKSRC);
  11911. + au_sync();
  11912. + clk &= ~0x03e0;
  11913. + clk |= (5 << 7);
  11914. + au_writel(clk, SYS_CLKSRC);
  11915. + au_sync();
  11916. +
  11917. + /* Set up GPIO pin function to drive PSC0_SYNC1, which is
  11918. + * the SPI Select.
  11919. + */
  11920. + clk = au_readl(SYS_PINFUNC);
  11921. + au_sync();
  11922. + clk |= 1;
  11923. + au_writel(clk, SYS_PINFUNC);
  11924. + au_sync();
  11925. +
  11926. + /* Now, set up the PSC for SPI PIO mode.
  11927. + */
  11928. + sp = (volatile psc_spi_t *)SPI_PSC_BASE;
  11929. + sp->psc_ctrl = PSC_CTRL_DISABLE;
  11930. + au_sync();
  11931. + sp->psc_sel = PSC_SEL_PS_SPIMODE;
  11932. + sp->psc_spicfg = 0;
  11933. + au_sync();
  11934. + sp->psc_ctrl = PSC_CTRL_ENABLE;
  11935. + au_sync();
  11936. + do {
  11937. + stat = sp->psc_spistat;
  11938. + au_sync();
  11939. + } while ((stat & PSC_SPISTAT_SR) == 0);
  11940. +
  11941. + sp->psc_spicfg = (PSC_SPICFG_RT_FIFO8 | PSC_SPICFG_TT_FIFO8 |
  11942. + PSC_SPICFG_DD_DISABLE | PSC_SPICFG_MO);
  11943. + sp->psc_spicfg |= PSC_SPICFG_SET_LEN(8);
  11944. + spi_datalen = 8;
  11945. + sp->psc_spimsk = PSC_SPIMSK_ALLMASK;
  11946. + au_sync();
  11947. +
  11948. + set_baud_rate(1000000);
  11949. +
  11950. + sp->psc_spicfg |= PSC_SPICFG_DE_ENABLE;
  11951. + do {
  11952. + stat = sp->psc_spistat;
  11953. + au_sync();
  11954. + } while ((stat & PSC_SPISTAT_DR) == 0);
  11955. +
  11956. + misc_register(&au1550spi_miscdev);
  11957. + printk("Au1550 SPI driver\n");
  11958. + return 0;
  11959. +}
  11960. +
  11961. +
  11962. +void __exit
  11963. +au1550spi_exit(void)
  11964. +{
  11965. + misc_deregister(&au1550spi_miscdev);
  11966. +}
  11967. +
  11968. +
  11969. +module_init(au1550spi_init);
  11970. +module_exit(au1550spi_exit);
  11971. --- a/drivers/char/Config.in
  11972. +++ b/drivers/char/Config.in
  11973. @@ -320,14 +320,11 @@ fi
  11974. if [ "$CONFIG_OBSOLETE" = "y" -a "$CONFIG_ALPHA_BOOK1" = "y" ]; then
  11975. bool 'Tadpole ANA H8 Support (OBSOLETE)' CONFIG_H8
  11976. fi
  11977. -if [ "$CONFIG_MIPS" = "y" -a "$CONFIG_NEW_TIME_C" = "y" ]; then
  11978. - tristate 'Generic MIPS RTC Support' CONFIG_MIPS_RTC
  11979. -fi
  11980. if [ "$CONFIG_SGI_IP22" = "y" ]; then
  11981. - bool 'SGI DS1286 RTC support' CONFIG_SGI_DS1286
  11982. + tristate 'Dallas DS1286 RTC support' CONFIG_DS1286
  11983. fi
  11984. if [ "$CONFIG_SGI_IP27" = "y" ]; then
  11985. - bool 'SGI M48T35 RTC support' CONFIG_SGI_IP27_RTC
  11986. + tristate 'SGI M48T35 RTC support' CONFIG_SGI_IP27_RTC
  11987. fi
  11988. if [ "$CONFIG_TOSHIBA_RBTX4927" = "y" -o "$CONFIG_TOSHIBA_JMR3927" = "y" ]; then
  11989. tristate 'Dallas DS1742 RTC support' CONFIG_DS1742
  11990. @@ -390,6 +387,11 @@ if [ "$CONFIG_DRM" = "y" ]; then
  11991. source drivers/char/drm/Config.in
  11992. fi
  11993. fi
  11994. +
  11995. +if [ "$CONFIG_X86" = "y" ]; then
  11996. + tristate 'ACP Modem (Mwave) support' CONFIG_MWAVE
  11997. +fi
  11998. +
  11999. endmenu
  12000. if [ "$CONFIG_HOTPLUG" = "y" -a "$CONFIG_PCMCIA" != "n" ]; then
  12001. @@ -398,6 +400,7 @@ fi
  12002. if [ "$CONFIG_SOC_AU1X00" = "y" ]; then
  12003. tristate ' Alchemy Au1x00 GPIO device support' CONFIG_AU1X00_GPIO
  12004. tristate ' Au1000/ADS7846 touchscreen support' CONFIG_TS_AU1X00_ADS7846
  12005. + #tristate ' Alchemy Au1550 PSC SPI support' CONFIG_AU1550_PSC_SPI
  12006. fi
  12007. if [ "$CONFIG_MIPS_ITE8172" = "y" ]; then
  12008. tristate ' ITE GPIO' CONFIG_ITE_GPIO
  12009. --- a/drivers/char/decserial.c
  12010. +++ b/drivers/char/decserial.c
  12011. @@ -3,95 +3,105 @@
  12012. * choose the right serial device at boot time
  12013. *
  12014. * triemer 6-SEP-1998
  12015. - * sercons.c is designed to allow the three different kinds
  12016. + * sercons.c is designed to allow the three different kinds
  12017. * of serial devices under the decstation world to co-exist
  12018. - * in the same kernel. The idea here is to abstract
  12019. + * in the same kernel. The idea here is to abstract
  12020. * the pieces of the drivers that are common to this file
  12021. * so that they do not clash at compile time and runtime.
  12022. *
  12023. * HK 16-SEP-1998 v0.002
  12024. * removed the PROM console as this is not a real serial
  12025. * device. Added support for PROM console in drivers/char/tty_io.c
  12026. - * instead. Although it may work to enable more than one
  12027. + * instead. Although it may work to enable more than one
  12028. * console device I strongly recommend to use only one.
  12029. + *
  12030. + * Copyright (C) 2004 Maciej W. Rozycki
  12031. */
  12032. #include <linux/config.h>
  12033. +#include <linux/errno.h>
  12034. #include <linux/init.h>
  12035. +
  12036. #include <asm/dec/machtype.h>
  12037. +#include <asm/dec/serial.h>
  12038. +
  12039. +extern int register_zs_hook(unsigned int channel,
  12040. + struct dec_serial_hook *hook);
  12041. +extern int unregister_zs_hook(unsigned int channel);
  12042. +
  12043. +extern int register_dz_hook(unsigned int channel,
  12044. + struct dec_serial_hook *hook);
  12045. +extern int unregister_dz_hook(unsigned int channel);
  12046. +int register_dec_serial_hook(unsigned int channel,
  12047. + struct dec_serial_hook *hook)
  12048. +{
  12049. #ifdef CONFIG_ZS
  12050. -extern int zs_init(void);
  12051. + if (IOASIC)
  12052. + return register_zs_hook(channel, hook);
  12053. #endif
  12054. -
  12055. #ifdef CONFIG_DZ
  12056. -extern int dz_init(void);
  12057. + if (!IOASIC)
  12058. + return register_dz_hook(channel, hook);
  12059. #endif
  12060. + return 0;
  12061. +}
  12062. -#ifdef CONFIG_SERIAL_DEC_CONSOLE
  12063. -
  12064. +int unregister_dec_serial_hook(unsigned int channel)
  12065. +{
  12066. #ifdef CONFIG_ZS
  12067. -extern void zs_serial_console_init(void);
  12068. + if (IOASIC)
  12069. + return unregister_zs_hook(channel);
  12070. #endif
  12071. -
  12072. #ifdef CONFIG_DZ
  12073. -extern void dz_serial_console_init(void);
  12074. -#endif
  12075. -
  12076. + if (!IOASIC)
  12077. + return unregister_dz_hook(channel);
  12078. #endif
  12079. + return 0;
  12080. +}
  12081. -/* rs_init - starts up the serial interface -
  12082. - handle normal case of starting up the serial interface */
  12083. -#ifdef CONFIG_SERIAL_DEC
  12084. +extern int zs_init(void);
  12085. +extern int dz_init(void);
  12086. +/*
  12087. + * rs_init - starts up the serial interface -
  12088. + * handle normal case of starting up the serial interface
  12089. + */
  12090. int __init rs_init(void)
  12091. {
  12092. -
  12093. -#if defined(CONFIG_ZS) && defined(CONFIG_DZ)
  12094. - if (IOASIC)
  12095. - return zs_init();
  12096. - else
  12097. - return dz_init();
  12098. -#else
  12099. -
  12100. #ifdef CONFIG_ZS
  12101. - return zs_init();
  12102. + if (IOASIC)
  12103. + return zs_init();
  12104. #endif
  12105. -
  12106. #ifdef CONFIG_DZ
  12107. - return dz_init();
  12108. -#endif
  12109. -
  12110. + if (!IOASIC)
  12111. + return dz_init();
  12112. #endif
  12113. + return -ENXIO;
  12114. }
  12115. __initcall(rs_init);
  12116. -#endif
  12117. #ifdef CONFIG_SERIAL_DEC_CONSOLE
  12118. -/* dec_serial_console_init handles the special case of starting
  12119. - * up the console on the serial port
  12120. +extern void zs_serial_console_init(void);
  12121. +extern void dz_serial_console_init(void);
  12122. +
  12123. +/*
  12124. + * dec_serial_console_init handles the special case of starting
  12125. + * up the console on the serial port
  12126. */
  12127. void __init dec_serial_console_init(void)
  12128. {
  12129. -#if defined(CONFIG_ZS) && defined(CONFIG_DZ)
  12130. - if (IOASIC)
  12131. - zs_serial_console_init();
  12132. - else
  12133. - dz_serial_console_init();
  12134. -#else
  12135. -
  12136. #ifdef CONFIG_ZS
  12137. - zs_serial_console_init();
  12138. + if (IOASIC)
  12139. + zs_serial_console_init();
  12140. #endif
  12141. -
  12142. #ifdef CONFIG_DZ
  12143. - dz_serial_console_init();
  12144. -#endif
  12145. -
  12146. + if (!IOASIC)
  12147. + dz_serial_console_init();
  12148. #endif
  12149. }
  12150. --- a/drivers/char/ds1286.c
  12151. +++ b/drivers/char/ds1286.c
  12152. @@ -1,6 +1,10 @@
  12153. /*
  12154. * DS1286 Real Time Clock interface for Linux
  12155. *
  12156. + * Copyright (C) 2003 TimeSys Corp.
  12157. + * S. James Hill ([email protected])
  12158. + * ([email protected])
  12159. + *
  12160. * Copyright (C) 1998, 1999, 2000 Ralf Baechle
  12161. *
  12162. * Based on code written by Paul Gortmaker.
  12163. @@ -29,6 +33,7 @@
  12164. #include <linux/types.h>
  12165. #include <linux/errno.h>
  12166. #include <linux/miscdevice.h>
  12167. +#include <linux/module.h>
  12168. #include <linux/slab.h>
  12169. #include <linux/ioport.h>
  12170. #include <linux/fcntl.h>
  12171. @@ -95,6 +100,12 @@ static ssize_t ds1286_read(struct file *
  12172. return -EIO;
  12173. }
  12174. +void rtc_ds1286_wait(void)
  12175. +{
  12176. + unsigned char sec = CMOS_READ(RTC_SECONDS);
  12177. + while (sec == CMOS_READ(RTC_SECONDS));
  12178. +}
  12179. +
  12180. static int ds1286_ioctl(struct inode *inode, struct file *file,
  12181. unsigned int cmd, unsigned long arg)
  12182. {
  12183. @@ -249,23 +260,22 @@ static int ds1286_open(struct inode *ino
  12184. {
  12185. spin_lock_irq(&ds1286_lock);
  12186. - if (ds1286_status & RTC_IS_OPEN)
  12187. - goto out_busy;
  12188. + if (ds1286_status & RTC_IS_OPEN) {
  12189. + spin_unlock_irq(&ds1286_lock);
  12190. + return -EBUSY;
  12191. + }
  12192. ds1286_status |= RTC_IS_OPEN;
  12193. - spin_lock_irq(&ds1286_lock);
  12194. + spin_unlock_irq(&ds1286_lock);
  12195. return 0;
  12196. -
  12197. -out_busy:
  12198. - spin_lock_irq(&ds1286_lock);
  12199. - return -EBUSY;
  12200. }
  12201. static int ds1286_release(struct inode *inode, struct file *file)
  12202. {
  12203. + spin_lock_irq(&ds1286_lock);
  12204. ds1286_status &= ~RTC_IS_OPEN;
  12205. -
  12206. + spin_unlock_irq(&ds1286_lock);
  12207. return 0;
  12208. }
  12209. @@ -276,32 +286,6 @@ static unsigned int ds1286_poll(struct f
  12210. return 0;
  12211. }
  12212. -/*
  12213. - * The various file operations we support.
  12214. - */
  12215. -
  12216. -static struct file_operations ds1286_fops = {
  12217. - .llseek = no_llseek,
  12218. - .read = ds1286_read,
  12219. - .poll = ds1286_poll,
  12220. - .ioctl = ds1286_ioctl,
  12221. - .open = ds1286_open,
  12222. - .release = ds1286_release,
  12223. -};
  12224. -
  12225. -static struct miscdevice ds1286_dev=
  12226. -{
  12227. - .minor = RTC_MINOR,
  12228. - .name = "rtc",
  12229. - .fops = &ds1286_fops,
  12230. -};
  12231. -
  12232. -int __init ds1286_init(void)
  12233. -{
  12234. - printk(KERN_INFO "DS1286 Real Time Clock Driver v%s\n", DS1286_VERSION);
  12235. - return misc_register(&ds1286_dev);
  12236. -}
  12237. -
  12238. static char *days[] = {
  12239. "***", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
  12240. };
  12241. @@ -528,3 +512,38 @@ void ds1286_get_alm_time(struct rtc_time
  12242. BCD_TO_BIN(alm_tm->tm_hour);
  12243. alm_tm->tm_sec = 0;
  12244. }
  12245. +
  12246. +static struct file_operations ds1286_fops = {
  12247. + .owner = THIS_MODULE,
  12248. + .llseek = no_llseek,
  12249. + .read = ds1286_read,
  12250. + .poll = ds1286_poll,
  12251. + .ioctl = ds1286_ioctl,
  12252. + .open = ds1286_open,
  12253. + .release = ds1286_release,
  12254. +};
  12255. +
  12256. +static struct miscdevice ds1286_dev =
  12257. +{
  12258. + .minor = RTC_MINOR,
  12259. + .name = "rtc",
  12260. + .fops = &ds1286_fops,
  12261. +};
  12262. +
  12263. +static int __init ds1286_init(void)
  12264. +{
  12265. + printk(KERN_INFO "DS1286 Real Time Clock Driver v%s\n", DS1286_VERSION);
  12266. + return misc_register(&ds1286_dev);
  12267. +}
  12268. +
  12269. +static void __exit ds1286_exit(void)
  12270. +{
  12271. + misc_deregister(&ds1286_dev);
  12272. +}
  12273. +
  12274. +module_init(ds1286_init);
  12275. +module_exit(ds1286_exit);
  12276. +EXPORT_NO_SYMBOLS;
  12277. +
  12278. +MODULE_AUTHOR("Ralf Baechle");
  12279. +MODULE_LICENSE("GPL");
  12280. --- a/drivers/char/ds1742.c
  12281. +++ b/drivers/char/ds1742.c
  12282. @@ -142,6 +142,7 @@ static int rtc_ds1742_set_time(unsigned
  12283. CMOS_WRITE(RTC_WRITE, RTC_CONTROL);
  12284. /* convert */
  12285. + memset(&tm, 0, sizeof(struct rtc_time));
  12286. to_tm(t, &tm);
  12287. /* check each field one by one */
  12288. @@ -216,6 +217,7 @@ static int get_ds1742_status(char *buf)
  12289. unsigned long curr_time;
  12290. curr_time = rtc_ds1742_get_time();
  12291. + memset(&tm, 0, sizeof(struct rtc_time));
  12292. to_tm(curr_time, &tm);
  12293. p = buf;
  12294. @@ -251,8 +253,8 @@ static int ds1742_read_proc(char *page,
  12295. void rtc_ds1742_wait(void)
  12296. {
  12297. - while (CMOS_READ(RTC_SECONDS) & 1);
  12298. - while (!(CMOS_READ(RTC_SECONDS) & 1));
  12299. + unsigned char sec = CMOS_READ(RTC_SECONDS);
  12300. + while (sec == CMOS_READ(RTC_SECONDS));
  12301. }
  12302. static int ds1742_ioctl(struct inode *inode, struct file *file,
  12303. @@ -264,6 +266,7 @@ static int ds1742_ioctl(struct inode *in
  12304. switch (cmd) {
  12305. case RTC_RD_TIME: /* Read the time/date from RTC */
  12306. curr_time = rtc_ds1742_get_time();
  12307. + memset(&rtc_tm, 0, sizeof(struct rtc_time));
  12308. to_tm(curr_time, &rtc_tm);
  12309. rtc_tm.tm_year -= 1900;
  12310. return copy_to_user((void *) arg, &rtc_tm, sizeof(rtc_tm)) ?
  12311. --- a/drivers/char/dummy_keyb.c
  12312. +++ b/drivers/char/dummy_keyb.c
  12313. @@ -141,3 +141,7 @@ void __init kbd_init_hw(void)
  12314. {
  12315. printk("Dummy keyboard driver installed.\n");
  12316. }
  12317. +#ifdef CONFIG_MAGIC_SYSRQ
  12318. +unsigned char kbd_sysrq_key;
  12319. +unsigned char kbd_sysrq_xlate[128];
  12320. +#endif
  12321. --- a/drivers/char/dz.c
  12322. +++ b/drivers/char/dz.c
  12323. @@ -1,11 +1,13 @@
  12324. /*
  12325. - * dz.c: Serial port driver for DECStations equiped
  12326. + * dz.c: Serial port driver for DECstations equipped
  12327. * with the DZ chipset.
  12328. *
  12329. * Copyright (C) 1998 Olivier A. D. Lebaillif
  12330. *
  12331. * Email: [email protected]
  12332. *
  12333. + * Copyright (C) 2004 Maciej W. Rozycki
  12334. + *
  12335. * [31-AUG-98] triemer
  12336. * Changed IRQ to use Harald's dec internals interrupts.h
  12337. * removed base_addr code - moving address assignment to setup.c
  12338. @@ -24,6 +26,7 @@
  12339. #undef DEBUG_DZ
  12340. #include <linux/config.h>
  12341. +#include <linux/delay.h>
  12342. #include <linux/version.h>
  12343. #include <linux/kernel.h>
  12344. #include <linux/sched.h>
  12345. @@ -54,33 +57,56 @@
  12346. #include <asm/system.h>
  12347. #include <asm/uaccess.h>
  12348. -#define CONSOLE_LINE (3) /* for definition of struct console */
  12349. +#ifdef CONFIG_MAGIC_SYSRQ
  12350. +#include <linux/sysrq.h>
  12351. +#endif
  12352. #include "dz.h"
  12353. -#define DZ_INTR_DEBUG 1
  12354. -
  12355. DECLARE_TASK_QUEUE(tq_serial);
  12356. -static struct dz_serial *lines[4];
  12357. -static unsigned char tmp_buffer[256];
  12358. +static struct dz_serial multi[DZ_NB_PORT]; /* Four serial lines in the DZ chip */
  12359. +static struct tty_driver serial_driver, callout_driver;
  12360. +
  12361. +static struct tty_struct *serial_table[DZ_NB_PORT];
  12362. +static struct termios *serial_termios[DZ_NB_PORT];
  12363. +static struct termios *serial_termios_locked[DZ_NB_PORT];
  12364. +
  12365. +static int serial_refcount;
  12366. -#ifdef DEBUG_DZ
  12367. /*
  12368. - * debugging code to send out chars via prom
  12369. + * tmp_buf is used as a temporary buffer by serial_write. We need to
  12370. + * lock it in case the copy_from_user blocks while swapping in a page,
  12371. + * and some other program tries to do a serial write at the same time.
  12372. + * Since the lock will only come under contention when the system is
  12373. + * swapping and available memory is low, it makes sense to share one
  12374. + * buffer across all the serial ports, since it significantly saves
  12375. + * memory if large numbers of serial ports are open.
  12376. */
  12377. -static void debug_console(const char *s, int count)
  12378. -{
  12379. - unsigned i;
  12380. +static unsigned char *tmp_buf;
  12381. +static DECLARE_MUTEX(tmp_buf_sem);
  12382. - for (i = 0; i < count; i++) {
  12383. - if (*s == 10)
  12384. - prom_printf("%c", 13);
  12385. - prom_printf("%c", *s++);
  12386. - }
  12387. -}
  12388. +static char *dz_name __initdata = "DECstation DZ serial driver version ";
  12389. +static char *dz_version __initdata = "1.03";
  12390. +
  12391. +static struct dz_serial *lines[DZ_NB_PORT];
  12392. +static unsigned char tmp_buffer[256];
  12393. +
  12394. +#ifdef CONFIG_SERIAL_DEC_CONSOLE
  12395. +static struct console dz_sercons;
  12396. +#endif
  12397. +#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && \
  12398. + !defined(MODULE)
  12399. +static unsigned long break_pressed; /* break, really ... */
  12400. #endif
  12401. +static void change_speed (struct dz_serial *);
  12402. +
  12403. +static int baud_table[] = {
  12404. + 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800,
  12405. + 9600, 0
  12406. +};
  12407. +
  12408. /*
  12409. * ------------------------------------------------------------
  12410. * dz_in () and dz_out ()
  12411. @@ -94,15 +120,16 @@ static inline unsigned short dz_in(struc
  12412. {
  12413. volatile unsigned short *addr =
  12414. (volatile unsigned short *) (info->port + offset);
  12415. +
  12416. return *addr;
  12417. }
  12418. static inline void dz_out(struct dz_serial *info, unsigned offset,
  12419. unsigned short value)
  12420. {
  12421. -
  12422. volatile unsigned short *addr =
  12423. (volatile unsigned short *) (info->port + offset);
  12424. +
  12425. *addr = value;
  12426. }
  12427. @@ -143,25 +170,24 @@ static void dz_start(struct tty_struct *
  12428. tmp |= mask; /* set the TX flag */
  12429. dz_out(info, DZ_TCR, tmp);
  12430. -
  12431. }
  12432. /*
  12433. * ------------------------------------------------------------
  12434. - * Here starts the interrupt handling routines. All of the
  12435. - * following subroutines are declared as inline and are folded
  12436. - * into dz_interrupt. They were separated out for readability's
  12437. - * sake.
  12438. *
  12439. - * Note: rs_interrupt() is a "fast" interrupt, which means that it
  12440. + * Here starts the interrupt handling routines. All of the following
  12441. + * subroutines are declared as inline and are folded into
  12442. + * dz_interrupt(). They were separated out for readability's sake.
  12443. + *
  12444. + * Note: dz_interrupt() is a "fast" interrupt, which means that it
  12445. * runs with interrupts turned off. People who may want to modify
  12446. - * rs_interrupt() should try to keep the interrupt handler as fast as
  12447. + * dz_interrupt() should try to keep the interrupt handler as fast as
  12448. * possible. After you are done making modifications, it is not a bad
  12449. * idea to do:
  12450. *
  12451. * gcc -S -DKERNEL -Wall -Wstrict-prototypes -O6 -fomit-frame-pointer dz.c
  12452. *
  12453. - * and look at the resulting assemble code in serial.s.
  12454. + * and look at the resulting assemble code in dz.s.
  12455. *
  12456. * ------------------------------------------------------------
  12457. */
  12458. @@ -188,101 +214,97 @@ static inline void dz_sched_event(struct
  12459. * This routine deals with inputs from any lines.
  12460. * ------------------------------------------------------------
  12461. */
  12462. -static inline void receive_chars(struct dz_serial *info_in)
  12463. +static inline void receive_chars(struct dz_serial *info_in,
  12464. + struct pt_regs *regs)
  12465. {
  12466. -
  12467. struct dz_serial *info;
  12468. - struct tty_struct *tty = 0;
  12469. + struct tty_struct *tty;
  12470. struct async_icount *icount;
  12471. - int ignore = 0;
  12472. - unsigned short status, tmp;
  12473. - unsigned char ch;
  12474. -
  12475. - /* this code is going to be a problem...
  12476. - the call to tty_flip_buffer is going to need
  12477. - to be rethought...
  12478. - */
  12479. - do {
  12480. - status = dz_in(info_in, DZ_RBUF);
  12481. - info = lines[LINE(status)];
  12482. + int lines_rx[DZ_NB_PORT] = { [0 ... DZ_NB_PORT - 1] = 0 };
  12483. + unsigned short status;
  12484. + unsigned char ch, flag;
  12485. + int i;
  12486. - /* punt so we don't get duplicate characters */
  12487. - if (!(status & DZ_DVAL))
  12488. - goto ignore_char;
  12489. -
  12490. - ch = UCHAR(status); /* grab the char */
  12491. -
  12492. -#if 0
  12493. - if (info->is_console) {
  12494. - if (ch == 0)
  12495. - return; /* it's a break ... */
  12496. - }
  12497. -#endif
  12498. + while ((status = dz_in(info_in, DZ_RBUF)) & DZ_DVAL) {
  12499. + info = lines[LINE(status)];
  12500. + tty = info->tty; /* point to the proper dev */
  12501. - tty = info->tty; /* now tty points to the proper dev */
  12502. - icount = &info->icount;
  12503. + ch = UCHAR(status); /* grab the char */
  12504. - if (!tty)
  12505. - break;
  12506. - if (tty->flip.count >= TTY_FLIPBUF_SIZE)
  12507. - break;
  12508. + if (!tty && (!info->hook || !info->hook->rx_char))
  12509. + continue;
  12510. - *tty->flip.char_buf_ptr = ch;
  12511. - *tty->flip.flag_buf_ptr = 0;
  12512. + icount = &info->icount;
  12513. icount->rx++;
  12514. - /* keep track of the statistics */
  12515. - if (status & (DZ_OERR | DZ_FERR | DZ_PERR)) {
  12516. - if (status & DZ_PERR) /* parity error */
  12517. - icount->parity++;
  12518. - else if (status & DZ_FERR) /* frame error */
  12519. - icount->frame++;
  12520. - if (status & DZ_OERR) /* overrun error */
  12521. - icount->overrun++;
  12522. -
  12523. - /* check to see if we should ignore the character
  12524. - and mask off conditions that should be ignored
  12525. + flag = 0;
  12526. + if (status & DZ_FERR) { /* frame error */
  12527. + /*
  12528. + * There is no separate BREAK status bit, so
  12529. + * treat framing errors as BREAKs for Magic SysRq
  12530. + * and SAK; normally, otherwise.
  12531. */
  12532. -
  12533. - if (status & info->ignore_status_mask) {
  12534. - if (++ignore > 100)
  12535. - break;
  12536. - goto ignore_char;
  12537. +#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && \
  12538. + !defined(MODULE)
  12539. + if (info->line == dz_sercons.index) {
  12540. + if (!break_pressed)
  12541. + break_pressed = jiffies;
  12542. + continue;
  12543. }
  12544. - /* mask off the error conditions we want to ignore */
  12545. - tmp = status & info->read_status_mask;
  12546. -
  12547. - if (tmp & DZ_PERR) {
  12548. - *tty->flip.flag_buf_ptr = TTY_PARITY;
  12549. -#ifdef DEBUG_DZ
  12550. - debug_console("PERR\n", 5);
  12551. -#endif
  12552. - } else if (tmp & DZ_FERR) {
  12553. - *tty->flip.flag_buf_ptr = TTY_FRAME;
  12554. -#ifdef DEBUG_DZ
  12555. - debug_console("FERR\n", 5);
  12556. #endif
  12557. + flag = TTY_BREAK;
  12558. + if (info->flags & DZ_SAK)
  12559. + do_SAK(tty);
  12560. + else
  12561. + flag = TTY_FRAME;
  12562. + } else if (status & DZ_OERR) /* overrun error */
  12563. + flag = TTY_OVERRUN;
  12564. + else if (status & DZ_PERR) /* parity error */
  12565. + flag = TTY_PARITY;
  12566. +
  12567. +#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && \
  12568. + !defined(MODULE)
  12569. + if (break_pressed && info->line == dz_sercons.index) {
  12570. + if (time_before(jiffies, break_pressed + HZ * 5)) {
  12571. + handle_sysrq(ch, regs, NULL, NULL);
  12572. + break_pressed = 0;
  12573. + continue;
  12574. }
  12575. - if (tmp & DZ_OERR) {
  12576. -#ifdef DEBUG_DZ
  12577. - debug_console("OERR\n", 5);
  12578. + break_pressed = 0;
  12579. + }
  12580. #endif
  12581. - if (tty->flip.count < TTY_FLIPBUF_SIZE) {
  12582. - tty->flip.count++;
  12583. - tty->flip.flag_buf_ptr++;
  12584. - tty->flip.char_buf_ptr++;
  12585. - *tty->flip.flag_buf_ptr = TTY_OVERRUN;
  12586. - }
  12587. - }
  12588. +
  12589. + if (info->hook && info->hook->rx_char) {
  12590. + (*info->hook->rx_char)(ch, flag);
  12591. + return;
  12592. }
  12593. - tty->flip.flag_buf_ptr++;
  12594. - tty->flip.char_buf_ptr++;
  12595. - tty->flip.count++;
  12596. - ignore_char:
  12597. - } while (status & DZ_DVAL);
  12598. - if (tty)
  12599. - tty_flip_buffer_push(tty);
  12600. + /* keep track of the statistics */
  12601. + switch (flag) {
  12602. + case TTY_FRAME:
  12603. + icount->frame++;
  12604. + break;
  12605. + case TTY_PARITY:
  12606. + icount->parity++;
  12607. + break;
  12608. + case TTY_OVERRUN:
  12609. + icount->overrun++;
  12610. + break;
  12611. + case TTY_BREAK:
  12612. + icount->brk++;
  12613. + break;
  12614. + default:
  12615. + break;
  12616. + }
  12617. +
  12618. + if ((status & info->ignore_status_mask) == 0) {
  12619. + tty_insert_flip_char(tty, ch, flag);
  12620. + lines_rx[LINE(status)] = 1;
  12621. + }
  12622. + }
  12623. + for (i = 0; i < DZ_NB_PORT; i++)
  12624. + if (lines_rx[i])
  12625. + tty_flip_buffer_push(lines[i]->tty);
  12626. }
  12627. /*
  12628. @@ -292,20 +314,34 @@ static inline void receive_chars(struct
  12629. * This routine deals with outputs to any lines.
  12630. * ------------------------------------------------------------
  12631. */
  12632. -static inline void transmit_chars(struct dz_serial *info)
  12633. +static inline void transmit_chars(struct dz_serial *info_in)
  12634. {
  12635. + struct dz_serial *info;
  12636. + unsigned short status;
  12637. unsigned char tmp;
  12638. + status = dz_in(info_in, DZ_CSR);
  12639. + info = lines[LINE(status)];
  12640. + if (info->hook || !info->tty) {
  12641. + unsigned short mask, tmp;
  12642. - if (info->x_char) { /* XON/XOFF chars */
  12643. + mask = 1 << info->line;
  12644. + tmp = dz_in(info, DZ_TCR); /* read the TX flag */
  12645. + tmp &= ~mask; /* clear the TX flag */
  12646. + dz_out(info, DZ_TCR, tmp);
  12647. + return;
  12648. + }
  12649. +
  12650. + if (info->x_char) { /* XON/XOFF chars */
  12651. dz_out(info, DZ_TDR, info->x_char);
  12652. info->icount.tx++;
  12653. info->x_char = 0;
  12654. return;
  12655. }
  12656. /* if nothing to do or stopped or hardware stopped */
  12657. - if ((info->xmit_cnt <= 0) || info->tty->stopped || info->tty->hw_stopped) {
  12658. + if (info->xmit_cnt <= 0 ||
  12659. + info->tty->stopped || info->tty->hw_stopped) {
  12660. dz_stop(info->tty);
  12661. return;
  12662. }
  12663. @@ -359,15 +395,14 @@ static inline void check_modem_status(st
  12664. */
  12665. static void dz_interrupt(int irq, void *dev, struct pt_regs *regs)
  12666. {
  12667. - struct dz_serial *info;
  12668. + struct dz_serial *info = (struct dz_serial *)dev;
  12669. unsigned short status;
  12670. /* get the reason why we just got an irq */
  12671. - status = dz_in((struct dz_serial *) dev, DZ_CSR);
  12672. - info = lines[LINE(status)]; /* re-arrange info the proper port */
  12673. + status = dz_in(info, DZ_CSR);
  12674. if (status & DZ_RDONE)
  12675. - receive_chars(info); /* the receive function */
  12676. + receive_chars(info, regs);
  12677. if (status & DZ_TRDY)
  12678. transmit_chars(info);
  12679. @@ -514,7 +549,7 @@ static void shutdown(struct dz_serial *i
  12680. info->cflags &= ~DZ_CREAD; /* turn off receive enable flag */
  12681. - dz_out(info, DZ_LPR, info->cflags);
  12682. + dz_out(info, DZ_LPR, info->cflags | info->line);
  12683. if (info->xmit_buf) { /* free Tx buffer */
  12684. free_page((unsigned long) info->xmit_buf);
  12685. @@ -545,18 +580,21 @@ static void change_speed(struct dz_seria
  12686. {
  12687. unsigned long flags;
  12688. unsigned cflag;
  12689. - int baud;
  12690. + int baud, i;
  12691. - if (!info->tty || !info->tty->termios)
  12692. - return;
  12693. + if (!info->hook) {
  12694. + if (!info->tty || !info->tty->termios)
  12695. + return;
  12696. + cflag = info->tty->termios->c_cflag;
  12697. + } else {
  12698. + cflag = info->hook->cflags;
  12699. + }
  12700. save_flags(flags);
  12701. cli();
  12702. info->cflags = info->line;
  12703. - cflag = info->tty->termios->c_cflag;
  12704. -
  12705. switch (cflag & CSIZE) {
  12706. case CS5:
  12707. info->cflags |= DZ_CS5;
  12708. @@ -579,7 +617,16 @@ static void change_speed(struct dz_seria
  12709. if (cflag & PARODD)
  12710. info->cflags |= DZ_PARODD;
  12711. - baud = tty_get_baud_rate(info->tty);
  12712. + i = cflag & CBAUD;
  12713. + if (i & CBAUDEX) {
  12714. + i &= ~CBAUDEX;
  12715. + if (!info->hook)
  12716. + info->tty->termios->c_cflag &= ~CBAUDEX;
  12717. + else
  12718. + info->hook->cflags &= ~CBAUDEX;
  12719. + }
  12720. + baud = baud_table[i];
  12721. +
  12722. switch (baud) {
  12723. case 50:
  12724. info->cflags |= DZ_B50;
  12725. @@ -629,16 +676,16 @@ static void change_speed(struct dz_seria
  12726. }
  12727. info->cflags |= DZ_RXENAB;
  12728. - dz_out(info, DZ_LPR, info->cflags);
  12729. + dz_out(info, DZ_LPR, info->cflags | info->line);
  12730. /* setup accept flag */
  12731. info->read_status_mask = DZ_OERR;
  12732. - if (I_INPCK(info->tty))
  12733. + if (info->tty && I_INPCK(info->tty))
  12734. info->read_status_mask |= (DZ_FERR | DZ_PERR);
  12735. /* characters to ignore */
  12736. info->ignore_status_mask = 0;
  12737. - if (I_IGNPAR(info->tty))
  12738. + if (info->tty && I_IGNPAR(info->tty))
  12739. info->ignore_status_mask |= (DZ_FERR | DZ_PERR);
  12740. restore_flags(flags);
  12741. @@ -694,7 +741,7 @@ static int dz_write(struct tty_struct *t
  12742. down(&tmp_buf_sem);
  12743. while (1) {
  12744. - c = MIN(count, MIN(DZ_XMIT_SIZE - info->xmit_cnt - 1, DZ_XMIT_SIZE - info->xmit_head));
  12745. + c = min(count, min(DZ_XMIT_SIZE - info->xmit_cnt - 1, DZ_XMIT_SIZE - info->xmit_head));
  12746. if (c <= 0)
  12747. break;
  12748. @@ -707,7 +754,7 @@ static int dz_write(struct tty_struct *t
  12749. save_flags(flags);
  12750. cli();
  12751. - c = MIN(c, MIN(DZ_XMIT_SIZE - info->xmit_cnt - 1, DZ_XMIT_SIZE - info->xmit_head));
  12752. + c = min(c, min(DZ_XMIT_SIZE - info->xmit_cnt - 1, DZ_XMIT_SIZE - info->xmit_head));
  12753. memcpy(info->xmit_buf + info->xmit_head, tmp_buf, c);
  12754. info->xmit_head = ((info->xmit_head + c) & (DZ_XMIT_SIZE - 1));
  12755. info->xmit_cnt += c;
  12756. @@ -727,7 +774,7 @@ static int dz_write(struct tty_struct *t
  12757. save_flags(flags);
  12758. cli();
  12759. - c = MIN(count, MIN(DZ_XMIT_SIZE - info->xmit_cnt - 1, DZ_XMIT_SIZE - info->xmit_head));
  12760. + c = min(count, min(DZ_XMIT_SIZE - info->xmit_cnt - 1, DZ_XMIT_SIZE - info->xmit_head));
  12761. if (c <= 0) {
  12762. restore_flags(flags);
  12763. break;
  12764. @@ -845,7 +892,7 @@ static void dz_send_xchar(struct tty_str
  12765. /*
  12766. * ------------------------------------------------------------
  12767. - * rs_ioctl () and friends
  12768. + * dz_ioctl () and friends
  12769. * ------------------------------------------------------------
  12770. */
  12771. static int get_serial_info(struct dz_serial *info,
  12772. @@ -958,6 +1005,9 @@ static int dz_ioctl(struct tty_struct *t
  12773. struct dz_serial *info = (struct dz_serial *) tty->driver_data;
  12774. int retval;
  12775. + if (info->hook)
  12776. + return -ENODEV;
  12777. +
  12778. if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
  12779. (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGWILD) &&
  12780. (cmd != TIOCSERSWILD) && (cmd != TIOCSERGSTRUCT)) {
  12781. @@ -1252,19 +1302,14 @@ static int dz_open(struct tty_struct *tt
  12782. int retval, line;
  12783. line = MINOR(tty->device) - tty->driver.minor_start;
  12784. -
  12785. - /* The dz lines for the mouse/keyboard must be
  12786. - * opened using their respective drivers.
  12787. - */
  12788. if ((line < 0) || (line >= DZ_NB_PORT))
  12789. return -ENODEV;
  12790. + info = lines[line];
  12791. - if ((line == DZ_KEYBOARD) || (line == DZ_MOUSE))
  12792. + if (info->hook)
  12793. return -ENODEV;
  12794. - info = lines[line];
  12795. info->count++;
  12796. -
  12797. tty->driver_data = info;
  12798. info->tty = tty;
  12799. @@ -1285,14 +1330,21 @@ static int dz_open(struct tty_struct *tt
  12800. else
  12801. *tty->termios = info->callout_termios;
  12802. change_speed(info);
  12803. -
  12804. }
  12805. +#ifdef CONFIG_SERIAL_DEC_CONSOLE
  12806. + if (dz_sercons.cflag && dz_sercons.index == line) {
  12807. + tty->termios->c_cflag = dz_sercons.cflag;
  12808. + dz_sercons.cflag = 0;
  12809. + change_speed(info);
  12810. + }
  12811. +#endif
  12812. +
  12813. info->session = current->session;
  12814. info->pgrp = current->pgrp;
  12815. return 0;
  12816. }
  12817. -static void show_serial_version(void)
  12818. +static void __init show_serial_version(void)
  12819. {
  12820. printk("%s%s\n", dz_name, dz_version);
  12821. }
  12822. @@ -1300,7 +1352,6 @@ static void show_serial_version(void)
  12823. int __init dz_init(void)
  12824. {
  12825. int i;
  12826. - long flags;
  12827. struct dz_serial *info;
  12828. /* Setup base handler, and timer table. */
  12829. @@ -1311,9 +1362,9 @@ int __init dz_init(void)
  12830. memset(&serial_driver, 0, sizeof(struct tty_driver));
  12831. serial_driver.magic = TTY_DRIVER_MAGIC;
  12832. #if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
  12833. - serial_driver.name = "ttyS";
  12834. -#else
  12835. serial_driver.name = "tts/%d";
  12836. +#else
  12837. + serial_driver.name = "ttyS";
  12838. #endif
  12839. serial_driver.major = TTY_MAJOR;
  12840. serial_driver.minor_start = 64;
  12841. @@ -1352,9 +1403,9 @@ int __init dz_init(void)
  12842. */
  12843. callout_driver = serial_driver;
  12844. #if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
  12845. - callout_driver.name = "cua";
  12846. -#else
  12847. callout_driver.name = "cua/%d";
  12848. +#else
  12849. + callout_driver.name = "cua";
  12850. #endif
  12851. callout_driver.major = TTYAUX_MAJOR;
  12852. callout_driver.subtype = SERIAL_TYPE_CALLOUT;
  12853. @@ -1363,25 +1414,27 @@ int __init dz_init(void)
  12854. panic("Couldn't register serial driver");
  12855. if (tty_register_driver(&callout_driver))
  12856. panic("Couldn't register callout driver");
  12857. - save_flags(flags);
  12858. - cli();
  12859. for (i = 0; i < DZ_NB_PORT; i++) {
  12860. info = &multi[i];
  12861. lines[i] = info;
  12862. - info->magic = SERIAL_MAGIC;
  12863. -
  12864. + info->tty = 0;
  12865. + info->x_char = 0;
  12866. if (mips_machtype == MACH_DS23100 ||
  12867. mips_machtype == MACH_DS5100)
  12868. info->port = (unsigned long) KN01_DZ11_BASE;
  12869. else
  12870. info->port = (unsigned long) KN02_DZ11_BASE;
  12871. -
  12872. info->line = i;
  12873. - info->tty = 0;
  12874. +
  12875. + if (info->hook && info->hook->init_info) {
  12876. + (*info->hook->init_info)(info);
  12877. + continue;
  12878. + }
  12879. +
  12880. + info->magic = SERIAL_MAGIC;
  12881. info->close_delay = 50;
  12882. info->closing_wait = 3000;
  12883. - info->x_char = 0;
  12884. info->event = 0;
  12885. info->count = 0;
  12886. info->blocked_open = 0;
  12887. @@ -1393,25 +1446,16 @@ int __init dz_init(void)
  12888. info->normal_termios = serial_driver.init_termios;
  12889. init_waitqueue_head(&info->open_wait);
  12890. init_waitqueue_head(&info->close_wait);
  12891. -
  12892. - /*
  12893. - * If we are pointing to address zero then punt - not correctly
  12894. - * set up in setup.c to handle this.
  12895. - */
  12896. - if (!info->port)
  12897. - return 0;
  12898. -
  12899. - printk("ttyS%02d at 0x%08x (irq = %d)\n", info->line,
  12900. - info->port, dec_interrupt[DEC_IRQ_DZ11]);
  12901. -
  12902. + printk("ttyS%02d at 0x%08x (irq = %d) is a DC7085 DZ\n",
  12903. + info->line, info->port, dec_interrupt[DEC_IRQ_DZ11]);
  12904. tty_register_devfs(&serial_driver, 0,
  12905. - serial_driver.minor_start + info->line);
  12906. + serial_driver.minor_start + info->line);
  12907. tty_register_devfs(&callout_driver, 0,
  12908. - callout_driver.minor_start + info->line);
  12909. + callout_driver.minor_start + info->line);
  12910. }
  12911. - /* reset the chip */
  12912. #ifndef CONFIG_SERIAL_DEC_CONSOLE
  12913. + /* reset the chip */
  12914. dz_out(info, DZ_CSR, DZ_CLR);
  12915. while (dz_in(info, DZ_CSR) & DZ_CLR);
  12916. iob();
  12917. @@ -1420,43 +1464,104 @@ int __init dz_init(void)
  12918. dz_out(info, DZ_CSR, DZ_MSE);
  12919. #endif
  12920. - /* order matters here... the trick is that flags
  12921. - is updated... in request_irq - to immediatedly obliterate
  12922. - it is unwise. */
  12923. - restore_flags(flags);
  12924. -
  12925. -
  12926. if (request_irq(dec_interrupt[DEC_IRQ_DZ11], dz_interrupt,
  12927. - SA_INTERRUPT, "DZ", lines[0]))
  12928. + 0, "DZ", lines[0]))
  12929. panic("Unable to register DZ interrupt");
  12930. + for (i = 0; i < DZ_NB_PORT; i++)
  12931. + if (lines[i]->hook) {
  12932. + startup(lines[i]);
  12933. + if (lines[i]->hook->init_channel)
  12934. + (*lines[i]->hook->init_channel)(lines[i]);
  12935. + }
  12936. +
  12937. return 0;
  12938. }
  12939. -#ifdef CONFIG_SERIAL_DEC_CONSOLE
  12940. -static void dz_console_put_char(unsigned char ch)
  12941. +/*
  12942. + * polling I/O routines
  12943. + */
  12944. +static int dz_poll_tx_char(void *handle, unsigned char ch)
  12945. {
  12946. unsigned long flags;
  12947. - int loops = 2500;
  12948. - unsigned short tmp = ch;
  12949. - /* this code sends stuff out to serial device - spinning its
  12950. - wheels and waiting. */
  12951. + struct dz_serial *info = handle;
  12952. + unsigned short csr, tcr, trdy, mask;
  12953. + int loops = 10000;
  12954. + int ret;
  12955. - /* force the issue - point it at lines[3] */
  12956. - dz_console = &multi[CONSOLE_LINE];
  12957. + local_irq_save(flags);
  12958. + csr = dz_in(info, DZ_CSR);
  12959. + dz_out(info, DZ_CSR, csr & ~DZ_TIE);
  12960. + tcr = dz_in(info, DZ_TCR);
  12961. + tcr |= 1 << info->line;
  12962. + mask = tcr;
  12963. + dz_out(info, DZ_TCR, mask);
  12964. + iob();
  12965. + local_irq_restore(flags);
  12966. - save_flags(flags);
  12967. - cli();
  12968. + while (loops--) {
  12969. + trdy = dz_in(info, DZ_CSR);
  12970. + if (!(trdy & DZ_TRDY))
  12971. + continue;
  12972. + trdy = (trdy & DZ_TLINE) >> 8;
  12973. + if (trdy == info->line)
  12974. + break;
  12975. + mask &= ~(1 << trdy);
  12976. + dz_out(info, DZ_TCR, mask);
  12977. + iob();
  12978. + udelay(2);
  12979. + }
  12980. + if (loops) {
  12981. + dz_out(info, DZ_TDR, ch);
  12982. + ret = 0;
  12983. + } else
  12984. + ret = -EAGAIN;
  12985. - /* spin our wheels */
  12986. - while (((dz_in(dz_console, DZ_CSR) & DZ_TRDY) != DZ_TRDY) && loops--);
  12987. + dz_out(info, DZ_TCR, tcr);
  12988. + dz_out(info, DZ_CSR, csr);
  12989. - /* Actually transmit the character. */
  12990. - dz_out(dz_console, DZ_TDR, tmp);
  12991. + return ret;
  12992. +}
  12993. - restore_flags(flags);
  12994. +static int dz_poll_rx_char(void *handle)
  12995. +{
  12996. + return -ENODEV;
  12997. +}
  12998. +
  12999. +int register_dz_hook(unsigned int channel, struct dec_serial_hook *hook)
  13000. +{
  13001. + struct dz_serial *info = multi + channel;
  13002. +
  13003. + if (info->hook) {
  13004. + printk("%s: line %d has already a hook registered\n",
  13005. + __FUNCTION__, channel);
  13006. +
  13007. + return 0;
  13008. + } else {
  13009. + hook->poll_rx_char = dz_poll_rx_char;
  13010. + hook->poll_tx_char = dz_poll_tx_char;
  13011. + info->hook = hook;
  13012. +
  13013. + return 1;
  13014. + }
  13015. +}
  13016. +
  13017. +int unregister_dz_hook(unsigned int channel)
  13018. +{
  13019. + struct dz_serial *info = &multi[channel];
  13020. +
  13021. + if (info->hook) {
  13022. + info->hook = NULL;
  13023. + return 1;
  13024. + } else {
  13025. + printk("%s: trying to unregister hook on line %d,"
  13026. + " but none is registered\n", __FUNCTION__, channel);
  13027. + return 0;
  13028. + }
  13029. }
  13030. +
  13031. +#ifdef CONFIG_SERIAL_DEC_CONSOLE
  13032. /*
  13033. * -------------------------------------------------------------------
  13034. * dz_console_print ()
  13035. @@ -1465,17 +1570,19 @@ static void dz_console_put_char(unsigned
  13036. * The console must be locked when we get here.
  13037. * -------------------------------------------------------------------
  13038. */
  13039. -static void dz_console_print(struct console *cons,
  13040. +static void dz_console_print(struct console *co,
  13041. const char *str,
  13042. unsigned int count)
  13043. {
  13044. + struct dz_serial *info = multi + co->index;
  13045. +
  13046. #ifdef DEBUG_DZ
  13047. prom_printf((char *) str);
  13048. #endif
  13049. while (count--) {
  13050. if (*str == '\n')
  13051. - dz_console_put_char('\r');
  13052. - dz_console_put_char(*str++);
  13053. + dz_poll_tx_char(info, '\r');
  13054. + dz_poll_tx_char(info, *str++);
  13055. }
  13056. }
  13057. @@ -1486,12 +1593,12 @@ static kdev_t dz_console_device(struct c
  13058. static int __init dz_console_setup(struct console *co, char *options)
  13059. {
  13060. + struct dz_serial *info = multi + co->index;
  13061. int baud = 9600;
  13062. int bits = 8;
  13063. int parity = 'n';
  13064. int cflag = CREAD | HUPCL | CLOCAL;
  13065. char *s;
  13066. - unsigned short mask, tmp;
  13067. if (options) {
  13068. baud = simple_strtoul(options, NULL, 10);
  13069. @@ -1542,44 +1649,31 @@ static int __init dz_console_setup(struc
  13070. }
  13071. co->cflag = cflag;
  13072. - /* TOFIX: force to console line */
  13073. - dz_console = &multi[CONSOLE_LINE];
  13074. if ((mips_machtype == MACH_DS23100) || (mips_machtype == MACH_DS5100))
  13075. - dz_console->port = KN01_DZ11_BASE;
  13076. + info->port = KN01_DZ11_BASE;
  13077. else
  13078. - dz_console->port = KN02_DZ11_BASE;
  13079. - dz_console->line = CONSOLE_LINE;
  13080. + info->port = KN02_DZ11_BASE;
  13081. + info->line = co->index;
  13082. - dz_out(dz_console, DZ_CSR, DZ_CLR);
  13083. - while ((tmp = dz_in(dz_console, DZ_CSR)) & DZ_CLR);
  13084. + dz_out(info, DZ_CSR, DZ_CLR);
  13085. + while (dz_in(info, DZ_CSR) & DZ_CLR);
  13086. /* enable scanning */
  13087. - dz_out(dz_console, DZ_CSR, DZ_MSE);
  13088. + dz_out(info, DZ_CSR, DZ_MSE);
  13089. /* Set up flags... */
  13090. - dz_console->cflags = 0;
  13091. - dz_console->cflags |= DZ_B9600;
  13092. - dz_console->cflags |= DZ_CS8;
  13093. - dz_console->cflags |= DZ_PARENB;
  13094. - dz_out(dz_console, DZ_LPR, dz_console->cflags);
  13095. -
  13096. - mask = 1 << dz_console->line;
  13097. - tmp = dz_in(dz_console, DZ_TCR); /* read the TX flag */
  13098. - if (!(tmp & mask)) {
  13099. - tmp |= mask; /* set the TX flag */
  13100. - dz_out(dz_console, DZ_TCR, tmp);
  13101. - }
  13102. + dz_out(info, DZ_LPR, cflag | info->line);
  13103. +
  13104. return 0;
  13105. }
  13106. -static struct console dz_sercons =
  13107. -{
  13108. - .name = "ttyS",
  13109. - .write = dz_console_print,
  13110. - .device = dz_console_device,
  13111. - .setup = dz_console_setup,
  13112. - .flags = CON_CONSDEV | CON_PRINTBUFFER,
  13113. - .index = CONSOLE_LINE,
  13114. +static struct console dz_sercons = {
  13115. + .name = "ttyS",
  13116. + .write = dz_console_print,
  13117. + .device = dz_console_device,
  13118. + .setup = dz_console_setup,
  13119. + .flags = CON_PRINTBUFFER,
  13120. + .index = -1,
  13121. };
  13122. void __init dz_serial_console_init(void)
  13123. --- a/drivers/char/dz.h
  13124. +++ b/drivers/char/dz.h
  13125. @@ -10,6 +10,8 @@
  13126. #ifndef DZ_SERIAL_H
  13127. #define DZ_SERIAL_H
  13128. +#include <asm/dec/serial.h>
  13129. +
  13130. #define SERIAL_MAGIC 0x5301
  13131. /*
  13132. @@ -17,6 +19,7 @@
  13133. */
  13134. #define DZ_TRDY 0x8000 /* Transmitter empty */
  13135. #define DZ_TIE 0x4000 /* Transmitter Interrupt Enable */
  13136. +#define DZ_TLINE 0x0300 /* Transmitter Line Number */
  13137. #define DZ_RDONE 0x0080 /* Receiver data ready */
  13138. #define DZ_RIE 0x0040 /* Receive Interrupt Enable */
  13139. #define DZ_MSE 0x0020 /* Master Scan Enable */
  13140. @@ -37,19 +40,30 @@
  13141. #define UCHAR(x) (unsigned char)(x & DZ_RBUF_MASK)
  13142. /*
  13143. - * Definitions for the Transmit Register.
  13144. + * Definitions for the Transmit Control Register.
  13145. */
  13146. #define DZ_LINE_KEYBOARD 0x0001
  13147. #define DZ_LINE_MOUSE 0x0002
  13148. #define DZ_LINE_MODEM 0x0004
  13149. #define DZ_LINE_PRINTER 0x0008
  13150. +#define DZ_MODEM_RTS 0x0800 /* RTS for the modem line (2) */
  13151. #define DZ_MODEM_DTR 0x0400 /* DTR for the modem line (2) */
  13152. +#define DZ_PRINT_RTS 0x0200 /* RTS for the printer line (3) */
  13153. +#define DZ_PRINT_DTR 0x0100 /* DTR for the printer line (3) */
  13154. +#define DZ_LNENB 0x000f /* Transmitter Line Enable */
  13155. /*
  13156. * Definitions for the Modem Status Register.
  13157. */
  13158. +#define DZ_MODEM_RI 0x0800 /* RI for the modem line (2) */
  13159. +#define DZ_MODEM_CD 0x0400 /* CD for the modem line (2) */
  13160. #define DZ_MODEM_DSR 0x0200 /* DSR for the modem line (2) */
  13161. +#define DZ_MODEM_CTS 0x0100 /* CTS for the modem line (2) */
  13162. +#define DZ_PRINT_RI 0x0008 /* RI for the printer line (2) */
  13163. +#define DZ_PRINT_CD 0x0004 /* CD for the printer line (2) */
  13164. +#define DZ_PRINT_DSR 0x0002 /* DSR for the printer line (2) */
  13165. +#define DZ_PRINT_CTS 0x0001 /* CTS for the printer line (2) */
  13166. /*
  13167. * Definitions for the Transmit Data Register.
  13168. @@ -115,9 +129,6 @@
  13169. #define DZ_EVENT_WRITE_WAKEUP 0
  13170. -#ifndef MIN
  13171. -#define MIN(a,b) ((a) < (b) ? (a) : (b))
  13172. -
  13173. #define DZ_INITIALIZED 0x80000000 /* Serial port was initialized */
  13174. #define DZ_CALLOUT_ACTIVE 0x40000000 /* Call out device is active */
  13175. #define DZ_NORMAL_ACTIVE 0x20000000 /* Normal device is active */
  13176. @@ -129,6 +140,7 @@
  13177. #define DZ_CLOSING_WAIT_INF 0
  13178. #define DZ_CLOSING_WAIT_NONE 65535
  13179. +#define DZ_SAK 0x0004 /* Secure Attention Key (Orange book) */
  13180. #define DZ_SPLIT_TERMIOS 0x0008 /* Separate termios for dialin/callout */
  13181. #define DZ_SESSION_LOCKOUT 0x0100 /* Lock out cua opens based on session */
  13182. #define DZ_PGRP_LOCKOUT 0x0200 /* Lock out cua opens based on pgrp */
  13183. @@ -166,79 +178,9 @@ struct dz_serial {
  13184. long session; /* Session of opening process */
  13185. long pgrp; /* pgrp of opening process */
  13186. + struct dec_serial_hook *hook; /* Hook on this channel. */
  13187. unsigned char is_console; /* flag indicating a serial console */
  13188. unsigned char is_initialized;
  13189. };
  13190. -static struct dz_serial multi[DZ_NB_PORT]; /* Four serial lines in the DZ chip */
  13191. -static struct dz_serial *dz_console;
  13192. -static struct tty_driver serial_driver, callout_driver;
  13193. -
  13194. -static struct tty_struct *serial_table[DZ_NB_PORT];
  13195. -static struct termios *serial_termios[DZ_NB_PORT];
  13196. -static struct termios *serial_termios_locked[DZ_NB_PORT];
  13197. -
  13198. -static int serial_refcount;
  13199. -
  13200. -/*
  13201. - * tmp_buf is used as a temporary buffer by serial_write. We need to
  13202. - * lock it in case the copy_from_user blocks while swapping in a page,
  13203. - * and some other program tries to do a serial write at the same time.
  13204. - * Since the lock will only come under contention when the system is
  13205. - * swapping and available memory is low, it makes sense to share one
  13206. - * buffer across all the serial ports, since it significantly saves
  13207. - * memory if large numbers of serial ports are open.
  13208. - */
  13209. -static unsigned char *tmp_buf;
  13210. -static DECLARE_MUTEX(tmp_buf_sem);
  13211. -
  13212. -static char *dz_name = "DECstation DZ serial driver version ";
  13213. -static char *dz_version = "1.02";
  13214. -
  13215. -static inline unsigned short dz_in (struct dz_serial *, unsigned);
  13216. -static inline void dz_out (struct dz_serial *, unsigned, unsigned short);
  13217. -
  13218. -static inline void dz_sched_event (struct dz_serial *, int);
  13219. -static inline void receive_chars (struct dz_serial *);
  13220. -static inline void transmit_chars (struct dz_serial *);
  13221. -static inline void check_modem_status (struct dz_serial *);
  13222. -
  13223. -static void dz_stop (struct tty_struct *);
  13224. -static void dz_start (struct tty_struct *);
  13225. -static void dz_interrupt (int, void *, struct pt_regs *);
  13226. -static void do_serial_bh (void);
  13227. -static void do_softint (void *);
  13228. -static void do_serial_hangup (void *);
  13229. -static void change_speed (struct dz_serial *);
  13230. -static void dz_flush_chars (struct tty_struct *);
  13231. -static void dz_console_print (struct console *, const char *, unsigned int);
  13232. -static void dz_flush_buffer (struct tty_struct *);
  13233. -static void dz_throttle (struct tty_struct *);
  13234. -static void dz_unthrottle (struct tty_struct *);
  13235. -static void dz_send_xchar (struct tty_struct *, char);
  13236. -static void shutdown (struct dz_serial *);
  13237. -static void send_break (struct dz_serial *, int);
  13238. -static void dz_set_termios (struct tty_struct *, struct termios *);
  13239. -static void dz_close (struct tty_struct *, struct file *);
  13240. -static void dz_hangup (struct tty_struct *);
  13241. -static void show_serial_version (void);
  13242. -
  13243. -static int dz_write (struct tty_struct *, int, const unsigned char *, int);
  13244. -static int dz_write_room (struct tty_struct *);
  13245. -static int dz_chars_in_buffer (struct tty_struct *);
  13246. -static int startup (struct dz_serial *);
  13247. -static int get_serial_info (struct dz_serial *, struct serial_struct *);
  13248. -static int set_serial_info (struct dz_serial *, struct serial_struct *);
  13249. -static int get_lsr_info (struct dz_serial *, unsigned int *);
  13250. -static int dz_ioctl (struct tty_struct *, struct file *, unsigned int, unsigned long);
  13251. -static int block_til_ready (struct tty_struct *, struct file *, struct dz_serial *);
  13252. -static int dz_open (struct tty_struct *, struct file *);
  13253. -
  13254. -#ifdef MODULE
  13255. -int init_module (void)
  13256. -void cleanup_module (void)
  13257. -#endif
  13258. -
  13259. -#endif
  13260. -
  13261. #endif /* DZ_SERIAL_H */
  13262. --- /dev/null
  13263. +++ b/drivers/char/ibm_workpad_keymap.map
  13264. @@ -0,0 +1,343 @@
  13265. +# Keymap for IBM Workpad z50
  13266. +# US Mapping
  13267. +#
  13268. +# by Michael Klar <[email protected]>
  13269. +#
  13270. +# This is a great big mess on account of how the Caps Lock key is handled as
  13271. +# LeftShift-RightShift. Right shift key had to be broken out, so don't use
  13272. +# use this map file as a basis for other keyboards that don't do the same
  13273. +# thing with Caps Lock.
  13274. +#
  13275. +# This file is subject to the terms and conditions of the GNU General Public
  13276. +# License. See the file "COPYING" in the main directory of this archive
  13277. +# for more details.
  13278. +
  13279. +keymaps 0-2,4-5,8,12,32-33,36-37
  13280. +strings as usual
  13281. +
  13282. +keycode 0 = F1 F11 Console_13
  13283. + shiftr keycode 0 = F11
  13284. + shift shiftr keycode 0 = F11
  13285. + control keycode 0 = F1
  13286. + alt keycode 0 = Console_1
  13287. + control alt keycode 0 = Console_1
  13288. +keycode 1 = F3 F13 Console_15
  13289. + shiftr keycode 1 = F13
  13290. + shift shiftr keycode 1 = F13
  13291. + control keycode 1 = F3
  13292. + alt keycode 1 = Console_3
  13293. + control alt keycode 1 = Console_3
  13294. +keycode 2 = F5 F15 Console_17
  13295. + shiftr keycode 2 = F15
  13296. + shift shiftr keycode 2 = F15
  13297. + control keycode 2 = F5
  13298. + alt keycode 2 = Console_5
  13299. + control alt keycode 2 = Console_5
  13300. +keycode 3 = F7 F17 Console_19
  13301. + shiftr keycode 3 = F17
  13302. + shift shiftr keycode 3 = F17
  13303. + control keycode 3 = F7
  13304. + alt keycode 3 = Console_7
  13305. + control alt keycode 3 = Console_7
  13306. +keycode 4 = F9 F19 Console_21
  13307. + shiftr keycode 4 = F19
  13308. + shift shiftr keycode 4 = F19
  13309. + control keycode 4 = F9
  13310. + alt keycode 4 = Console_9
  13311. + control alt keycode 4 = Console_9
  13312. +#keycode 5 is contrast down
  13313. +#keycode 6 is contrast up
  13314. +keycode 7 = F11 F11 Console_23
  13315. + shiftr keycode 7 = F11
  13316. + shift shiftr keycode 7 = F11
  13317. + control keycode 7 = F11
  13318. + alt keycode 7 = Console_11
  13319. + control alt keycode 7 = Console_11
  13320. +keycode 8 = F2 F12 Console_14
  13321. + shiftr keycode 8 = F12
  13322. + shift shiftr keycode 8 = F12
  13323. + control keycode 8 = F2
  13324. + alt keycode 8 = Console_2
  13325. + control alt keycode 8 = Console_2
  13326. +keycode 9 = F4 F14 Console_16
  13327. + shiftr keycode 9 = F14
  13328. + shift shiftr keycode 9 = F14
  13329. + control keycode 9 = F4
  13330. + alt keycode 9 = Console_4
  13331. + control alt keycode 9 = Console_4
  13332. +keycode 10 = F6 F16 Console_18
  13333. + shiftr keycode 10 = F16
  13334. + shift shiftr keycode 10 = F16
  13335. + control keycode 10 = F6
  13336. + alt keycode 10 = Console_6
  13337. + control alt keycode 10 = Console_6
  13338. +keycode 11 = F8 F18 Console_20
  13339. + shiftr keycode 11 = F18
  13340. + shift shiftr keycode 11 = F18
  13341. + control keycode 11 = F8
  13342. + alt keycode 11 = Console_8
  13343. + control alt keycode 11 = Console_8
  13344. +keycode 12 = F10 F20 Console_22
  13345. + shiftr keycode 12 = F20
  13346. + shift shiftr keycode 12 = F20
  13347. + control keycode 12 = F10
  13348. + alt keycode 12 = Console_10
  13349. + control alt keycode 12 = Console_10
  13350. +#keycode 13 is brightness down
  13351. +#keycode 14 is brightness up
  13352. +keycode 15 = F12 F12 Console_24
  13353. + shiftr keycode 15 = F12
  13354. + shift shiftr keycode 15 = F12
  13355. + control keycode 15 = F12
  13356. + alt keycode 15 = Console_12
  13357. + control alt keycode 15 = Console_12
  13358. +keycode 16 = apostrophe quotedbl
  13359. + shiftr keycode 16 = quotedbl
  13360. + shift shiftr keycode 16 = quotedbl
  13361. + control keycode 16 = Control_g
  13362. + alt keycode 16 = Meta_apostrophe
  13363. +keycode 17 = bracketleft braceleft
  13364. + shiftr keycode 17 = braceleft
  13365. + shift shiftr keycode 17 = braceleft
  13366. + control keycode 17 = Escape
  13367. + alt keycode 17 = Meta_bracketleft
  13368. +keycode 18 = minus underscore backslash
  13369. + shiftr keycode 18 = underscore
  13370. + shift shiftr keycode 18 = underscore
  13371. + control keycode 18 = Control_underscore
  13372. + shift control keycode 18 = Control_underscore
  13373. + shiftr control keycode 18 = Control_underscore
  13374. + shift shiftr control keycode 18 = Control_underscore
  13375. + alt keycode 18 = Meta_minus
  13376. +keycode 19 = zero parenright braceright
  13377. + shiftr keycode 19 = parenright
  13378. + shift shiftr keycode 19 = parenright
  13379. + alt keycode 19 = Meta_zero
  13380. +keycode 20 = p
  13381. + shiftr keycode 20 = +P
  13382. + shift shiftr keycode 20 = +p
  13383. +keycode 21 = semicolon colon
  13384. + shiftr keycode 21 = colon
  13385. + shift shiftr keycode 21 = colon
  13386. + alt keycode 21 = Meta_semicolon
  13387. +keycode 22 = Up Scroll_Backward
  13388. + shiftr keycode 22 = Scroll_Backward
  13389. + shift shiftr keycode 22 = Scroll_Backward
  13390. + alt keycode 22 = Prior
  13391. +keycode 23 = slash question
  13392. + shiftr keycode 23 = question
  13393. + shift shiftr keycode 23 = question
  13394. + control keycode 23 = Delete
  13395. + alt keycode 23 = Meta_slash
  13396. +
  13397. +keycode 27 = nine parenleft bracketright
  13398. + shiftr keycode 27 = parenleft
  13399. + shift shiftr keycode 27 = parenleft
  13400. + alt keycode 27 = Meta_nine
  13401. +keycode 28 = o
  13402. + shiftr keycode 28 = +O
  13403. + shift shiftr keycode 28 = +o
  13404. +keycode 29 = l
  13405. + shiftr keycode 29 = +L
  13406. + shift shiftr keycode 29 = +l
  13407. +keycode 30 = period greater
  13408. + shiftr keycode 30 = greater
  13409. + shift shiftr keycode 30 = greater
  13410. + control keycode 30 = Compose
  13411. + alt keycode 30 = Meta_period
  13412. +
  13413. +keycode 32 = Left Decr_Console
  13414. + shiftr keycode 32 = Decr_Console
  13415. + shift shiftr keycode 32 = Decr_Console
  13416. + alt keycode 32 = Home
  13417. +keycode 33 = bracketright braceright asciitilde
  13418. + shiftr keycode 33 = braceright
  13419. + shift shiftr keycode 33 = braceright
  13420. + control keycode 33 = Control_bracketright
  13421. + alt keycode 33 = Meta_bracketright
  13422. +keycode 34 = equal plus
  13423. + shiftr keycode 34 = plus
  13424. + shift shiftr keycode 34 = plus
  13425. + alt keycode 34 = Meta_equal
  13426. +keycode 35 = eight asterisk bracketleft
  13427. + shiftr keycode 35 = asterisk
  13428. + shift shiftr keycode 35 = asterisk
  13429. + control keycode 35 = Delete
  13430. + alt keycode 35 = Meta_eight
  13431. +keycode 36 = i
  13432. + shiftr keycode 36 = +I
  13433. + shift shiftr keycode 36 = +i
  13434. +keycode 37 = k
  13435. + shiftr keycode 37 = +K
  13436. + shift shiftr keycode 37 = +k
  13437. +keycode 38 = comma less
  13438. + shiftr keycode 38 = less
  13439. + shift shiftr keycode 38 = less
  13440. + alt keycode 38 = Meta_comma
  13441. +
  13442. +keycode 40 = h
  13443. + shiftr keycode 40 = +H
  13444. + shift shiftr keycode 40 = +h
  13445. +keycode 41 = y
  13446. + shiftr keycode 41 = +Y
  13447. + shift shiftr keycode 41 = +y
  13448. +keycode 42 = six asciicircum
  13449. + shiftr keycode 42 = asciicircum
  13450. + shift shiftr keycode 42 = asciicircum
  13451. + control keycode 42 = Control_asciicircum
  13452. + alt keycode 42 = Meta_six
  13453. +keycode 43 = seven ampersand braceleft
  13454. + shiftr keycode 43 = ampersand
  13455. + shift shiftr keycode 43 = ampersand
  13456. + control keycode 43 = Control_underscore
  13457. + alt keycode 43 = Meta_seven
  13458. +keycode 44 = u
  13459. + shiftr keycode 44 = +U
  13460. + shift shiftr keycode 44 = +u
  13461. +keycode 45 = j
  13462. + shiftr keycode 45 = +J
  13463. + shift shiftr keycode 45 = +j
  13464. +keycode 46 = m
  13465. + shiftr keycode 46 = +M
  13466. + shift shiftr keycode 46 = +m
  13467. +keycode 47 = n
  13468. + shiftr keycode 47 = +N
  13469. + shift shiftr keycode 47 = +n
  13470. +
  13471. +# This is the "Backspace" key:
  13472. +keycode 49 = Delete Delete
  13473. + shiftr keycode 49 = Delete
  13474. + shift shiftr keycode 49 = Delete
  13475. + control keycode 49 = BackSpace
  13476. + alt keycode 49 = Meta_Delete
  13477. +keycode 50 = Num_Lock
  13478. + shift keycode 50 = Bare_Num_Lock
  13479. + shiftr keycode 50 = Bare_Num_Lock
  13480. + shift shiftr keycode 50 = Bare_Num_Lock
  13481. +# This is the "Delete" key:
  13482. +keycode 51 = Remove
  13483. + control alt keycode 51 = Boot
  13484. +
  13485. +keycode 53 = backslash bar
  13486. + shiftr keycode 53 = bar
  13487. + shift shiftr keycode 53 = bar
  13488. + control keycode 53 = Control_backslash
  13489. + alt keycode 53 = Meta_backslash
  13490. +keycode 54 = Return
  13491. + alt keycode 54 = Meta_Control_m
  13492. +keycode 55 = space space
  13493. + shiftr keycode 55 = space
  13494. + shift shiftr keycode 55 = space
  13495. + control keycode 55 = nul
  13496. + alt keycode 55 = Meta_space
  13497. +keycode 56 = g
  13498. + shiftr keycode 56 = +G
  13499. + shift shiftr keycode 56 = +g
  13500. +keycode 57 = t
  13501. + shiftr keycode 57 = +T
  13502. + shift shiftr keycode 57 = +t
  13503. +keycode 58 = five percent
  13504. + shiftr keycode 58 = percent
  13505. + shift shiftr keycode 58 = percent
  13506. + control keycode 58 = Control_bracketright
  13507. + alt keycode 58 = Meta_five
  13508. +keycode 59 = four dollar dollar
  13509. + shiftr keycode 59 = dollar
  13510. + shift shiftr keycode 59 = dollar
  13511. + control keycode 59 = Control_backslash
  13512. + alt keycode 59 = Meta_four
  13513. +keycode 60 = r
  13514. + shiftr keycode 60 = +R
  13515. + shift shiftr keycode 60 = +r
  13516. +keycode 61 = f
  13517. + shiftr keycode 61 = +F
  13518. + shift shiftr keycode 61 = +f
  13519. + altgr keycode 61 = Hex_F
  13520. +keycode 62 = v
  13521. + shiftr keycode 62 = +V
  13522. + shift shiftr keycode 62 = +v
  13523. +keycode 63 = b
  13524. + shiftr keycode 63 = +B
  13525. + shift shiftr keycode 63 = +b
  13526. + altgr keycode 63 = Hex_B
  13527. +
  13528. +keycode 67 = three numbersign
  13529. + shiftr keycode 67 = numbersign
  13530. + shift shiftr keycode 67 = numbersign
  13531. + control keycode 67 = Escape
  13532. + alt keycode 67 = Meta_three
  13533. +keycode 68 = e
  13534. + shiftr keycode 68 = +E
  13535. + shift shiftr keycode 68 = +e
  13536. + altgr keycode 68 = Hex_E
  13537. +keycode 69 = d
  13538. + shiftr keycode 69 = +D
  13539. + shift shiftr keycode 69 = +d
  13540. + altgr keycode 69 = Hex_D
  13541. +keycode 70 = c
  13542. + shiftr keycode 70 = +C
  13543. + shift shiftr keycode 70 = +c
  13544. + altgr keycode 70 = Hex_C
  13545. +keycode 71 = Right Incr_Console
  13546. + shiftr keycode 71 = Incr_Console
  13547. + shift shiftr keycode 71 = Incr_Console
  13548. + alt keycode 71 = End
  13549. +
  13550. +keycode 75 = two at at
  13551. + shiftr keycode 75 = at
  13552. + shift shiftr keycode 75 = at
  13553. + control keycode 75 = nul
  13554. + shift control keycode 75 = nul
  13555. + shiftr control keycode 75 = nul
  13556. + shift shiftr control keycode 75 = nul
  13557. + alt keycode 75 = Meta_two
  13558. +keycode 76 = w
  13559. + shiftr keycode 76 = +W
  13560. + shift shiftr keycode 76 = +w
  13561. +keycode 77 = s
  13562. + shiftr keycode 77 = +S
  13563. + shift shiftr keycode 77 = +s
  13564. +keycode 78 = x
  13565. + shiftr keycode 78 = +X
  13566. + shift shiftr keycode 78 = +x
  13567. +keycode 79 = Down Scroll_Forward
  13568. + shiftr keycode 79 = Scroll_Forward
  13569. + shift shiftr keycode 79 = Scroll_Forward
  13570. + alt keycode 79 = Next
  13571. +keycode 80 = Escape Escape
  13572. + shiftr keycode 80 = Escape
  13573. + shift shiftr keycode 80 = Escape
  13574. + alt keycode 80 = Meta_Escape
  13575. +keycode 81 = Tab Tab
  13576. + shiftr keycode 81 = Tab
  13577. + shift shiftr keycode 81 = Tab
  13578. + alt keycode 81 = Meta_Tab
  13579. +keycode 82 = grave asciitilde
  13580. + shiftr keycode 82 = asciitilde
  13581. + shift shiftr keycode 82 = asciitilde
  13582. + control keycode 82 = nul
  13583. + alt keycode 82 = Meta_grave
  13584. +keycode 83 = one exclam
  13585. + shiftr keycode 83 = exclam
  13586. + shift shiftr keycode 83 = exclam
  13587. + alt keycode 83 = Meta_one
  13588. +keycode 84 = q
  13589. + shiftr keycode 84 = +Q
  13590. + shift shiftr keycode 84 = +q
  13591. +keycode 85 = a
  13592. + shiftr keycode 85 = +A
  13593. + shift shiftr keycode 85 = +a
  13594. + altgr keycode 85 = Hex_A
  13595. +keycode 86 = z
  13596. + shiftr keycode 86 = +Z
  13597. + shift shiftr keycode 86 = +z
  13598. +
  13599. +# This is the windows key:
  13600. +keycode 88 = Decr_Console
  13601. +keycode 89 = Shift
  13602. +keycode 90 = Control
  13603. +keycode 91 = Control
  13604. +keycode 92 = Alt
  13605. +keycode 93 = AltGr
  13606. +keycode 94 = ShiftR
  13607. + shift keycode 94 = Caps_Lock
  13608. --- a/drivers/char/indydog.c
  13609. +++ b/drivers/char/indydog.c
  13610. @@ -1,5 +1,5 @@
  13611. /*
  13612. - * IndyDog 0.2 A Hardware Watchdog Device for SGI IP22
  13613. + * IndyDog 0.3 A Hardware Watchdog Device for SGI IP22
  13614. *
  13615. * (c) Copyright 2002 Guido Guenther <[email protected]>, All Rights Reserved.
  13616. *
  13617. @@ -7,10 +7,10 @@
  13618. * modify it under the terms of the GNU General Public License
  13619. * as published by the Free Software Foundation; either version
  13620. * 2 of the License, or (at your option) any later version.
  13621. - *
  13622. + *
  13623. * based on softdog.c by Alan Cox <[email protected]>
  13624. */
  13625. -
  13626. +
  13627. #include <linux/module.h>
  13628. #include <linux/config.h>
  13629. #include <linux/types.h>
  13630. @@ -19,13 +19,12 @@
  13631. #include <linux/mm.h>
  13632. #include <linux/miscdevice.h>
  13633. #include <linux/watchdog.h>
  13634. -#include <linux/smp_lock.h>
  13635. #include <linux/init.h>
  13636. #include <asm/uaccess.h>
  13637. #include <asm/sgi/mc.h>
  13638. -static unsigned long indydog_alive;
  13639. -static int expect_close = 0;
  13640. +#define PFX "indydog: "
  13641. +static int indydog_alive;
  13642. #ifdef CONFIG_WATCHDOG_NOWAYOUT
  13643. static int nowayout = 1;
  13644. @@ -33,10 +32,30 @@ static int nowayout = 1;
  13645. static int nowayout = 0;
  13646. #endif
  13647. +#define WATCHDOG_TIMEOUT 30 /* 30 sec default timeout */
  13648. +
  13649. MODULE_PARM(nowayout,"i");
  13650. MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
  13651. -static inline void indydog_ping(void)
  13652. +static void indydog_start(void)
  13653. +{
  13654. + u32 mc_ctrl0 = sgimc->cpuctrl0;
  13655. +
  13656. + mc_ctrl0 = sgimc->cpuctrl0 | SGIMC_CCTRL0_WDOG;
  13657. + sgimc->cpuctrl0 = mc_ctrl0;
  13658. +}
  13659. +
  13660. +static void indydog_stop(void)
  13661. +{
  13662. + u32 mc_ctrl0 = sgimc->cpuctrl0;
  13663. +
  13664. + mc_ctrl0 &= ~SGIMC_CCTRL0_WDOG;
  13665. + sgimc->cpuctrl0 = mc_ctrl0;
  13666. +
  13667. + printk(KERN_INFO PFX "Stopped watchdog timer.\n");
  13668. +}
  13669. +
  13670. +static void indydog_ping(void)
  13671. {
  13672. sgimc->watchdogt = 0;
  13673. }
  13674. @@ -46,18 +65,14 @@ static inline void indydog_ping(void)
  13675. */
  13676. static int indydog_open(struct inode *inode, struct file *file)
  13677. {
  13678. - u32 mc_ctrl0;
  13679. -
  13680. - if (test_and_set_bit(0,&indydog_alive))
  13681. + if (indydog_alive)
  13682. return -EBUSY;
  13683. - if (nowayout) {
  13684. + if (nowayout)
  13685. MOD_INC_USE_COUNT;
  13686. - }
  13687. /* Activate timer */
  13688. - mc_ctrl0 = sgimc->cpuctrl0 | SGIMC_CCTRL0_WDOG;
  13689. - sgimc->cpuctrl0 = mc_ctrl0;
  13690. + indydog_start();
  13691. indydog_ping();
  13692. indydog_alive = 1;
  13693. @@ -69,63 +84,48 @@ static int indydog_open(struct inode *in
  13694. static int indydog_release(struct inode *inode, struct file *file)
  13695. {
  13696. /* Shut off the timer.
  13697. - * Lock it in if it's a module and we set nowayout. */
  13698. - lock_kernel();
  13699. - if (expect_close) {
  13700. - u32 mc_ctrl0 = sgimc->cpuctrl0;
  13701. + * Lock it in if it's a module and we defined ...NOWAYOUT */
  13702. + if (!nowayout) {
  13703. + u32 mc_ctrl0 = sgimc->cpuctrl0;
  13704. mc_ctrl0 &= ~SGIMC_CCTRL0_WDOG;
  13705. sgimc->cpuctrl0 = mc_ctrl0;
  13706. printk(KERN_INFO "Stopped watchdog timer.\n");
  13707. - } else
  13708. - printk(KERN_CRIT "WDT device closed unexpectedly. WDT will not stop!\n");
  13709. - clear_bit(0, &indydog_alive);
  13710. - unlock_kernel();
  13711. + }
  13712. + indydog_alive = 0;
  13713. return 0;
  13714. }
  13715. static ssize_t indydog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
  13716. {
  13717. - /* Can't seek (pwrite) on this device */
  13718. + /* Can't seek (pwrite) on this device */
  13719. if (ppos != &file->f_pos)
  13720. return -ESPIPE;
  13721. - /*
  13722. - * Refresh the timer.
  13723. - */
  13724. + /* Refresh the timer. */
  13725. if (len) {
  13726. - if (!nowayout) {
  13727. - size_t i;
  13728. -
  13729. - /* In case it was set long ago */
  13730. - expect_close = 0;
  13731. -
  13732. - for (i = 0; i != len; i++) {
  13733. - char c;
  13734. - if (get_user(c, data + i))
  13735. - return -EFAULT;
  13736. - if (c == 'V')
  13737. - expect_close = 1;
  13738. - }
  13739. - }
  13740. indydog_ping();
  13741. - return 1;
  13742. }
  13743. - return 0;
  13744. + return len;
  13745. }
  13746. static int indydog_ioctl(struct inode *inode, struct file *file,
  13747. unsigned int cmd, unsigned long arg)
  13748. {
  13749. + int options, retval = -EINVAL;
  13750. static struct watchdog_info ident = {
  13751. - options: WDIOF_MAGICCLOSE,
  13752. - identity: "Hardware Watchdog for SGI IP22",
  13753. + .options = WDIOF_KEEPALIVEPING |
  13754. + WDIOF_MAGICCLOSE,
  13755. + .firmware_version = 0,
  13756. + .identity = "Hardware Watchdog for SGI IP22",
  13757. };
  13758. +
  13759. switch (cmd) {
  13760. default:
  13761. return -ENOIOCTLCMD;
  13762. case WDIOC_GETSUPPORT:
  13763. - if(copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident)))
  13764. + if (copy_to_user((struct watchdog_info *)arg,
  13765. + &ident, sizeof(ident)))
  13766. return -EFAULT;
  13767. return 0;
  13768. case WDIOC_GETSTATUS:
  13769. @@ -134,31 +134,53 @@ static int indydog_ioctl(struct inode *i
  13770. case WDIOC_KEEPALIVE:
  13771. indydog_ping();
  13772. return 0;
  13773. + case WDIOC_GETTIMEOUT:
  13774. + return put_user(WATCHDOG_TIMEOUT,(int *)arg);
  13775. + case WDIOC_SETOPTIONS:
  13776. + {
  13777. + if (get_user(options, (int *)arg))
  13778. + return -EFAULT;
  13779. +
  13780. + if (options & WDIOS_DISABLECARD) {
  13781. + indydog_stop();
  13782. + retval = 0;
  13783. + }
  13784. +
  13785. + if (options & WDIOS_ENABLECARD) {
  13786. + indydog_start();
  13787. + retval = 0;
  13788. + }
  13789. +
  13790. + return retval;
  13791. + }
  13792. }
  13793. }
  13794. static struct file_operations indydog_fops = {
  13795. - owner: THIS_MODULE,
  13796. - write: indydog_write,
  13797. - ioctl: indydog_ioctl,
  13798. - open: indydog_open,
  13799. - release: indydog_release,
  13800. + .owner = THIS_MODULE,
  13801. + .write = indydog_write,
  13802. + .ioctl = indydog_ioctl,
  13803. + .open = indydog_open,
  13804. + .release = indydog_release,
  13805. };
  13806. static struct miscdevice indydog_miscdev = {
  13807. - minor: WATCHDOG_MINOR,
  13808. - name: "watchdog",
  13809. - fops: &indydog_fops,
  13810. + .minor = WATCHDOG_MINOR,
  13811. + .name = "watchdog",
  13812. + .fops = &indydog_fops,
  13813. };
  13814. -static const char banner[] __initdata = KERN_INFO "Hardware Watchdog Timer for SGI IP22: 0.2\n";
  13815. +static char banner[] __initdata =
  13816. + KERN_INFO PFX "Hardware Watchdog Timer for SGI IP22: 0.3\n";
  13817. static int __init watchdog_init(void)
  13818. {
  13819. int ret = misc_register(&indydog_miscdev);
  13820. -
  13821. - if (ret)
  13822. + if (ret) {
  13823. + printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
  13824. + WATCHDOG_MINOR, ret);
  13825. return ret;
  13826. + }
  13827. printk(banner);
  13828. @@ -172,4 +194,7 @@ static void __exit watchdog_exit(void)
  13829. module_init(watchdog_init);
  13830. module_exit(watchdog_exit);
  13831. +
  13832. +MODULE_AUTHOR("Guido Guenther <[email protected]>");
  13833. +MODULE_DESCRIPTION("Hardware Watchdog Device for SGI IP22");
  13834. MODULE_LICENSE("GPL");
  13835. --- a/drivers/char/ip27-rtc.c
  13836. +++ b/drivers/char/ip27-rtc.c
  13837. @@ -44,6 +44,7 @@
  13838. #include <asm/sn/klconfig.h>
  13839. #include <asm/sn/sn0/ip27.h>
  13840. #include <asm/sn/sn0/hub.h>
  13841. +#include <asm/sn/sn_private.h>
  13842. static int rtc_ioctl(struct inode *inode, struct file *file,
  13843. unsigned int cmd, unsigned long arg);
  13844. @@ -209,11 +210,8 @@ static struct miscdevice rtc_dev=
  13845. static int __init rtc_init(void)
  13846. {
  13847. - nasid_t nid;
  13848. -
  13849. - nid = get_nasid();
  13850. rtc = (struct m48t35_rtc *)
  13851. - (KL_CONFIG_CH_CONS_INFO(nid)->memory_base + IOC3_BYTEBUS_DEV0);
  13852. + (KL_CONFIG_CH_CONS_INFO(master_nasid)->memory_base + IOC3_BYTEBUS_DEV0);
  13853. printk(KERN_INFO "Real Time Clock Driver v%s\n", RTC_VERSION);
  13854. if (misc_register(&rtc_dev)) {
  13855. @@ -325,3 +323,7 @@ static void get_rtc_time(struct rtc_time
  13856. rtc_tm->tm_mon--;
  13857. }
  13858. +
  13859. +MODULE_AUTHOR("Ralf Baechle <[email protected]>");
  13860. +MODULE_DESCRIPTION("SGI IP27 M48T35 RTC driver");
  13861. +MODULE_LICENSE("GPL");
  13862. --- a/drivers/char/Makefile
  13863. +++ b/drivers/char/Makefile
  13864. @@ -48,7 +48,12 @@ ifeq ($(ARCH),mips)
  13865. KEYBD =
  13866. endif
  13867. ifeq ($(CONFIG_VR41XX_KIU),y)
  13868. - KEYMAP =
  13869. + ifeq ($(CONFIG_IBM_WORKPAD),y)
  13870. + KEYMAP = ibm_workpad_keymap.o
  13871. + endif
  13872. + ifeq ($(CONFIG_VICTOR_MPC30X),y)
  13873. + KEYMAP = victor_mpc30x_keymap.o
  13874. + endif
  13875. KEYBD = vr41xx_keyb.o
  13876. endif
  13877. endif
  13878. @@ -251,7 +256,6 @@ obj-$(CONFIG_MK712_MOUSE) += mk712.o
  13879. obj-$(CONFIG_RTC) += rtc.o
  13880. obj-$(CONFIG_GEN_RTC) += genrtc.o
  13881. obj-$(CONFIG_EFI_RTC) += efirtc.o
  13882. -obj-$(CONFIG_SGI_DS1286) += ds1286.o
  13883. obj-$(CONFIG_MIPS_RTC) += mips_rtc.o
  13884. obj-$(CONFIG_SGI_IP27_RTC) += ip27-rtc.o
  13885. ifeq ($(CONFIG_PPC),)
  13886. @@ -259,6 +263,7 @@ ifeq ($(CONFIG_PPC),)
  13887. endif
  13888. obj-$(CONFIG_TOSHIBA) += toshiba.o
  13889. obj-$(CONFIG_I8K) += i8k.o
  13890. +obj-$(CONFIG_DS1286) += ds1286.o
  13891. obj-$(CONFIG_DS1620) += ds1620.o
  13892. obj-$(CONFIG_DS1742) += ds1742.o
  13893. obj-$(CONFIG_INTEL_RNG) += i810_rng.o
  13894. @@ -270,6 +275,7 @@ obj-$(CONFIG_BRIQ_PANEL) += briq_panel.o
  13895. obj-$(CONFIG_ITE_GPIO) += ite_gpio.o
  13896. obj-$(CONFIG_AU1X00_GPIO) += au1000_gpio.o
  13897. +obj-$(CONFIG_AU1550_PSC_SPI) += au1550_psc_spi.o
  13898. obj-$(CONFIG_AU1X00_USB_TTY) += au1000_usbtty.o
  13899. obj-$(CONFIG_AU1X00_USB_RAW) += au1000_usbraw.o
  13900. obj-$(CONFIG_COBALT_LCD) += lcd.o
  13901. @@ -357,3 +363,9 @@ defkeymap.c: defkeymap.map
  13902. qtronixmap.c: qtronixmap.map
  13903. set -e ; loadkeys --mktable $< | sed -e 's/^static *//' > $@
  13904. +
  13905. +ibm_workpad_keymap.c: ibm_workpad_keymap.map
  13906. + set -e ; loadkeys --mktable $< | sed -e 's/^static *//' > $@
  13907. +
  13908. +victor_mpc30x_keymap.c: victor_mpc30x_keymap.map
  13909. + set -e ; loadkeys --mktable $< | sed -e 's/^static *//' > $@
  13910. --- a/drivers/char/mips_rtc.c
  13911. +++ b/drivers/char/mips_rtc.c
  13912. @@ -53,14 +53,6 @@
  13913. #include <asm/io.h>
  13914. #include <asm/uaccess.h>
  13915. #include <asm/system.h>
  13916. -
  13917. -/*
  13918. - * Check machine
  13919. - */
  13920. -#if !defined(CONFIG_MIPS) || !defined(CONFIG_NEW_TIME_C)
  13921. -#error "This driver is for MIPS machines with CONFIG_NEW_TIME_C defined"
  13922. -#endif
  13923. -
  13924. #include <asm/time.h>
  13925. static unsigned long rtc_status = 0; /* bitmapped status byte. */
  13926. --- a/drivers/char/sb1250_duart.c
  13927. +++ b/drivers/char/sb1250_duart.c
  13928. @@ -328,10 +328,11 @@ static int duart_write(struct tty_struct
  13929. if (c <= 0) break;
  13930. if (from_user) {
  13931. + spin_unlock_irqrestore(&us->outp_lock, flags);
  13932. if (copy_from_user(us->outp_buf + us->outp_tail, buf, c)) {
  13933. - spin_unlock_irqrestore(&us->outp_lock, flags);
  13934. return -EFAULT;
  13935. }
  13936. + spin_lock_irqsave(&us->outp_lock, flags);
  13937. } else {
  13938. memcpy(us->outp_buf + us->outp_tail, buf, c);
  13939. }
  13940. @@ -498,9 +499,31 @@ static void duart_set_termios(struct tty
  13941. duart_set_cflag(us->line, tty->termios->c_cflag);
  13942. }
  13943. +static int get_serial_info(uart_state_t *us, struct serial_struct * retinfo) {
  13944. +
  13945. + struct serial_struct tmp;
  13946. +
  13947. + memset(&tmp, 0, sizeof(tmp));
  13948. +
  13949. + tmp.type=PORT_SB1250;
  13950. + tmp.line=us->line;
  13951. + tmp.port=A_DUART_CHANREG(tmp.line,0);
  13952. + tmp.irq=K_INT_UART_0 + tmp.line;
  13953. + tmp.xmit_fifo_size=16; /* fixed by hw */
  13954. + tmp.baud_base=5000000;
  13955. + tmp.io_type=SERIAL_IO_MEM;
  13956. +
  13957. + if (copy_to_user(retinfo,&tmp,sizeof(*retinfo)))
  13958. + return -EFAULT;
  13959. +
  13960. + return 0;
  13961. +}
  13962. +
  13963. static int duart_ioctl(struct tty_struct *tty, struct file * file,
  13964. unsigned int cmd, unsigned long arg)
  13965. {
  13966. + uart_state_t *us = (uart_state_t *) tty->driver_data;
  13967. +
  13968. /* if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
  13969. return -ENODEV;*/
  13970. switch (cmd) {
  13971. @@ -517,7 +540,7 @@ static int duart_ioctl(struct tty_struct
  13972. printk("Ignoring TIOCMSET\n");
  13973. break;
  13974. case TIOCGSERIAL:
  13975. - printk("Ignoring TIOCGSERIAL\n");
  13976. + return get_serial_info(us,(struct serial_struct *) arg);
  13977. break;
  13978. case TIOCSSERIAL:
  13979. printk("Ignoring TIOCSSERIAL\n");
  13980. --- a/drivers/char/serial.c
  13981. +++ b/drivers/char/serial.c
  13982. @@ -62,6 +62,12 @@
  13983. * Robert Schwebel <[email protected]>,
  13984. * Juergen Beisert <[email protected]>,
  13985. * Theodore Ts'o <[email protected]>
  13986. + *
  13987. + * 10/00: Added suport for MIPS Atlas board.
  13988. + * 11/00: Hooks for serial kernel debug port support added.
  13989. + * Kevin D. Kissell, [email protected] and Carsten Langgaard,
  13990. + * [email protected]
  13991. + * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
  13992. */
  13993. static char *serial_version = "5.05c";
  13994. @@ -413,6 +419,22 @@ static inline int serial_paranoia_check(
  13995. return 0;
  13996. }
  13997. +#if defined(CONFIG_MIPS_ATLAS) || defined(CONFIG_MIPS_SEAD)
  13998. +
  13999. +#include <asm/mips-boards/atlas.h>
  14000. +
  14001. +static _INLINE_ unsigned int serial_in(struct async_struct *info, int offset)
  14002. +{
  14003. + return (*(volatile unsigned int *)(mips_io_port_base + ATLAS_UART_REGS_BASE + offset*8) & 0xff);
  14004. +}
  14005. +
  14006. +static _INLINE_ void serial_out(struct async_struct *info, int offset, int value)
  14007. +{
  14008. + *(volatile unsigned int *)(mips_io_port_base + ATLAS_UART_REGS_BASE + offset*8) = value;
  14009. +}
  14010. +
  14011. +#else
  14012. +
  14013. static _INLINE_ unsigned int serial_in(struct async_struct *info, int offset)
  14014. {
  14015. switch (info->io_type) {
  14016. @@ -447,6 +469,8 @@ static _INLINE_ void serial_out(struct a
  14017. outb(value, info->port+offset);
  14018. }
  14019. }
  14020. +#endif
  14021. +
  14022. /*
  14023. * We used to support using pause I/O for certain machines. We
  14024. --- /dev/null
  14025. +++ b/drivers/char/victor_mpc30x_keymap.map
  14026. @@ -0,0 +1,102 @@
  14027. +# Victor Interlink MP-C303/304 keyboard keymap
  14028. +#
  14029. +# Copyright (C) 2003 Yoichi Yuasa <[email protected]>
  14030. +#
  14031. +# This file is subject to the terms and conditions of the GNU General Public
  14032. +# License. See the file "COPYING" in the main directory of this archive
  14033. +# for more details.
  14034. +keymaps 0-1,4-5,8-9,12
  14035. +alt_is_meta
  14036. +strings as usual
  14037. +compose as usual for "iso-8859-1"
  14038. +
  14039. +# First line
  14040. +keycode 89 = Escape
  14041. +keycode 9 = Delete
  14042. +
  14043. +# 2nd line
  14044. +keycode 73 = one exclam
  14045. +keycode 18 = two quotedbl
  14046. +keycode 92 = three numbersign
  14047. + control keycode 92 = Escape
  14048. +keycode 53 = four dollar
  14049. + control keycode 53 = Control_backslash
  14050. +keycode 21 = five percent
  14051. + control keycode 21 = Control_bracketright
  14052. +keycode 50 = six ampersand
  14053. + control keycode 50 = Control_underscore
  14054. +keycode 48 = seven apostrophe
  14055. +keycode 51 = eight parenleft
  14056. +keycode 16 = nine parenright
  14057. +keycode 80 = zero asciitilde
  14058. + control keycode 80 = nul
  14059. +keycode 49 = minus equal
  14060. +keycode 30 = asciicircum asciitilde
  14061. + control keycode 30 = Control_asciicircum
  14062. +keycode 5 = backslash bar
  14063. + control keycode 5 = Control_backslash
  14064. +keycode 13 = BackSpace
  14065. +# 3rd line
  14066. +keycode 57 = Tab
  14067. +keycode 74 = q
  14068. +keycode 26 = w
  14069. +keycode 81 = e
  14070. +keycode 29 = r
  14071. +keycode 37 = t
  14072. +keycode 45 = y
  14073. +keycode 72 = u
  14074. +keycode 24 = i
  14075. +keycode 32 = o
  14076. +keycode 41 = p
  14077. +keycode 1 = at grave
  14078. + control keycode 1 = nul
  14079. +keycode 54 = bracketleft braceleft
  14080. +keycode 63 = Return
  14081. + alt keycode 63 = Meta_Control_m
  14082. +# 4th line
  14083. +keycode 23 = Caps_Lock
  14084. +keycode 34 = a
  14085. +keycode 66 = s
  14086. +keycode 52 = d
  14087. +keycode 20 = f
  14088. +keycode 84 = g
  14089. +keycode 67 = h
  14090. +keycode 64 = j
  14091. +keycode 17 = k
  14092. +keycode 83 = l
  14093. +keycode 22 = semicolon plus
  14094. +keycode 61 = colon asterisk
  14095. + control keycode 61 = Control_g
  14096. +keycode 65 = bracketright braceright
  14097. + control keycode 65 = Control_bracketright
  14098. +# 5th line
  14099. +keycode 91 = Shift
  14100. +keycode 76 = z
  14101. +keycode 68 = x
  14102. +keycode 28 = c
  14103. +keycode 36 = v
  14104. +keycode 44 = b
  14105. +keycode 19 = n
  14106. +keycode 27 = m
  14107. +keycode 35 = comma less
  14108. +keycode 3 = period greater
  14109. + control keycode 3 = Compose
  14110. +keycode 38 = slash question
  14111. + control keycode 38 = Delete
  14112. + shift control keycode 38 = Delete
  14113. +keycode 6 = backslash underscore
  14114. + control keycode 6 = Control_backslash
  14115. +keycode 55 = Up
  14116. + alt keycode 55 = PageUp
  14117. +keycode 14 = Shift
  14118. +# 6th line
  14119. +keycode 56 = Control
  14120. +keycode 42 = Alt
  14121. +keycode 33 = space
  14122. + control keycode 33 = nul
  14123. +keycode 7 = Left
  14124. + alt keycode 7 = Home
  14125. +keycode 31 = Down
  14126. + alt keycode 31 = PageDown
  14127. +keycode 47 = Right
  14128. + alt keycode 47 = End
  14129. --- a/drivers/char/vr41xx_keyb.c
  14130. +++ b/drivers/char/vr41xx_keyb.c
  14131. @@ -308,7 +308,7 @@ void __devinit kbd_init_hw(void)
  14132. if (found != 0) {
  14133. kiu_base = VRC4173_KIU_OFFSET;
  14134. mkiuintreg = VRC4173_MKIUINTREG_OFFSET;
  14135. - vrc4173_clock_supply(VRC4173_KIU_CLOCK);
  14136. + vrc4173_supply_clock(VRC4173_KIU_CLOCK);
  14137. }
  14138. }
  14139. #endif
  14140. @@ -325,7 +325,7 @@ void __devinit kbd_init_hw(void)
  14141. if (current_cpu_data.cputype == CPU_VR4111 ||
  14142. current_cpu_data.cputype == CPU_VR4121)
  14143. - vr41xx_clock_supply(KIU_CLOCK);
  14144. + vr41xx_supply_clock(KIU_CLOCK);
  14145. kiu_writew(KIURST_KIURST, KIURST);
  14146. --- a/drivers/i2c/Config.in
  14147. +++ b/drivers/i2c/Config.in
  14148. @@ -57,6 +57,10 @@ if [ "$CONFIG_I2C" != "n" ]; then
  14149. if [ "$CONFIG_SGI_IP22" = "y" ]; then
  14150. dep_tristate 'I2C SGI interfaces' CONFIG_I2C_ALGO_SGI $CONFIG_I2C
  14151. fi
  14152. +
  14153. + if [ "$CONFIG_SOC_AU1550" = "y" -o "$CONFIG_SOC_AU1200" ]; then
  14154. + dep_tristate 'Au1550/Au1200 SMBus interface' CONFIG_I2C_ALGO_AU1550 $CONFIG_I2C
  14155. + fi
  14156. # This is needed for automatic patch generation: sensors code starts here
  14157. # This is needed for automatic patch generation: sensors code ends here
  14158. --- /dev/null
  14159. +++ b/drivers/i2c/i2c-algo-au1550.c
  14160. @@ -0,0 +1,340 @@
  14161. +/*
  14162. + * i2c-algo-au1550.c: SMBus (i2c) driver algorithms for Alchemy PSC interface
  14163. + * Copyright (C) 2004 Embedded Edge, LLC <[email protected]>
  14164. + *
  14165. + * The documentation describes this as an SMBus controller, but it doesn't
  14166. + * understand any of the SMBus protocol in hardware. It's really an I2C
  14167. + * controller that could emulate most of the SMBus in software.
  14168. + */
  14169. +
  14170. +#include <linux/kernel.h>
  14171. +#include <linux/module.h>
  14172. +#include <linux/init.h>
  14173. +#include <linux/errno.h>
  14174. +#include <linux/delay.h>
  14175. +
  14176. +#include <asm/au1000.h>
  14177. +#include <asm/au1xxx_psc.h>
  14178. +
  14179. +#include <linux/i2c.h>
  14180. +#include <linux/i2c-algo-au1550.h>
  14181. +
  14182. +static int
  14183. +wait_xfer_done(struct i2c_algo_au1550_data *adap)
  14184. +{
  14185. + u32 stat;
  14186. + int i;
  14187. + volatile psc_smb_t *sp;
  14188. +
  14189. + sp = (volatile psc_smb_t *)(adap->psc_base);
  14190. +
  14191. + /* Wait for Tx FIFO Underflow.
  14192. + */
  14193. + for (i = 0; i < adap->xfer_timeout; i++) {
  14194. + stat = sp->psc_smbevnt;
  14195. + au_sync();
  14196. + if ((stat & PSC_SMBEVNT_TU) != 0) {
  14197. + /* Clear it. */
  14198. + sp->psc_smbevnt = PSC_SMBEVNT_TU;
  14199. + au_sync();
  14200. + return 0;
  14201. + }
  14202. + udelay(1);
  14203. + }
  14204. +
  14205. + return -ETIMEDOUT;
  14206. +}
  14207. +
  14208. +static int
  14209. +wait_ack(struct i2c_algo_au1550_data *adap)
  14210. +{
  14211. + u32 stat;
  14212. + volatile psc_smb_t *sp;
  14213. +
  14214. + if (wait_xfer_done(adap))
  14215. + return -ETIMEDOUT;
  14216. +
  14217. + sp = (volatile psc_smb_t *)(adap->psc_base);
  14218. +
  14219. + stat = sp->psc_smbevnt;
  14220. + au_sync();
  14221. +
  14222. + if ((stat & (PSC_SMBEVNT_DN | PSC_SMBEVNT_AN | PSC_SMBEVNT_AL)) != 0)
  14223. + return -ETIMEDOUT;
  14224. +
  14225. + return 0;
  14226. +}
  14227. +
  14228. +static int
  14229. +wait_master_done(struct i2c_algo_au1550_data *adap)
  14230. +{
  14231. + u32 stat;
  14232. + int i;
  14233. + volatile psc_smb_t *sp;
  14234. +
  14235. + sp = (volatile psc_smb_t *)(adap->psc_base);
  14236. +
  14237. + /* Wait for Master Done.
  14238. + */
  14239. + for (i = 0; i < adap->xfer_timeout; i++) {
  14240. + stat = sp->psc_smbevnt;
  14241. + au_sync();
  14242. + if ((stat & PSC_SMBEVNT_MD) != 0)
  14243. + return 0;
  14244. + udelay(1);
  14245. + }
  14246. +
  14247. + return -ETIMEDOUT;
  14248. +}
  14249. +
  14250. +static int
  14251. +do_address(struct i2c_algo_au1550_data *adap, unsigned int addr, int rd)
  14252. +{
  14253. + volatile psc_smb_t *sp;
  14254. + u32 stat;
  14255. +
  14256. + sp = (volatile psc_smb_t *)(adap->psc_base);
  14257. +
  14258. + /* Reset the FIFOs, clear events.
  14259. + */
  14260. + sp->psc_smbpcr = PSC_SMBPCR_DC;
  14261. + sp->psc_smbevnt = PSC_SMBEVNT_ALLCLR;
  14262. + au_sync();
  14263. + do {
  14264. + stat = sp->psc_smbpcr;
  14265. + au_sync();
  14266. + } while ((stat & PSC_SMBPCR_DC) != 0);
  14267. +
  14268. + /* Write out the i2c chip address and specify operation
  14269. + */
  14270. + addr <<= 1;
  14271. + if (rd)
  14272. + addr |= 1;
  14273. +
  14274. + /* Put byte into fifo, start up master.
  14275. + */
  14276. + sp->psc_smbtxrx = addr;
  14277. + au_sync();
  14278. + sp->psc_smbpcr = PSC_SMBPCR_MS;
  14279. + au_sync();
  14280. + if (wait_ack(adap))
  14281. + return -EIO;
  14282. + return 0;
  14283. +}
  14284. +
  14285. +static u32
  14286. +wait_for_rx_byte(struct i2c_algo_au1550_data *adap, u32 *ret_data)
  14287. +{
  14288. + int j;
  14289. + u32 data, stat;
  14290. + volatile psc_smb_t *sp;
  14291. +
  14292. + if (wait_xfer_done(adap))
  14293. + return -EIO;
  14294. +
  14295. + sp = (volatile psc_smb_t *)(adap->psc_base);
  14296. +
  14297. + j = adap->xfer_timeout * 100;
  14298. + do {
  14299. + j--;
  14300. + if (j <= 0)
  14301. + return -EIO;
  14302. +
  14303. + stat = sp->psc_smbstat;
  14304. + au_sync();
  14305. + if ((stat & PSC_SMBSTAT_RE) == 0)
  14306. + j = 0;
  14307. + else
  14308. + udelay(1);
  14309. + } while (j > 0);
  14310. + data = sp->psc_smbtxrx;
  14311. + au_sync();
  14312. + *ret_data = data;
  14313. +
  14314. + return 0;
  14315. +}
  14316. +
  14317. +static int
  14318. +i2c_read(struct i2c_algo_au1550_data *adap, unsigned char *buf,
  14319. + unsigned int len)
  14320. +{
  14321. + int i;
  14322. + u32 data;
  14323. + volatile psc_smb_t *sp;
  14324. +
  14325. + if (len == 0)
  14326. + return 0;
  14327. +
  14328. + /* A read is performed by stuffing the transmit fifo with
  14329. + * zero bytes for timing, waiting for bytes to appear in the
  14330. + * receive fifo, then reading the bytes.
  14331. + */
  14332. +
  14333. + sp = (volatile psc_smb_t *)(adap->psc_base);
  14334. +
  14335. + i = 0;
  14336. + while (i < (len-1)) {
  14337. + sp->psc_smbtxrx = 0;
  14338. + au_sync();
  14339. + if (wait_for_rx_byte(adap, &data))
  14340. + return -EIO;
  14341. +
  14342. + buf[i] = data;
  14343. + i++;
  14344. + }
  14345. +
  14346. + /* The last byte has to indicate transfer done.
  14347. + */
  14348. + sp->psc_smbtxrx = PSC_SMBTXRX_STP;
  14349. + au_sync();
  14350. + if (wait_master_done(adap))
  14351. + return -EIO;
  14352. +
  14353. + data = sp->psc_smbtxrx;
  14354. + au_sync();
  14355. + buf[i] = data;
  14356. + return 0;
  14357. +}
  14358. +
  14359. +static int
  14360. +i2c_write(struct i2c_algo_au1550_data *adap, unsigned char *buf,
  14361. + unsigned int len)
  14362. +{
  14363. + int i;
  14364. + u32 data;
  14365. + volatile psc_smb_t *sp;
  14366. +
  14367. + if (len == 0)
  14368. + return 0;
  14369. +
  14370. + sp = (volatile psc_smb_t *)(adap->psc_base);
  14371. +
  14372. + i = 0;
  14373. + while (i < (len-1)) {
  14374. + data = buf[i];
  14375. + sp->psc_smbtxrx = data;
  14376. + au_sync();
  14377. + if (wait_ack(adap))
  14378. + return -EIO;
  14379. + i++;
  14380. + }
  14381. +
  14382. + /* The last byte has to indicate transfer done.
  14383. + */
  14384. + data = buf[i];
  14385. + data |= PSC_SMBTXRX_STP;
  14386. + sp->psc_smbtxrx = data;
  14387. + au_sync();
  14388. + if (wait_master_done(adap))
  14389. + return -EIO;
  14390. + return 0;
  14391. +}
  14392. +
  14393. +static int
  14394. +au1550_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num)
  14395. +{
  14396. + struct i2c_algo_au1550_data *adap = i2c_adap->algo_data;
  14397. + struct i2c_msg *p;
  14398. + int i, err = 0;
  14399. +
  14400. + for (i = 0; !err && i < num; i++) {
  14401. + p = &msgs[i];
  14402. + err = do_address(adap, p->addr, p->flags & I2C_M_RD);
  14403. + if (err || !p->len)
  14404. + continue;
  14405. + if (p->flags & I2C_M_RD)
  14406. + err = i2c_read(adap, p->buf, p->len);
  14407. + else
  14408. + err = i2c_write(adap, p->buf, p->len);
  14409. + }
  14410. +
  14411. + /* Return the number of messages processed, or the error code.
  14412. + */
  14413. + if (err == 0)
  14414. + err = num;
  14415. + return err;
  14416. +}
  14417. +
  14418. +static u32
  14419. +au1550_func(struct i2c_adapter *adap)
  14420. +{
  14421. + return I2C_FUNC_I2C;
  14422. +}
  14423. +
  14424. +static struct i2c_algorithm au1550_algo = {
  14425. + .name = "Au1550 algorithm",
  14426. + .id = I2C_ALGO_AU1550,
  14427. + .master_xfer = au1550_xfer,
  14428. + .functionality = au1550_func,
  14429. +};
  14430. +
  14431. +/*
  14432. + * registering functions to load algorithms at runtime
  14433. + * Prior to calling us, the 50MHz clock frequency and routing
  14434. + * must have been set up for the PSC indicated by the adapter.
  14435. + */
  14436. +int
  14437. +i2c_au1550_add_bus(struct i2c_adapter *i2c_adap)
  14438. +{
  14439. + struct i2c_algo_au1550_data *adap = i2c_adap->algo_data;
  14440. + volatile psc_smb_t *sp;
  14441. + u32 stat;
  14442. +
  14443. + i2c_adap->algo = &au1550_algo;
  14444. +
  14445. + /* Now, set up the PSC for SMBus PIO mode.
  14446. + */
  14447. + sp = (volatile psc_smb_t *)(adap->psc_base);
  14448. + sp->psc_ctrl = PSC_CTRL_DISABLE;
  14449. + au_sync();
  14450. + sp->psc_sel = PSC_SEL_PS_SMBUSMODE;
  14451. + sp->psc_smbcfg = 0;
  14452. + au_sync();
  14453. + sp->psc_ctrl = PSC_CTRL_ENABLE;
  14454. + au_sync();
  14455. + do {
  14456. + stat = sp->psc_smbstat;
  14457. + au_sync();
  14458. + } while ((stat & PSC_SMBSTAT_SR) == 0);
  14459. +
  14460. + sp->psc_smbcfg = (PSC_SMBCFG_RT_FIFO8 | PSC_SMBCFG_TT_FIFO8 |
  14461. + PSC_SMBCFG_DD_DISABLE);
  14462. +
  14463. + /* Divide by 8 to get a 6.25 MHz clock. The later protocol
  14464. + * timings are based on this clock.
  14465. + */
  14466. + sp->psc_smbcfg |= PSC_SMBCFG_SET_DIV(PSC_SMBCFG_DIV2);
  14467. + sp->psc_smbmsk = PSC_SMBMSK_ALLMASK;
  14468. + au_sync();
  14469. +
  14470. + /* Set the protocol timer values. See Table 71 in the
  14471. + * Au1550 Data Book for standard timing values.
  14472. + */
  14473. + sp->psc_smbtmr = PSC_SMBTMR_SET_TH(2) | PSC_SMBTMR_SET_PS(15) | \
  14474. + PSC_SMBTMR_SET_PU(11) | PSC_SMBTMR_SET_SH(11) | \
  14475. + PSC_SMBTMR_SET_SU(11) | PSC_SMBTMR_SET_CL(15) | \
  14476. + PSC_SMBTMR_SET_CH(11);
  14477. + au_sync();
  14478. +
  14479. + sp->psc_smbcfg |= PSC_SMBCFG_DE_ENABLE;
  14480. + do {
  14481. + stat = sp->psc_smbstat;
  14482. + au_sync();
  14483. + } while ((stat & PSC_SMBSTAT_DR) == 0);
  14484. +
  14485. + return i2c_add_adapter(i2c_adap);
  14486. +}
  14487. +
  14488. +
  14489. +int
  14490. +i2c_au1550_del_bus(struct i2c_adapter *adap)
  14491. +{
  14492. + return i2c_del_adapter(adap);
  14493. +}
  14494. +
  14495. +EXPORT_SYMBOL(i2c_au1550_add_bus);
  14496. +EXPORT_SYMBOL(i2c_au1550_del_bus);
  14497. +
  14498. +MODULE_AUTHOR("Dan Malek <[email protected]>");
  14499. +MODULE_DESCRIPTION("SMBus Au1550 algorithm");
  14500. +MODULE_LICENSE("GPL");
  14501. --- /dev/null
  14502. +++ b/drivers/i2c/i2c-au1550.c
  14503. @@ -0,0 +1,154 @@
  14504. +/*
  14505. + * i2c-au1550.c: SMBus (i2c) adapter for Alchemy PSC interface
  14506. + * Copyright (C) 2004 Embedded Edge, LLC <[email protected]>
  14507. + *
  14508. + * This is just a skeleton adapter to use with the Au1550 PSC
  14509. + * algorithm. It was developed for the Pb1550, but will work with
  14510. + * any Au1550 board that has a similar PSC configuration.
  14511. + *
  14512. + * This program is free software; you can redistribute it and/or
  14513. + * modify it under the terms of the GNU General Public License
  14514. + * as published by the Free Software Foundation; either version 2
  14515. + * of the License, or (at your option) any later version.
  14516. + *
  14517. + * This program is distributed in the hope that it will be useful,
  14518. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14519. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14520. + * GNU General Public License for more details.
  14521. + *
  14522. + * You should have received a copy of the GNU General Public License
  14523. + * along with this program; if not, write to the Free Software
  14524. + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14525. + */
  14526. +
  14527. +#include <linux/config.h>
  14528. +#include <linux/kernel.h>
  14529. +#include <linux/module.h>
  14530. +#include <linux/init.h>
  14531. +#include <linux/errno.h>
  14532. +
  14533. +#include <asm/au1000.h>
  14534. +#include <asm/au1xxx_psc.h>
  14535. +#if defined( CONFIG_MIPS_PB1550 )
  14536. + #include <asm/pb1550.h>
  14537. +#endif
  14538. +#if defined( CONFIG_MIPS_PB1200 )
  14539. + #include <asm/pb1200.h>
  14540. +#endif
  14541. +#if defined( CONFIG_MIPS_DB1200 )
  14542. + #include <asm/db1200.h>
  14543. +#endif
  14544. +#if defined( CONFIG_MIPS_FICMMP )
  14545. + #include <asm/ficmmp.h>
  14546. +#endif
  14547. +
  14548. +#include <linux/i2c.h>
  14549. +#include <linux/i2c-algo-au1550.h>
  14550. +
  14551. +
  14552. +
  14553. +static int
  14554. +pb1550_reg(struct i2c_client *client)
  14555. +{
  14556. + return 0;
  14557. +}
  14558. +
  14559. +static int
  14560. +pb1550_unreg(struct i2c_client *client)
  14561. +{
  14562. + return 0;
  14563. +}
  14564. +
  14565. +static void
  14566. +pb1550_inc_use(struct i2c_adapter *adap)
  14567. +{
  14568. +#ifdef MODULE
  14569. + MOD_INC_USE_COUNT;
  14570. +#endif
  14571. +}
  14572. +
  14573. +static void
  14574. +pb1550_dec_use(struct i2c_adapter *adap)
  14575. +{
  14576. +#ifdef MODULE
  14577. + MOD_DEC_USE_COUNT;
  14578. +#endif
  14579. +}
  14580. +
  14581. +static struct i2c_algo_au1550_data pb1550_i2c_info = {
  14582. + SMBUS_PSC_BASE, 200, 200
  14583. +};
  14584. +
  14585. +static struct i2c_adapter pb1550_board_adapter = {
  14586. + name: "pb1550 adapter",
  14587. + id: I2C_HW_AU1550_PSC,
  14588. + algo: NULL,
  14589. + algo_data: &pb1550_i2c_info,
  14590. + inc_use: pb1550_inc_use,
  14591. + dec_use: pb1550_dec_use,
  14592. + client_register: pb1550_reg,
  14593. + client_unregister: pb1550_unreg,
  14594. + client_count: 0,
  14595. +};
  14596. +
  14597. +int __init
  14598. +i2c_pb1550_init(void)
  14599. +{
  14600. + /* This is where we would set up a 50MHz clock source
  14601. + * and routing. On the Pb1550, the SMBus is PSC2, which
  14602. + * uses a shared clock with USB. This has been already
  14603. + * configured by Yamon as a 48MHz clock, close enough
  14604. + * for our work.
  14605. + */
  14606. + if (i2c_au1550_add_bus(&pb1550_board_adapter) < 0)
  14607. + return -ENODEV;
  14608. +
  14609. + return 0;
  14610. +}
  14611. +
  14612. +/* BIG hack to support the control interface on the Wolfson WM8731
  14613. + * audio codec on the Pb1550 board. We get an address and two data
  14614. + * bytes to write, create an i2c message, and send it across the
  14615. + * i2c transfer function. We do this here because we have access to
  14616. + * the i2c adapter structure.
  14617. + */
  14618. +static struct i2c_msg wm_i2c_msg; /* We don't want this stuff on the stack */
  14619. +static u8 i2cbuf[2];
  14620. +
  14621. +int
  14622. +pb1550_wm_codec_write(u8 addr, u8 reg, u8 val)
  14623. +{
  14624. + wm_i2c_msg.addr = addr;
  14625. + wm_i2c_msg.flags = 0;
  14626. + wm_i2c_msg.buf = i2cbuf;
  14627. + wm_i2c_msg.len = 2;
  14628. + i2cbuf[0] = reg;
  14629. + i2cbuf[1] = val;
  14630. +
  14631. + return pb1550_board_adapter.algo->master_xfer(&pb1550_board_adapter, &wm_i2c_msg, 1);
  14632. +}
  14633. +
  14634. +/* the next function is needed by DVB driver. */
  14635. +int pb1550_i2c_xfer(struct i2c_msg msgs[], int num)
  14636. +{
  14637. + return pb1550_board_adapter.algo->master_xfer(&pb1550_board_adapter, msgs, num);
  14638. +}
  14639. +
  14640. +EXPORT_SYMBOL(pb1550_wm_codec_write);
  14641. +EXPORT_SYMBOL(pb1550_i2c_xfer);
  14642. +
  14643. +MODULE_AUTHOR("Dan Malek, Embedded Edge, LLC.");
  14644. +MODULE_DESCRIPTION("SMBus adapter Alchemy pb1550");
  14645. +MODULE_LICENSE("GPL");
  14646. +
  14647. +int
  14648. +init_module(void)
  14649. +{
  14650. + return i2c_pb1550_init();
  14651. +}
  14652. +
  14653. +void
  14654. +cleanup_module(void)
  14655. +{
  14656. + i2c_au1550_del_bus(&pb1550_board_adapter);
  14657. +}
  14658. --- a/drivers/i2c/i2c-core.c
  14659. +++ b/drivers/i2c/i2c-core.c
  14660. @@ -1277,6 +1277,9 @@ static int __init i2c_init(void)
  14661. #ifdef CONFIG_I2C_MAX1617
  14662. extern int i2c_max1617_init(void);
  14663. #endif
  14664. +#ifdef CONFIG_I2C_ALGO_AU1550
  14665. + extern int i2c_pb1550_init(void);
  14666. +#endif
  14667. #ifdef CONFIG_I2C_PROC
  14668. extern int sensors_init(void);
  14669. @@ -1332,6 +1335,10 @@ int __init i2c_init_all(void)
  14670. i2c_max1617_init();
  14671. #endif
  14672. +#ifdef CONFIG_I2C_ALGO_AU1550
  14673. + i2c_pb1550_init();
  14674. +#endif
  14675. +
  14676. /* -------------- proc interface ---- */
  14677. #ifdef CONFIG_I2C_PROC
  14678. sensors_init();
  14679. --- a/drivers/i2c/Makefile
  14680. +++ b/drivers/i2c/Makefile
  14681. @@ -6,7 +6,7 @@ O_TARGET := i2c.o
  14682. export-objs := i2c-core.o i2c-algo-bit.o i2c-algo-pcf.o \
  14683. i2c-algo-ite.o i2c-algo-sibyte.o i2c-algo-sgi.o \
  14684. - i2c-proc.o
  14685. + i2c-algo-au1550.o i2c-proc.o i2c-au1550.o
  14686. obj-$(CONFIG_I2C) += i2c-core.o
  14687. obj-$(CONFIG_I2C_CHARDEV) += i2c-dev.o
  14688. @@ -25,6 +25,7 @@ obj-$(CONFIG_I2C_KEYWEST) += i2c-keywest
  14689. obj-$(CONFIG_I2C_ALGO_SIBYTE) += i2c-algo-sibyte.o i2c-sibyte.o
  14690. obj-$(CONFIG_I2C_MAX1617) += i2c-max1617.o
  14691. obj-$(CONFIG_I2C_ALGO_SGI) += i2c-algo-sgi.o
  14692. +obj-$(CONFIG_I2C_ALGO_AU1550) += i2c-algo-au1550.o i2c-au1550.o
  14693. # This is needed for automatic patch generation: sensors code starts here
  14694. # This is needed for automatic patch generation: sensors code ends here
  14695. --- a/drivers/media/video/indycam.c
  14696. +++ b/drivers/media/video/indycam.c
  14697. @@ -50,13 +50,14 @@ static int indycam_attach(struct i2c_ada
  14698. 0x80, /* INDYCAM_GAMMA */
  14699. };
  14700. - int err = 0;
  14701. struct indycam *camera;
  14702. struct i2c_client *client;
  14703. + int err = 0;
  14704. client = kmalloc(sizeof(*client), GFP_KERNEL);
  14705. - if (!client)
  14706. + if (!client)
  14707. return -ENOMEM;
  14708. +
  14709. camera = kmalloc(sizeof(*camera), GFP_KERNEL);
  14710. if (!camera) {
  14711. err = -ENOMEM;
  14712. @@ -67,7 +68,7 @@ static int indycam_attach(struct i2c_ada
  14713. client->adapter = adap;
  14714. client->addr = addr;
  14715. client->driver = &i2c_driver_indycam;
  14716. - strcpy(client->name, "IndyCam client");
  14717. + strcpy(client->name, "IndyCam client");
  14718. camera->client = client;
  14719. err = i2c_attach_client(client);
  14720. @@ -75,18 +76,18 @@ static int indycam_attach(struct i2c_ada
  14721. goto out_free_camera;
  14722. camera->version = i2c_smbus_read_byte_data(client, INDYCAM_VERSION);
  14723. - if (camera->version != CAMERA_VERSION_INDY &&
  14724. - camera->version != CAMERA_VERSION_MOOSE) {
  14725. + if ((camera->version != CAMERA_VERSION_INDY) &&
  14726. + (camera->version != CAMERA_VERSION_MOOSE)) {
  14727. err = -ENODEV;
  14728. goto out_detach_client;
  14729. }
  14730. - printk(KERN_INFO "Indycam v%d.%d detected.\n",
  14731. + printk(KERN_INFO "IndyCam v%d.%d detected.\n",
  14732. INDYCAM_VERSION_MAJOR(camera->version),
  14733. INDYCAM_VERSION_MINOR(camera->version));
  14734. err = i2c_master_send(client, initseq, sizeof(initseq));
  14735. if (err)
  14736. - printk(KERN_INFO "IndyCam initalization failed\n");
  14737. + printk(KERN_ERR "IndyCam initalization failed.\n");
  14738. MOD_INC_USE_COUNT;
  14739. return 0;
  14740. --- a/drivers/media/video/vino.c
  14741. +++ b/drivers/media/video/vino.c
  14742. @@ -5,6 +5,8 @@
  14743. * License version 2 as published by the Free Software Foundation.
  14744. *
  14745. * Copyright (C) 2003 Ladislav Michl <[email protected]>
  14746. + * Copyright (C) 2004 Mikael Nousiainen <[email protected]>
  14747. + *
  14748. */
  14749. #include <linux/module.h>
  14750. @@ -37,13 +39,23 @@
  14751. #define DEBUG(x...)
  14752. #endif
  14753. +/* Channels (who could have guessed) */
  14754. +#define VINO_CHAN_NONE 0
  14755. +#define VINO_CHAN_A 1
  14756. +#define VINO_CHAN_B 2
  14757. +
  14758. /* VINO video size */
  14759. #define VINO_PAL_WIDTH 768
  14760. #define VINO_PAL_HEIGHT 576
  14761. #define VINO_NTSC_WIDTH 646
  14762. #define VINO_NTSC_HEIGHT 486
  14763. -/* set this to some sensible values. note: VINO_MIN_WIDTH has to be 8*x */
  14764. +/* Minimum value for Y-clipping (for smaller values the images
  14765. + * will be corrupted) */
  14766. +#define VINO_MIN_Y_CLIPPING 2
  14767. +
  14768. +/* Set these to some sensible values.
  14769. + * Note: the picture width has to be divisible by 8 */
  14770. #define VINO_MIN_WIDTH 32
  14771. #define VINO_MIN_HEIGHT 32
  14772. @@ -64,9 +76,7 @@ static int threshold_b = 512;
  14773. struct vino_device {
  14774. struct video_device vdev;
  14775. -#define VINO_CHAN_A 1
  14776. -#define VINO_CHAN_B 2
  14777. - int chan;
  14778. + int chan; /* VINO_CHAN_NONE, VINO_CHAN_A or VINO_CHAN_B */
  14779. int alpha;
  14780. /* clipping... */
  14781. unsigned int left, right, top, bottom;
  14782. @@ -106,7 +116,7 @@ struct vino_device {
  14783. struct vino_client {
  14784. struct i2c_client *driver;
  14785. - int owner;
  14786. + int owner; /* VINO_CHAN_NONE, VINO_CHAN_A or VINO_CHAN_B */
  14787. };
  14788. struct vino_video {
  14789. @@ -362,6 +372,7 @@ static int set_scaling(struct vino_devic
  14790. static int dma_setup(struct vino_device *v)
  14791. {
  14792. u32 ctrl, intr;
  14793. + int ofs;
  14794. struct sgi_vino_channel *ch;
  14795. ch = (v->chan == VINO_CHAN_A) ? &vino->a : &vino->b;
  14796. @@ -377,14 +388,24 @@ static int dma_setup(struct vino_device
  14797. ch->line_size = v->line_size - 8;
  14798. /* set the alpha register */
  14799. ch->alpha = v->alpha;
  14800. - /* set cliping registers */
  14801. - ch->clip_start = VINO_CLIP_ODD(v->top) | VINO_CLIP_EVEN(v->top+1) |
  14802. + /* Set the clipping registers, this is the constant source of fun :)
  14803. + * Y clipping start has to be >= 2 and end has to be start + height/2
  14804. + * The values of top and bottom are even so dividing is not a problem
  14805. + *
  14806. + * The docs say that clipping values for the even field should be
  14807. + * odd_end + something_to_skip_vertical_blanking + some_lines and
  14808. + * even_start + height/2, though the image is good this way also
  14809. + *
  14810. + * TODO: for analog sources (SAA7191), the clipping values are a bit
  14811. + * different and that case isn't yet handled
  14812. + */
  14813. + ofs = VINO_MIN_Y_CLIPPING; /* Should depend on input source */
  14814. + ch->clip_start = VINO_CLIP_ODD(ofs + v->top / 2) |
  14815. + VINO_CLIP_EVEN(ofs + v->top / 2 + 1) |
  14816. VINO_CLIP_X(v->left);
  14817. - ch->clip_end = VINO_CLIP_ODD(v->bottom) | VINO_CLIP_EVEN(v->bottom+1) |
  14818. + ch->clip_end = VINO_CLIP_ODD(ofs + v->bottom / 2 - 1) |
  14819. + VINO_CLIP_EVEN(ofs + v->bottom / 2) |
  14820. VINO_CLIP_X(v->right);
  14821. - /* FIXME: end-of-field bug workaround
  14822. - VINO_CLIP_X(VINO_PAL_WIDTH);
  14823. - */
  14824. /* init the frame rate and norm (full frame rate only for now...) */
  14825. ch->frame_rate = VINO_FRAMERT_RT(0x1fff) |
  14826. (get_capture_norm(v) == VIDEO_MODE_PAL ?
  14827. @@ -510,6 +531,7 @@ static void field_done(struct vino_devic
  14828. static void vino_interrupt(int irq, void *dev_id, struct pt_regs *regs)
  14829. {
  14830. u32 intr, ctrl;
  14831. + int a_eof, b_eof;
  14832. spin_lock(&Vino->vino_lock);
  14833. ctrl = vino->control;
  14834. @@ -525,12 +547,14 @@ static void vino_interrupt(int irq, void
  14835. vino->control = ctrl;
  14836. clear_eod(&Vino->chB);
  14837. }
  14838. + a_eof = intr & VINO_INTSTAT_A_EOF;
  14839. + b_eof = intr & VINO_INTSTAT_B_EOF;
  14840. vino->intr_status = ~intr;
  14841. spin_unlock(&Vino->vino_lock);
  14842. - /* FIXME: For now we are assuming that interrupt means that frame is
  14843. - * done. That's not true, but we can live with such brokeness for
  14844. - * a while ;-) */
  14845. - field_done(&Vino->chA);
  14846. + if (a_eof)
  14847. + field_done(&Vino->chA);
  14848. + if (b_eof)
  14849. + field_done(&Vino->chB);
  14850. }
  14851. static int vino_grab(struct vino_device *v, int frame)
  14852. --- a/drivers/mtd/devices/docprobe.c
  14853. +++ b/drivers/mtd/devices/docprobe.c
  14854. @@ -89,10 +89,10 @@ static unsigned long __initdata doc_loca
  14855. 0xe4000000,
  14856. #elif defined(CONFIG_MOMENCO_OCELOT)
  14857. 0x2f000000,
  14858. - 0xff000000,
  14859. + 0xff000000,
  14860. #elif defined(CONFIG_MOMENCO_OCELOT_G) || defined (CONFIG_MOMENCO_OCELOT_C)
  14861. - 0xff000000,
  14862. -##else
  14863. + 0xff000000,
  14864. +#else
  14865. #warning Unknown architecture for DiskOnChip. No default probe locations defined
  14866. #endif
  14867. 0 };
  14868. --- a/drivers/mtd/devices/ms02-nv.c
  14869. +++ b/drivers/mtd/devices/ms02-nv.c
  14870. @@ -1,10 +1,10 @@
  14871. /*
  14872. - * Copyright (c) 2001 Maciej W. Rozycki
  14873. + * Copyright (c) 2001 Maciej W. Rozycki
  14874. *
  14875. - * This program is free software; you can redistribute it and/or
  14876. - * modify it under the terms of the GNU General Public License
  14877. - * as published by the Free Software Foundation; either version
  14878. - * 2 of the License, or (at your option) any later version.
  14879. + * This program is free software; you can redistribute it and/or
  14880. + * modify it under the terms of the GNU General Public License
  14881. + * as published by the Free Software Foundation; either version
  14882. + * 2 of the License, or (at your option) any later version.
  14883. *
  14884. * $Id: ms02-nv.c,v 1.2 2003/01/24 14:05:17 dwmw2 Exp $
  14885. */
  14886. @@ -29,18 +29,18 @@
  14887. static char version[] __initdata =
  14888. - "ms02-nv.c: v.1.0.0 13 Aug 2001 Maciej W. Rozycki.\n";
  14889. + "ms02-nv.c: v.1.0.0 13 Aug 2001 Maciej W. Rozycki.\n";
  14890. -MODULE_AUTHOR("Maciej W. Rozycki <[email protected]>");
  14891. +MODULE_AUTHOR("Maciej W. Rozycki <[email protected]>");
  14892. MODULE_DESCRIPTION("DEC MS02-NV NVRAM module driver");
  14893. MODULE_LICENSE("GPL");
  14894. /*
  14895. * Addresses we probe for an MS02-NV at. Modules may be located
  14896. - * at any 8MB boundary within a 0MB up to 112MB range or at any 32MB
  14897. - * boundary within a 0MB up to 448MB range. We don't support a module
  14898. - * at 0MB, though.
  14899. + * at any 8MiB boundary within a 0MiB up to 112MiB range or at any 32MiB
  14900. + * boundary within a 0MiB up to 448MiB range. We don't support a module
  14901. + * at 0MiB, though.
  14902. */
  14903. static ulong ms02nv_addrs[] __initdata = {
  14904. 0x07000000, 0x06800000, 0x06000000, 0x05800000, 0x05000000,
  14905. @@ -130,7 +130,7 @@ static int __init ms02nv_init_one(ulong
  14906. int ret = -ENODEV;
  14907. - /* The module decodes 8MB of address space. */
  14908. + /* The module decodes 8MiB of address space. */
  14909. mod_res = kmalloc(sizeof(*mod_res), GFP_KERNEL);
  14910. if (!mod_res)
  14911. return -ENOMEM;
  14912. @@ -233,7 +233,7 @@ static int __init ms02nv_init_one(ulong
  14913. goto err_out_csr_res;
  14914. }
  14915. - printk(KERN_INFO "mtd%d: %s at 0x%08lx, size %uMB.\n",
  14916. + printk(KERN_INFO "mtd%d: %s at 0x%08lx, size %uMiB.\n",
  14917. mtd->index, ms02nv_name, addr, size >> 20);
  14918. mp->next = root_ms02nv_mtd;
  14919. @@ -293,12 +293,12 @@ static int __init ms02nv_init(void)
  14920. switch (mips_machtype) {
  14921. case MACH_DS5000_200:
  14922. - csr = (volatile u32 *)KN02_CSR_ADDR;
  14923. + csr = (volatile u32 *)KN02_CSR_BASE;
  14924. if (*csr & KN02_CSR_BNK32M)
  14925. stride = 2;
  14926. break;
  14927. case MACH_DS5000_2X0:
  14928. - case MACH_DS5000:
  14929. + case MACH_DS5900:
  14930. csr = (volatile u32 *)KN03_MCR_BASE;
  14931. if (*csr & KN03_MCR_BNK32M)
  14932. stride = 2;
  14933. --- a/drivers/mtd/devices/ms02-nv.h
  14934. +++ b/drivers/mtd/devices/ms02-nv.h
  14935. @@ -1,32 +1,96 @@
  14936. /*
  14937. - * Copyright (c) 2001 Maciej W. Rozycki
  14938. + * Copyright (c) 2001, 2003 Maciej W. Rozycki
  14939. *
  14940. - * This program is free software; you can redistribute it and/or
  14941. - * modify it under the terms of the GNU General Public License
  14942. - * as published by the Free Software Foundation; either version
  14943. - * 2 of the License, or (at your option) any later version.
  14944. + * DEC MS02-NV (54-20948-01) battery backed-up NVRAM module for
  14945. + * DECstation/DECsystem 5000/2x0 and DECsystem 5900 and 5900/260
  14946. + * systems.
  14947. + *
  14948. + * This program is free software; you can redistribute it and/or
  14949. + * modify it under the terms of the GNU General Public License
  14950. + * as published by the Free Software Foundation; either version
  14951. + * 2 of the License, or (at your option) any later version.
  14952. + *
  14953. + * $Id: ms02-nv.h,v 1.3 2003/08/19 09:25:36 dwmw2 Exp $
  14954. */
  14955. #include <linux/ioport.h>
  14956. #include <linux/mtd/mtd.h>
  14957. +/*
  14958. + * Addresses are decoded as follows:
  14959. + *
  14960. + * 0x000000 - 0x3fffff SRAM
  14961. + * 0x400000 - 0x7fffff CSR
  14962. + *
  14963. + * Within the SRAM area the following ranges are forced by the system
  14964. + * firmware:
  14965. + *
  14966. + * 0x000000 - 0x0003ff diagnostic area, destroyed upon a reboot
  14967. + * 0x000400 - ENDofRAM storage area, available to operating systems
  14968. + *
  14969. + * but we can't really use the available area right from 0x000400 as
  14970. + * the first word is used by the firmware as a status flag passed
  14971. + * from an operating system. If anything but the valid data magic
  14972. + * ID value is found, the firmware considers the SRAM clean, i.e.
  14973. + * containing no valid data, and disables the battery resulting in
  14974. + * data being erased as soon as power is switched off. So the choice
  14975. + * for the start address of the user-available is 0x001000 which is
  14976. + * nicely page aligned. The area between 0x000404 and 0x000fff may
  14977. + * be used by the driver for own needs.
  14978. + *
  14979. + * The diagnostic area defines two status words to be read by an
  14980. + * operating system, a magic ID to distinguish a MS02-NV board from
  14981. + * anything else and a status information providing results of tests
  14982. + * as well as the size of SRAM available, which can be 1MiB or 2MiB
  14983. + * (that's what the firmware handles; no idea if 2MiB modules ever
  14984. + * existed).
  14985. + *
  14986. + * The firmware only handles the MS02-NV board if installed in the
  14987. + * last (15th) slot, so for any other location the status information
  14988. + * stored in the SRAM cannot be relied upon. But from the hardware
  14989. + * point of view there is no problem using up to 14 such boards in a
  14990. + * system -- only the 1st slot needs to be filled with a DRAM module.
  14991. + * The MS02-NV board is ECC-protected, like other MS02 memory boards.
  14992. + *
  14993. + * The state of the battery as provided by the CSR is reflected on
  14994. + * the two onboard LEDs. When facing the battery side of the board,
  14995. + * with the LEDs at the top left and the battery at the bottom right
  14996. + * (i.e. looking from the back side of the system box), their meaning
  14997. + * is as follows (the system has to be powered on):
  14998. + *
  14999. + * left LED battery disable status: lit = enabled
  15000. + * right LED battery condition status: lit = OK
  15001. + */
  15002. +
  15003. /* MS02-NV iomem register offsets. */
  15004. #define MS02NV_CSR 0x400000 /* control & status register */
  15005. +/* MS02-NV CSR status bits. */
  15006. +#define MS02NV_CSR_BATT_OK 0x01 /* battery OK */
  15007. +#define MS02NV_CSR_BATT_OFF 0x02 /* battery disabled */
  15008. +
  15009. +
  15010. /* MS02-NV memory offsets. */
  15011. #define MS02NV_DIAG 0x0003f8 /* diagnostic status */
  15012. #define MS02NV_MAGIC 0x0003fc /* MS02-NV magic ID */
  15013. -#define MS02NV_RAM 0x000400 /* general-purpose RAM start */
  15014. +#define MS02NV_VALID 0x000400 /* valid data magic ID */
  15015. +#define MS02NV_RAM 0x001000 /* user-exposed RAM start */
  15016. -/* MS02-NV diagnostic status constants. */
  15017. -#define MS02NV_DIAG_SIZE_MASK 0xf0 /* RAM size mask */
  15018. -#define MS02NV_DIAG_SIZE_SHIFT 0x10 /* RAM size shift (left) */
  15019. +/* MS02-NV diagnostic status bits. */
  15020. +#define MS02NV_DIAG_TEST 0x01 /* SRAM test done (?) */
  15021. +#define MS02NV_DIAG_RO 0x02 /* SRAM r/o test done */
  15022. +#define MS02NV_DIAG_RW 0x04 /* SRAM r/w test done */
  15023. +#define MS02NV_DIAG_FAIL 0x08 /* SRAM test failed */
  15024. +#define MS02NV_DIAG_SIZE_MASK 0xf0 /* SRAM size mask */
  15025. +#define MS02NV_DIAG_SIZE_SHIFT 0x10 /* SRAM size shift (left) */
  15026. /* MS02-NV general constants. */
  15027. #define MS02NV_ID 0x03021966 /* MS02-NV magic ID value */
  15028. +#define MS02NV_VALID_ID 0xbd100248 /* valid data magic ID value */
  15029. #define MS02NV_SLOT_SIZE 0x800000 /* size of the address space
  15030. decoded by the module */
  15031. +
  15032. typedef volatile u32 ms02nv_uint;
  15033. struct ms02nv_private {
  15034. --- a/drivers/mtd/maps/Config.in
  15035. +++ b/drivers/mtd/maps/Config.in
  15036. @@ -51,11 +51,26 @@ if [ "$CONFIG_MIPS" = "y" ]; then
  15037. dep_tristate ' Pb1000 MTD support' CONFIG_MTD_PB1000 $CONFIG_MIPS_PB1000
  15038. dep_tristate ' Pb1500 MTD support' CONFIG_MTD_PB1500 $CONFIG_MIPS_PB1500
  15039. dep_tristate ' Pb1100 MTD support' CONFIG_MTD_PB1100 $CONFIG_MIPS_PB1100
  15040. + dep_tristate ' Bosporus MTD support' CONFIG_MTD_BOSPORUS $CONFIG_MIPS_BOSPORUS
  15041. + dep_tristate ' XXS1500 boot flash device' CONFIG_MTD_XXS1500 $CONFIG_MIPS_XXS1500
  15042. + dep_tristate ' MTX-1 flash device' CONFIG_MTD_MTX1 $CONFIG_MIPS_MTX1
  15043. if [ "$CONFIG_MTD_PB1500" = "y" -o "$CONFIG_MTD_PB1500" = "m" \
  15044. -o "$CONFIG_MTD_PB1100" = "y" -o "$CONFIG_MTD_PB1100" = "m" ]; then
  15045. bool ' Pb[15]00 boot flash device' CONFIG_MTD_PB1500_BOOT
  15046. bool ' Pb[15]00 user flash device (2nd 32MiB bank)' CONFIG_MTD_PB1500_USER
  15047. fi
  15048. + tristate ' Db1x00 MTD support' CONFIG_MTD_DB1X00
  15049. + if [ "$CONFIG_MTD_DB1X00" = "y" -o "$CONFIG_MTD_DB1X00" = "m" ]; then
  15050. + bool ' Db1x00 boot flash device' CONFIG_MTD_DB1X00_BOOT
  15051. + bool ' Db1x00 user flash device (2nd bank)' CONFIG_MTD_DB1X00_USER
  15052. + fi
  15053. + tristate ' Pb1550 MTD support' CONFIG_MTD_PB1550
  15054. + if [ "$CONFIG_MTD_PB1550" = "y" -o "$CONFIG_MTD_PB1550" = "m" ]; then
  15055. + bool ' Pb1550 Boot Flash' CONFIG_MTD_PB1550_BOOT
  15056. + bool ' Pb1550 User Parameter Flash' CONFIG_MTD_PB1550_USER
  15057. + fi
  15058. + dep_tristate ' Hydrogen 3 MTD support' CONFIG_MTD_HYDROGEN3 $CONFIG_MIPS_HYDROGEN3
  15059. + dep_tristate ' Mirage MTD support' CONFIG_MTD_MIRAGE $CONFIG_MIPS_MIRAGE
  15060. 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
  15061. if [ "$CONFIG_MTD_CSTM_MIPS_IXX" = "y" -o "$CONFIG_MTD_CSTM_MIPS_IXX" = "m" ]; then
  15062. hex ' Physical start address of flash mapping' CONFIG_MTD_CSTM_MIPS_IXX_START 0x8000000
  15063. --- /dev/null
  15064. +++ b/drivers/mtd/maps/db1x00-flash.c
  15065. @@ -0,0 +1,283 @@
  15066. +/*
  15067. + * Flash memory access on Alchemy Db1xxx boards
  15068. + *
  15069. + * (C) 2003 Pete Popov <[email protected]>
  15070. + *
  15071. + */
  15072. +
  15073. +#include <linux/config.h>
  15074. +#include <linux/module.h>
  15075. +#include <linux/types.h>
  15076. +#include <linux/kernel.h>
  15077. +
  15078. +#include <linux/mtd/mtd.h>
  15079. +#include <linux/mtd/map.h>
  15080. +#include <linux/mtd/partitions.h>
  15081. +
  15082. +#include <asm/io.h>
  15083. +#include <asm/au1000.h>
  15084. +#include <asm/db1x00.h>
  15085. +
  15086. +#ifdef DEBUG_RW
  15087. +#define DBG(x...) printk(x)
  15088. +#else
  15089. +#define DBG(x...)
  15090. +#endif
  15091. +
  15092. +static unsigned long window_addr;
  15093. +static unsigned long window_size;
  15094. +static unsigned long flash_size;
  15095. +
  15096. +__u8 physmap_read8(struct map_info *map, unsigned long ofs)
  15097. +{
  15098. + __u8 ret;
  15099. + ret = __raw_readb(map->map_priv_1 + ofs);
  15100. + DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  15101. + return ret;
  15102. +}
  15103. +
  15104. +__u16 physmap_read16(struct map_info *map, unsigned long ofs)
  15105. +{
  15106. + __u16 ret;
  15107. + ret = __raw_readw(map->map_priv_1 + ofs);
  15108. + DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  15109. + return ret;
  15110. +}
  15111. +
  15112. +__u32 physmap_read32(struct map_info *map, unsigned long ofs)
  15113. +{
  15114. + __u32 ret;
  15115. + ret = __raw_readl(map->map_priv_1 + ofs);
  15116. + DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  15117. + return ret;
  15118. +}
  15119. +
  15120. +void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
  15121. +{
  15122. + DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
  15123. + memcpy_fromio(to, map->map_priv_1 + from, len);
  15124. +}
  15125. +
  15126. +void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
  15127. +{
  15128. + DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  15129. + __raw_writeb(d, map->map_priv_1 + adr);
  15130. + mb();
  15131. +}
  15132. +
  15133. +void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
  15134. +{
  15135. + DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  15136. + __raw_writew(d, map->map_priv_1 + adr);
  15137. + mb();
  15138. +}
  15139. +
  15140. +void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
  15141. +{
  15142. + DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  15143. + __raw_writel(d, map->map_priv_1 + adr);
  15144. + mb();
  15145. +}
  15146. +
  15147. +void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
  15148. +{
  15149. + DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
  15150. + memcpy_toio(map->map_priv_1 + to, from, len);
  15151. +}
  15152. +
  15153. +static struct map_info db1x00_map = {
  15154. + name: "Db1x00 flash",
  15155. + read8: physmap_read8,
  15156. + read16: physmap_read16,
  15157. + read32: physmap_read32,
  15158. + copy_from: physmap_copy_from,
  15159. + write8: physmap_write8,
  15160. + write16: physmap_write16,
  15161. + write32: physmap_write32,
  15162. + copy_to: physmap_copy_to,
  15163. +};
  15164. +
  15165. +static unsigned char flash_buswidth = 4;
  15166. +
  15167. +/*
  15168. + * The Db1x boards support different flash densities. We setup
  15169. + * the mtd_partition structures below for default of 64Mbit
  15170. + * flash densities, and override the partitions sizes, if
  15171. + * necessary, after we check the board status register.
  15172. + */
  15173. +
  15174. +#ifdef DB1X00_BOTH_BANKS
  15175. +/* both banks will be used. Combine the first bank and the first
  15176. + * part of the second bank together into a single jffs/jffs2
  15177. + * partition.
  15178. + */
  15179. +static struct mtd_partition db1x00_partitions[] = {
  15180. + {
  15181. + name: "User FS",
  15182. + size: 0x1c00000,
  15183. + offset: 0x0000000
  15184. + },{
  15185. + name: "yamon",
  15186. + size: 0x0100000,
  15187. + offset: MTDPART_OFS_APPEND,
  15188. + mask_flags: MTD_WRITEABLE
  15189. + },{
  15190. + name: "raw kernel",
  15191. + size: (0x300000-0x40000), /* last 256KB is yamon env */
  15192. + offset: MTDPART_OFS_APPEND,
  15193. + }
  15194. +};
  15195. +#elif defined(DB1X00_BOOT_ONLY)
  15196. +static struct mtd_partition db1x00_partitions[] = {
  15197. + {
  15198. + name: "User FS",
  15199. + size: 0x00c00000,
  15200. + offset: 0x0000000
  15201. + },{
  15202. + name: "yamon",
  15203. + size: 0x0100000,
  15204. + offset: MTDPART_OFS_APPEND,
  15205. + mask_flags: MTD_WRITEABLE
  15206. + },{
  15207. + name: "raw kernel",
  15208. + size: (0x300000-0x40000), /* last 256KB is yamon env */
  15209. + offset: MTDPART_OFS_APPEND,
  15210. + }
  15211. +};
  15212. +#elif defined(DB1X00_USER_ONLY)
  15213. +static struct mtd_partition db1x00_partitions[] = {
  15214. + {
  15215. + name: "User FS",
  15216. + size: 0x0e00000,
  15217. + offset: 0x0000000
  15218. + },{
  15219. + name: "raw kernel",
  15220. + size: MTDPART_SIZ_FULL,
  15221. + offset: MTDPART_OFS_APPEND,
  15222. + }
  15223. +};
  15224. +#else
  15225. +#error MTD_DB1X00 define combo error /* should never happen */
  15226. +#endif
  15227. +
  15228. +
  15229. +#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
  15230. +
  15231. +static struct mtd_partition *parsed_parts;
  15232. +static struct mtd_info *mymtd;
  15233. +
  15234. +/*
  15235. + * Probe the flash density and setup window address and size
  15236. + * based on user CONFIG options. There are times when we don't
  15237. + * want the MTD driver to be probing the boot or user flash,
  15238. + * so having the option to enable only one bank is important.
  15239. + */
  15240. +int setup_flash_params()
  15241. +{
  15242. + switch ((bcsr->status >> 14) & 0x3) {
  15243. + case 0: /* 64Mbit devices */
  15244. + flash_size = 0x800000; /* 8MB per part */
  15245. +#if defined(DB1X00_BOTH_BANKS)
  15246. + window_addr = 0x1E000000;
  15247. + window_size = 0x2000000;
  15248. +#elif defined(DB1X00_BOOT_ONLY)
  15249. + window_addr = 0x1F000000;
  15250. + window_size = 0x1000000;
  15251. +#else /* USER ONLY */
  15252. + window_addr = 0x1E000000;
  15253. + window_size = 0x1000000;
  15254. +#endif
  15255. + break;
  15256. + case 1:
  15257. + /* 128 Mbit devices */
  15258. + flash_size = 0x1000000; /* 16MB per part */
  15259. +#if defined(DB1X00_BOTH_BANKS)
  15260. + window_addr = 0x1C000000;
  15261. + window_size = 0x4000000;
  15262. + /* USERFS from 0x1C00 0000 to 0x1FC0 0000 */
  15263. + db1x00_partitions[0].size = 0x3C00000;
  15264. +#elif defined(DB1X00_BOOT_ONLY)
  15265. + window_addr = 0x1E000000;
  15266. + window_size = 0x2000000;
  15267. + /* USERFS from 0x1E00 0000 to 0x1FC0 0000 */
  15268. + db1x00_partitions[0].size = 0x1C00000;
  15269. +#else /* USER ONLY */
  15270. + window_addr = 0x1C000000;
  15271. + window_size = 0x2000000;
  15272. + /* USERFS from 0x1C00 0000 to 0x1DE00000 */
  15273. + db1x00_partitions[0].size = 0x1DE0000;
  15274. +#endif
  15275. + break;
  15276. + case 2:
  15277. + /* 256 Mbit devices */
  15278. + flash_size = 0x4000000; /* 64MB per part */
  15279. +#if defined(DB1X00_BOTH_BANKS)
  15280. + return 1;
  15281. +#elif defined(DB1X00_BOOT_ONLY)
  15282. + /* Boot ROM flash bank only; no user bank */
  15283. + window_addr = 0x1C000000;
  15284. + window_size = 0x4000000;
  15285. + /* USERFS from 0x1C00 0000 to 0x1FC00000 */
  15286. + db1x00_partitions[0].size = 0x3C00000;
  15287. +#else /* USER ONLY */
  15288. + return 1;
  15289. +#endif
  15290. + break;
  15291. + default:
  15292. + return 1;
  15293. + }
  15294. + return 0;
  15295. +}
  15296. +
  15297. +int __init db1x00_mtd_init(void)
  15298. +{
  15299. + struct mtd_partition *parts;
  15300. + int nb_parts = 0;
  15301. + char *part_type;
  15302. +
  15303. + /* Default flash buswidth */
  15304. + db1x00_map.buswidth = flash_buswidth;
  15305. +
  15306. + if (setup_flash_params())
  15307. + return -ENXIO;
  15308. +
  15309. + /*
  15310. + * Static partition definition selection
  15311. + */
  15312. + part_type = "static";
  15313. + parts = db1x00_partitions;
  15314. + nb_parts = NB_OF(db1x00_partitions);
  15315. + db1x00_map.size = window_size;
  15316. +
  15317. + /*
  15318. + * Now let's probe for the actual flash. Do it here since
  15319. + * specific machine settings might have been set above.
  15320. + */
  15321. + printk(KERN_NOTICE "Db1xxx flash: probing %d-bit flash bus\n",
  15322. + db1x00_map.buswidth*8);
  15323. + db1x00_map.map_priv_1 =
  15324. + (unsigned long)ioremap(window_addr, window_size);
  15325. + mymtd = do_map_probe("cfi_probe", &db1x00_map);
  15326. + if (!mymtd) return -ENXIO;
  15327. + mymtd->module = THIS_MODULE;
  15328. +
  15329. + add_mtd_partitions(mymtd, parts, nb_parts);
  15330. + return 0;
  15331. +}
  15332. +
  15333. +static void __exit db1x00_mtd_cleanup(void)
  15334. +{
  15335. + if (mymtd) {
  15336. + del_mtd_partitions(mymtd);
  15337. + map_destroy(mymtd);
  15338. + if (parsed_parts)
  15339. + kfree(parsed_parts);
  15340. + }
  15341. +}
  15342. +
  15343. +module_init(db1x00_mtd_init);
  15344. +module_exit(db1x00_mtd_cleanup);
  15345. +
  15346. +MODULE_AUTHOR("Pete Popov");
  15347. +MODULE_DESCRIPTION("Db1x00 mtd map driver");
  15348. +MODULE_LICENSE("GPL");
  15349. --- /dev/null
  15350. +++ b/drivers/mtd/maps/hydrogen3-flash.c
  15351. @@ -0,0 +1,189 @@
  15352. +/*
  15353. + * Flash memory access on Alchemy HydrogenIII boards
  15354. + *
  15355. + * (C) 2003 Pete Popov <[email protected]>
  15356. + *
  15357. + */
  15358. +
  15359. +#include <linux/config.h>
  15360. +#include <linux/module.h>
  15361. +#include <linux/types.h>
  15362. +#include <linux/kernel.h>
  15363. +
  15364. +#include <linux/mtd/mtd.h>
  15365. +#include <linux/mtd/map.h>
  15366. +#include <linux/mtd/partitions.h>
  15367. +
  15368. +#include <asm/io.h>
  15369. +#include <asm/au1000.h>
  15370. +
  15371. +#ifdef DEBUG_RW
  15372. +#define DBG(x...) printk(x)
  15373. +#else
  15374. +#define DBG(x...)
  15375. +#endif
  15376. +
  15377. +#define WINDOW_ADDR 0x1E000000
  15378. +#define WINDOW_SIZE 0x02000000
  15379. +
  15380. +
  15381. +__u8 physmap_read8(struct map_info *map, unsigned long ofs)
  15382. +{
  15383. + __u8 ret;
  15384. + ret = __raw_readb(map->map_priv_1 + ofs);
  15385. + DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  15386. + return ret;
  15387. +}
  15388. +
  15389. +__u16 physmap_read16(struct map_info *map, unsigned long ofs)
  15390. +{
  15391. + __u16 ret;
  15392. + ret = __raw_readw(map->map_priv_1 + ofs);
  15393. + DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  15394. + return ret;
  15395. +}
  15396. +
  15397. +__u32 physmap_read32(struct map_info *map, unsigned long ofs)
  15398. +{
  15399. + __u32 ret;
  15400. + ret = __raw_readl(map->map_priv_1 + ofs);
  15401. + DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  15402. + return ret;
  15403. +}
  15404. +
  15405. +void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
  15406. +{
  15407. + DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
  15408. + memcpy_fromio(to, map->map_priv_1 + from, len);
  15409. +}
  15410. +
  15411. +void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
  15412. +{
  15413. + DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  15414. + __raw_writeb(d, map->map_priv_1 + adr);
  15415. + mb();
  15416. +}
  15417. +
  15418. +void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
  15419. +{
  15420. + DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  15421. + __raw_writew(d, map->map_priv_1 + adr);
  15422. + mb();
  15423. +}
  15424. +
  15425. +void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
  15426. +{
  15427. + DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  15428. + __raw_writel(d, map->map_priv_1 + adr);
  15429. + mb();
  15430. +}
  15431. +
  15432. +void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
  15433. +{
  15434. + DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
  15435. + memcpy_toio(map->map_priv_1 + to, from, len);
  15436. +}
  15437. +
  15438. +static struct map_info hydrogen3_map = {
  15439. + name: "HydrogenIII flash",
  15440. + read8: physmap_read8,
  15441. + read16: physmap_read16,
  15442. + read32: physmap_read32,
  15443. + copy_from: physmap_copy_from,
  15444. + write8: physmap_write8,
  15445. + write16: physmap_write16,
  15446. + write32: physmap_write32,
  15447. + copy_to: physmap_copy_to,
  15448. +};
  15449. +
  15450. +static unsigned char flash_buswidth = 4;
  15451. +
  15452. +/* MTDPART_OFS_APPEND is vastly preferred to any attempt at statically lining
  15453. + * up the offsets. */
  15454. +static struct mtd_partition hydrogen3_partitions[] = {
  15455. + {
  15456. + name: "User FS",
  15457. + size: 0x1c00000,
  15458. + offset: 0x0000000
  15459. + },{
  15460. + name: "yamon",
  15461. + size: 0x0100000,
  15462. + offset: MTDPART_OFS_APPEND,
  15463. + mask_flags: MTD_WRITEABLE
  15464. + },{
  15465. + name: "raw kernel",
  15466. + size: 0x02c0000,
  15467. + offset: MTDPART_OFS_APPEND
  15468. + }
  15469. +};
  15470. +
  15471. +#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
  15472. +
  15473. +static struct mtd_partition *parsed_parts;
  15474. +static struct mtd_info *mymtd;
  15475. +
  15476. +int __init hydrogen3_mtd_init(void)
  15477. +{
  15478. + struct mtd_partition *parts;
  15479. + int nb_parts = 0;
  15480. + char *part_type;
  15481. +
  15482. + /* Default flash buswidth */
  15483. + hydrogen3_map.buswidth = flash_buswidth;
  15484. +
  15485. + /*
  15486. + * Static partition definition selection
  15487. + */
  15488. + part_type = "static";
  15489. + parts = hydrogen3_partitions;
  15490. + nb_parts = NB_OF(hydrogen3_partitions);
  15491. + hydrogen3_map.size = WINDOW_SIZE;
  15492. +
  15493. + /*
  15494. + * Now let's probe for the actual flash. Do it here since
  15495. + * specific machine settings might have been set above.
  15496. + */
  15497. + printk(KERN_NOTICE "HydrogenIII flash: probing %d-bit flash bus\n",
  15498. + hydrogen3_map.buswidth*8);
  15499. + hydrogen3_map.map_priv_1 =
  15500. + (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
  15501. + mymtd = do_map_probe("cfi_probe", &hydrogen3_map);
  15502. + if (!mymtd) return -ENXIO;
  15503. + mymtd->module = THIS_MODULE;
  15504. +
  15505. + add_mtd_partitions(mymtd, parts, nb_parts);
  15506. + return 0;
  15507. +}
  15508. +
  15509. +static void __exit hydrogen3_mtd_cleanup(void)
  15510. +{
  15511. + if (mymtd) {
  15512. + del_mtd_partitions(mymtd);
  15513. + map_destroy(mymtd);
  15514. + if (parsed_parts)
  15515. + kfree(parsed_parts);
  15516. + }
  15517. +}
  15518. +
  15519. +/*#ifndef MODULE
  15520. +
  15521. +static int __init _bootflashonly(char *str)
  15522. +{
  15523. + bootflashonly = simple_strtol(str, NULL, 0);
  15524. + return 1;
  15525. +}
  15526. +
  15527. +
  15528. +__setup("bootflashonly=", _bootflashonly);
  15529. +
  15530. +#endif*/
  15531. +
  15532. +
  15533. +module_init(hydrogen3_mtd_init);
  15534. +module_exit(hydrogen3_mtd_cleanup);
  15535. +
  15536. +MODULE_PARM(bootflashonly, "i");
  15537. +MODULE_PARM_DESC(bootflashonly, "1=use \"boot flash only\"");
  15538. +MODULE_AUTHOR("Pete Popov");
  15539. +MODULE_DESCRIPTION("HydrogenIII mtd map driver");
  15540. +MODULE_LICENSE("GPL");
  15541. --- a/drivers/mtd/maps/lasat.c
  15542. +++ b/drivers/mtd/maps/lasat.c
  15543. @@ -1,15 +1,6 @@
  15544. /*
  15545. * Flash device on lasat 100 and 200 boards
  15546. *
  15547. - * Presumably (C) 2002 Brian Murphy <[email protected]> or whoever he
  15548. - * works for.
  15549. - *
  15550. - * This program is free software; you can redistribute it and/or
  15551. - * modify it under the terms of the GNU General Public License version
  15552. - * 2 as published by the Free Software Foundation.
  15553. - *
  15554. - * $Id: lasat.c,v 1.1 2003/01/24 14:26:38 dwmw2 Exp $
  15555. - *
  15556. */
  15557. #include <linux/module.h>
  15558. @@ -21,7 +12,6 @@
  15559. #include <linux/mtd/partitions.h>
  15560. #include <linux/config.h>
  15561. #include <asm/lasat/lasat.h>
  15562. -#include <asm/lasat/lasat_mtd.h>
  15563. static struct mtd_info *mymtd;
  15564. @@ -69,30 +59,33 @@ static void sp_copy_to(struct map_info *
  15565. }
  15566. static struct map_info sp_map = {
  15567. - .name = "SP flash",
  15568. - .buswidth = 4,
  15569. - .read8 = sp_read8,
  15570. - .read16 = sp_read16,
  15571. - .read32 = sp_read32,
  15572. - .copy_from = sp_copy_from,
  15573. - .write8 = sp_write8,
  15574. - .write16 = sp_write16,
  15575. - .write32 = sp_write32,
  15576. - .copy_to = sp_copy_to
  15577. + name: "SP flash",
  15578. + buswidth: 4,
  15579. + read8: sp_read8,
  15580. + read16: sp_read16,
  15581. + read32: sp_read32,
  15582. + copy_from: sp_copy_from,
  15583. + write8: sp_write8,
  15584. + write16: sp_write16,
  15585. + write32: sp_write32,
  15586. + copy_to: sp_copy_to
  15587. };
  15588. static struct mtd_partition partition_info[LASAT_MTD_LAST];
  15589. -static char *lasat_mtd_partnames[] = {"Bootloader", "Service", "Normal", "Filesystem", "Config"};
  15590. +static char *lasat_mtd_partnames[] = {"Bootloader", "Service", "Normal", "Config", "Filesystem"};
  15591. static int __init init_sp(void)
  15592. {
  15593. int i;
  15594. + int nparts = 0;
  15595. /* this does not play well with the old flash code which
  15596. * protects and uprotects the flash when necessary */
  15597. printk(KERN_NOTICE "Unprotecting flash\n");
  15598. *lasat_misc->flash_wp_reg |= 1 << lasat_misc->flash_wp_bit;
  15599. - sp_map.map_priv_1 = lasat_flash_partition_start(LASAT_MTD_BOOTLOADER);
  15600. + sp_map.map_priv_1 = ioremap_nocache(
  15601. + lasat_flash_partition_start(LASAT_MTD_BOOTLOADER),
  15602. + lasat_board_info.li_flash_size);
  15603. sp_map.size = lasat_board_info.li_flash_size;
  15604. printk(KERN_NOTICE "sp flash device: %lx at %lx\n",
  15605. @@ -109,12 +102,15 @@ static int __init init_sp(void)
  15606. for (i=0; i < LASAT_MTD_LAST; i++) {
  15607. size = lasat_flash_partition_size(i);
  15608. - partition_info[i].size = size;
  15609. - partition_info[i].offset = offset;
  15610. - offset += size;
  15611. + if (size != 0) {
  15612. + nparts++;
  15613. + partition_info[i].size = size;
  15614. + partition_info[i].offset = offset;
  15615. + offset += size;
  15616. + }
  15617. }
  15618. - add_mtd_partitions( mymtd, partition_info, LASAT_MTD_LAST );
  15619. + add_mtd_partitions( mymtd, partition_info, nparts );
  15620. return 0;
  15621. }
  15622. @@ -124,11 +120,11 @@ static int __init init_sp(void)
  15623. static void __exit cleanup_sp(void)
  15624. {
  15625. if (mymtd) {
  15626. - del_mtd_partitions(mymtd);
  15627. - map_destroy(mymtd);
  15628. + del_mtd_partitions(mymtd);
  15629. + map_destroy(mymtd);
  15630. }
  15631. if (sp_map.map_priv_1) {
  15632. - sp_map.map_priv_1 = 0;
  15633. + sp_map.map_priv_1 = 0;
  15634. }
  15635. }
  15636. --- a/drivers/mtd/maps/Makefile
  15637. +++ b/drivers/mtd/maps/Makefile
  15638. @@ -52,7 +52,13 @@ obj-$(CONFIG_MTD_PCI) += pci.o
  15639. obj-$(CONFIG_MTD_PB1000) += pb1xxx-flash.o
  15640. obj-$(CONFIG_MTD_PB1100) += pb1xxx-flash.o
  15641. obj-$(CONFIG_MTD_PB1500) += pb1xxx-flash.o
  15642. +obj-$(CONFIG_MTD_XXS1500) += xxs1500.o
  15643. +obj-$(CONFIG_MTD_MTX1) += mtx-1.o
  15644. obj-$(CONFIG_MTD_LASAT) += lasat.o
  15645. +obj-$(CONFIG_MTD_DB1X00) += db1x00-flash.o
  15646. +obj-$(CONFIG_MTD_PB1550) += pb1550-flash.o
  15647. +obj-$(CONFIG_MTD_HYDROGEN3) += hydrogen3-flash.o
  15648. +obj-$(CONFIG_MTD_BOSPORUS) += pb1xxx-flash.o
  15649. obj-$(CONFIG_MTD_AUTCPU12) += autcpu12-nvram.o
  15650. obj-$(CONFIG_MTD_EDB7312) += edb7312.o
  15651. obj-$(CONFIG_MTD_IMPA7) += impa7.o
  15652. @@ -61,5 +67,6 @@ obj-$(CONFIG_MTD_REDWOOD) += redwood.o
  15653. obj-$(CONFIG_MTD_UCLINUX) += uclinux.o
  15654. obj-$(CONFIG_MTD_NETtel) += nettel.o
  15655. obj-$(CONFIG_MTD_SCB2_FLASH) += scb2_flash.o
  15656. +obj-$(CONFIG_MTD_MIRAGE) += mirage-flash.o
  15657. include $(TOPDIR)/Rules.make
  15658. --- /dev/null
  15659. +++ b/drivers/mtd/maps/mirage-flash.c
  15660. @@ -0,0 +1,194 @@
  15661. +/*
  15662. + * Flash memory access on AMD Mirage board.
  15663. + *
  15664. + * (C) 2003 Embedded Edge
  15665. + * based on mirage-flash.c:
  15666. + * (C) 2003 Pete Popov <[email protected]>
  15667. + *
  15668. + */
  15669. +
  15670. +#include <linux/config.h>
  15671. +#include <linux/module.h>
  15672. +#include <linux/types.h>
  15673. +#include <linux/kernel.h>
  15674. +
  15675. +#include <linux/mtd/mtd.h>
  15676. +#include <linux/mtd/map.h>
  15677. +#include <linux/mtd/partitions.h>
  15678. +
  15679. +#include <asm/io.h>
  15680. +#include <asm/au1000.h>
  15681. +//#include <asm/mirage.h>
  15682. +
  15683. +#ifdef DEBUG_RW
  15684. +#define DBG(x...) printk(x)
  15685. +#else
  15686. +#define DBG(x...)
  15687. +#endif
  15688. +
  15689. +static unsigned long window_addr;
  15690. +static unsigned long window_size;
  15691. +static unsigned long flash_size;
  15692. +
  15693. +__u8 physmap_read8(struct map_info *map, unsigned long ofs)
  15694. +{
  15695. + __u8 ret;
  15696. + ret = __raw_readb(map->map_priv_1 + ofs);
  15697. + DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  15698. + return ret;
  15699. +}
  15700. +
  15701. +__u16 physmap_read16(struct map_info *map, unsigned long ofs)
  15702. +{
  15703. + __u16 ret;
  15704. + ret = __raw_readw(map->map_priv_1 + ofs);
  15705. + DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  15706. + return ret;
  15707. +}
  15708. +
  15709. +__u32 physmap_read32(struct map_info *map, unsigned long ofs)
  15710. +{
  15711. + __u32 ret;
  15712. + ret = __raw_readl(map->map_priv_1 + ofs);
  15713. + DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  15714. + return ret;
  15715. +}
  15716. +
  15717. +void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
  15718. +{
  15719. + DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
  15720. + memcpy_fromio(to, map->map_priv_1 + from, len);
  15721. +}
  15722. +
  15723. +void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
  15724. +{
  15725. + DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  15726. + __raw_writeb(d, map->map_priv_1 + adr);
  15727. + mb();
  15728. +}
  15729. +
  15730. +void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
  15731. +{
  15732. + DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  15733. + __raw_writew(d, map->map_priv_1 + adr);
  15734. + mb();
  15735. +}
  15736. +
  15737. +void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
  15738. +{
  15739. + DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  15740. + __raw_writel(d, map->map_priv_1 + adr);
  15741. + mb();
  15742. +}
  15743. +
  15744. +void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
  15745. +{
  15746. + DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
  15747. + memcpy_toio(map->map_priv_1 + to, from, len);
  15748. +}
  15749. +
  15750. +static struct map_info mirage_map = {
  15751. + name: "Mirage flash",
  15752. + read8: physmap_read8,
  15753. + read16: physmap_read16,
  15754. + read32: physmap_read32,
  15755. + copy_from: physmap_copy_from,
  15756. + write8: physmap_write8,
  15757. + write16: physmap_write16,
  15758. + write32: physmap_write32,
  15759. + copy_to: physmap_copy_to,
  15760. +};
  15761. +
  15762. +static unsigned char flash_buswidth = 4;
  15763. +
  15764. +static struct mtd_partition mirage_partitions[] = {
  15765. + {
  15766. + name: "User FS",
  15767. + size: 0x1c00000,
  15768. + offset: 0x0000000
  15769. + },{
  15770. + name: "yamon",
  15771. + size: 0x0100000,
  15772. + offset: MTDPART_OFS_APPEND,
  15773. + mask_flags: MTD_WRITEABLE
  15774. + },{
  15775. + name: "raw kernel",
  15776. + size: (0x300000-0x40000), /* last 256KB is yamon env */
  15777. + offset: MTDPART_OFS_APPEND,
  15778. + }
  15779. +};
  15780. +
  15781. +#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
  15782. +
  15783. +static struct mtd_partition *parsed_parts;
  15784. +static struct mtd_info *mymtd;
  15785. +
  15786. +/*
  15787. + * Probe the flash density and setup window address and size
  15788. + * based on user CONFIG options. There are times when we don't
  15789. + * want the MTD driver to be probing the boot or user flash,
  15790. + * so having the option to enable only one bank is important.
  15791. + */
  15792. +int setup_flash_params()
  15793. +{
  15794. + flash_size = 0x4000000; /* 64MB per part */
  15795. + /* Boot ROM flash bank only; no user bank */
  15796. + window_addr = 0x1C000000;
  15797. + window_size = 0x4000000;
  15798. + /* USERFS from 0x1C00 0000 to 0x1FC00000 */
  15799. + mirage_partitions[0].size = 0x3C00000;
  15800. + return 0;
  15801. +}
  15802. +
  15803. +int __init mirage_mtd_init(void)
  15804. +{
  15805. + struct mtd_partition *parts;
  15806. + int nb_parts = 0;
  15807. + char *part_type;
  15808. +
  15809. + /* Default flash buswidth */
  15810. + mirage_map.buswidth = flash_buswidth;
  15811. +
  15812. + if (setup_flash_params())
  15813. + return -ENXIO;
  15814. +
  15815. + /*
  15816. + * Static partition definition selection
  15817. + */
  15818. + part_type = "static";
  15819. + parts = mirage_partitions;
  15820. + nb_parts = NB_OF(mirage_partitions);
  15821. + mirage_map.size = window_size;
  15822. +
  15823. + /*
  15824. + * Now let's probe for the actual flash. Do it here since
  15825. + * specific machine settings might have been set above.
  15826. + */
  15827. + printk(KERN_NOTICE "Mirage flash: probing %d-bit flash bus\n",
  15828. + mirage_map.buswidth*8);
  15829. + mirage_map.map_priv_1 =
  15830. + (unsigned long)ioremap(window_addr, window_size);
  15831. + mymtd = do_map_probe("cfi_probe", &mirage_map);
  15832. + if (!mymtd) return -ENXIO;
  15833. + mymtd->module = THIS_MODULE;
  15834. +
  15835. + add_mtd_partitions(mymtd, parts, nb_parts);
  15836. + return 0;
  15837. +}
  15838. +
  15839. +static void __exit mirage_mtd_cleanup(void)
  15840. +{
  15841. + if (mymtd) {
  15842. + del_mtd_partitions(mymtd);
  15843. + map_destroy(mymtd);
  15844. + if (parsed_parts)
  15845. + kfree(parsed_parts);
  15846. + }
  15847. +}
  15848. +
  15849. +module_init(mirage_mtd_init);
  15850. +module_exit(mirage_mtd_cleanup);
  15851. +
  15852. +MODULE_AUTHOR("Embedded Edge");
  15853. +MODULE_DESCRIPTION("Mirage mtd map driver");
  15854. +MODULE_LICENSE("GPL");
  15855. --- /dev/null
  15856. +++ b/drivers/mtd/maps/mtx-1.c
  15857. @@ -0,0 +1,181 @@
  15858. +/*
  15859. + * Flash memory access on 4G Systems MTX-1 board
  15860. + *
  15861. + * (C) 2003 Pete Popov <[email protected]>
  15862. + * Bruno Randolf <[email protected]>
  15863. + */
  15864. +
  15865. +#include <linux/config.h>
  15866. +#include <linux/module.h>
  15867. +#include <linux/types.h>
  15868. +#include <linux/kernel.h>
  15869. +
  15870. +#include <linux/mtd/mtd.h>
  15871. +#include <linux/mtd/map.h>
  15872. +#include <linux/mtd/partitions.h>
  15873. +
  15874. +#include <asm/io.h>
  15875. +#include <asm/au1000.h>
  15876. +
  15877. +#ifdef DEBUG_RW
  15878. +#define DBG(x...) printk(x)
  15879. +#else
  15880. +#define DBG(x...)
  15881. +#endif
  15882. +
  15883. +#ifdef CONFIG_MIPS_MTX1
  15884. +#define WINDOW_ADDR 0x1E000000
  15885. +#define WINDOW_SIZE 0x2000000
  15886. +#endif
  15887. +
  15888. +__u8 physmap_read8(struct map_info *map, unsigned long ofs)
  15889. +{
  15890. + __u8 ret;
  15891. + ret = __raw_readb(map->map_priv_1 + ofs);
  15892. + DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  15893. + return ret;
  15894. +}
  15895. +
  15896. +__u16 physmap_read16(struct map_info *map, unsigned long ofs)
  15897. +{
  15898. + __u16 ret;
  15899. + ret = __raw_readw(map->map_priv_1 + ofs);
  15900. + DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  15901. + return ret;
  15902. +}
  15903. +
  15904. +__u32 physmap_read32(struct map_info *map, unsigned long ofs)
  15905. +{
  15906. + __u32 ret;
  15907. + ret = __raw_readl(map->map_priv_1 + ofs);
  15908. + DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  15909. + return ret;
  15910. +}
  15911. +
  15912. +void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
  15913. +{
  15914. + DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
  15915. + memcpy_fromio(to, map->map_priv_1 + from, len);
  15916. +}
  15917. +
  15918. +void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
  15919. +{
  15920. + DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  15921. + __raw_writeb(d, map->map_priv_1 + adr);
  15922. + mb();
  15923. +}
  15924. +
  15925. +void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
  15926. +{
  15927. + DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  15928. + __raw_writew(d, map->map_priv_1 + adr);
  15929. + mb();
  15930. +}
  15931. +
  15932. +void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
  15933. +{
  15934. + DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  15935. + __raw_writel(d, map->map_priv_1 + adr);
  15936. + mb();
  15937. +}
  15938. +
  15939. +void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
  15940. +{
  15941. + DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
  15942. + memcpy_toio(map->map_priv_1 + to, from, len);
  15943. +}
  15944. +
  15945. +
  15946. +
  15947. +static struct map_info mtx1_map = {
  15948. + name: "MTX-1 flash",
  15949. + read8: physmap_read8,
  15950. + read16: physmap_read16,
  15951. + read32: physmap_read32,
  15952. + copy_from: physmap_copy_from,
  15953. + write8: physmap_write8,
  15954. + write16: physmap_write16,
  15955. + write32: physmap_write32,
  15956. + copy_to: physmap_copy_to,
  15957. +};
  15958. +
  15959. +
  15960. +static unsigned long flash_size = 0x01000000;
  15961. +static unsigned char flash_buswidth = 4;
  15962. +static struct mtd_partition mtx1_partitions[] = {
  15963. + {
  15964. + name: "user fs",
  15965. + size: 0x1c00000,
  15966. + offset: 0,
  15967. + },{
  15968. + name: "yamon",
  15969. + size: 0x0100000,
  15970. + offset: MTDPART_OFS_APPEND,
  15971. + mask_flags: MTD_WRITEABLE
  15972. + },{
  15973. + name: "raw kernel",
  15974. + size: 0x02c0000,
  15975. + offset: MTDPART_OFS_APPEND,
  15976. + },{
  15977. + name: "yamon env vars",
  15978. + size: 0x0040000,
  15979. + offset: MTDPART_OFS_APPEND,
  15980. + mask_flags: MTD_WRITEABLE
  15981. + }
  15982. +};
  15983. +
  15984. +
  15985. +#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
  15986. +
  15987. +static struct mtd_partition *parsed_parts;
  15988. +static struct mtd_info *mymtd;
  15989. +
  15990. +int __init mtx1_mtd_init(void)
  15991. +{
  15992. + struct mtd_partition *parts;
  15993. + int nb_parts = 0;
  15994. + char *part_type;
  15995. +
  15996. + /* Default flash buswidth */
  15997. + mtx1_map.buswidth = flash_buswidth;
  15998. +
  15999. + /*
  16000. + * Static partition definition selection
  16001. + */
  16002. + part_type = "static";
  16003. + parts = mtx1_partitions;
  16004. + nb_parts = NB_OF(mtx1_partitions);
  16005. + mtx1_map.size = flash_size;
  16006. +
  16007. + /*
  16008. + * Now let's probe for the actual flash. Do it here since
  16009. + * specific machine settings might have been set above.
  16010. + */
  16011. + printk(KERN_NOTICE "MTX-1 flash: probing %d-bit flash bus\n",
  16012. + mtx1_map.buswidth*8);
  16013. + mtx1_map.map_priv_1 =
  16014. + (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
  16015. + mymtd = do_map_probe("cfi_probe", &mtx1_map);
  16016. + if (!mymtd) return -ENXIO;
  16017. + mymtd->module = THIS_MODULE;
  16018. +
  16019. + add_mtd_partitions(mymtd, parts, nb_parts);
  16020. + return 0;
  16021. +}
  16022. +
  16023. +static void __exit mtx1_mtd_cleanup(void)
  16024. +{
  16025. + if (mymtd) {
  16026. + del_mtd_partitions(mymtd);
  16027. + map_destroy(mymtd);
  16028. + if (parsed_parts)
  16029. + kfree(parsed_parts);
  16030. + }
  16031. +}
  16032. +
  16033. +module_init(mtx1_mtd_init);
  16034. +module_exit(mtx1_mtd_cleanup);
  16035. +
  16036. +MODULE_AUTHOR("Pete Popov");
  16037. +MODULE_DESCRIPTION("MTX-1 CFI map driver");
  16038. +MODULE_LICENSE("GPL");
  16039. --- /dev/null
  16040. +++ b/drivers/mtd/maps/pb1550-flash.c
  16041. @@ -0,0 +1,270 @@
  16042. +/*
  16043. + * Flash memory access on Alchemy Pb1550 board
  16044. + *
  16045. + * (C) 2004 Embedded Edge, LLC, based on pb1550-flash.c:
  16046. + * (C) 2003 Pete Popov <[email protected]>
  16047. + *
  16048. + */
  16049. +
  16050. +#include <linux/config.h>
  16051. +#include <linux/module.h>
  16052. +#include <linux/types.h>
  16053. +#include <linux/kernel.h>
  16054. +
  16055. +#include <linux/mtd/mtd.h>
  16056. +#include <linux/mtd/map.h>
  16057. +#include <linux/mtd/partitions.h>
  16058. +
  16059. +#include <asm/io.h>
  16060. +#include <asm/au1000.h>
  16061. +#include <asm/pb1550.h>
  16062. +
  16063. +#ifdef DEBUG_RW
  16064. +#define DBG(x...) printk(x)
  16065. +#else
  16066. +#define DBG(x...)
  16067. +#endif
  16068. +
  16069. +static unsigned long window_addr;
  16070. +static unsigned long window_size;
  16071. +
  16072. +__u8 physmap_read8(struct map_info *map, unsigned long ofs)
  16073. +{
  16074. + __u8 ret;
  16075. + ret = __raw_readb(map->map_priv_1 + ofs);
  16076. + DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  16077. + return ret;
  16078. +}
  16079. +
  16080. +__u16 physmap_read16(struct map_info *map, unsigned long ofs)
  16081. +{
  16082. + __u16 ret;
  16083. + ret = __raw_readw(map->map_priv_1 + ofs);
  16084. + DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  16085. + return ret;
  16086. +}
  16087. +
  16088. +__u32 physmap_read32(struct map_info *map, unsigned long ofs)
  16089. +{
  16090. + __u32 ret;
  16091. + ret = __raw_readl(map->map_priv_1 + ofs);
  16092. + DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  16093. + return ret;
  16094. +}
  16095. +
  16096. +void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
  16097. +{
  16098. + DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
  16099. + memcpy_fromio(to, map->map_priv_1 + from, len);
  16100. +}
  16101. +
  16102. +void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
  16103. +{
  16104. + DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  16105. + __raw_writeb(d, map->map_priv_1 + adr);
  16106. + mb();
  16107. +}
  16108. +
  16109. +void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
  16110. +{
  16111. + DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  16112. + __raw_writew(d, map->map_priv_1 + adr);
  16113. + mb();
  16114. +}
  16115. +
  16116. +void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
  16117. +{
  16118. + DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  16119. + __raw_writel(d, map->map_priv_1 + adr);
  16120. + mb();
  16121. +}
  16122. +
  16123. +void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
  16124. +{
  16125. + DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
  16126. + memcpy_toio(map->map_priv_1 + to, from, len);
  16127. +}
  16128. +
  16129. +static struct map_info pb1550_map = {
  16130. + name: "Pb1550 flash",
  16131. + read8: physmap_read8,
  16132. + read16: physmap_read16,
  16133. + read32: physmap_read32,
  16134. + copy_from: physmap_copy_from,
  16135. + write8: physmap_write8,
  16136. + write16: physmap_write16,
  16137. + write32: physmap_write32,
  16138. + copy_to: physmap_copy_to,
  16139. +};
  16140. +
  16141. +static unsigned char flash_buswidth = 4;
  16142. +
  16143. +/*
  16144. + * Support only 64MB NOR Flash parts
  16145. + */
  16146. +
  16147. +#ifdef PB1550_BOTH_BANKS
  16148. +/* both banks will be used. Combine the first bank and the first
  16149. + * part of the second bank together into a single jffs/jffs2
  16150. + * partition.
  16151. + */
  16152. +static struct mtd_partition pb1550_partitions[] = {
  16153. + /* assume boot[2:0]:swap is '0000' or '1000', which translates to:
  16154. + * 1C00 0000 1FFF FFFF CE0 64MB Boot NOR Flash
  16155. + * 1800 0000 1BFF FFFF CE0 64MB Param NOR Flash
  16156. + */
  16157. + {
  16158. + name: "User FS",
  16159. + size: (0x1FC00000 - 0x18000000),
  16160. + offset: 0x0000000
  16161. + },{
  16162. + name: "yamon",
  16163. + size: 0x0100000,
  16164. + offset: MTDPART_OFS_APPEND,
  16165. + mask_flags: MTD_WRITEABLE
  16166. + },{
  16167. + name: "raw kernel",
  16168. + size: (0x300000 - 0x40000), /* last 256KB is yamon env */
  16169. + offset: MTDPART_OFS_APPEND,
  16170. + }
  16171. +};
  16172. +#elif defined(PB1550_BOOT_ONLY)
  16173. +static struct mtd_partition pb1550_partitions[] = {
  16174. + /* assume boot[2:0]:swap is '0000' or '1000', which translates to:
  16175. + * 1C00 0000 1FFF FFFF CE0 64MB Boot NOR Flash
  16176. + */
  16177. + {
  16178. + name: "User FS",
  16179. + size: 0x03c00000,
  16180. + offset: 0x0000000
  16181. + },{
  16182. + name: "yamon",
  16183. + size: 0x0100000,
  16184. + offset: MTDPART_OFS_APPEND,
  16185. + mask_flags: MTD_WRITEABLE
  16186. + },{
  16187. + name: "raw kernel",
  16188. + size: (0x300000-0x40000), /* last 256KB is yamon env */
  16189. + offset: MTDPART_OFS_APPEND,
  16190. + }
  16191. +};
  16192. +#elif defined(PB1550_USER_ONLY)
  16193. +static struct mtd_partition pb1550_partitions[] = {
  16194. + /* assume boot[2:0]:swap is '0000' or '1000', which translates to:
  16195. + * 1800 0000 1BFF FFFF CE0 64MB Param NOR Flash
  16196. + */
  16197. + {
  16198. + name: "User FS",
  16199. + size: (0x4000000 - 0x200000), /* reserve 2MB for raw kernel */
  16200. + offset: 0x0000000
  16201. + },{
  16202. + name: "raw kernel",
  16203. + size: MTDPART_SIZ_FULL,
  16204. + offset: MTDPART_OFS_APPEND,
  16205. + }
  16206. +};
  16207. +#else
  16208. +#error MTD_PB1550 define combo error /* should never happen */
  16209. +#endif
  16210. +
  16211. +#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
  16212. +
  16213. +static struct mtd_partition *parsed_parts;
  16214. +static struct mtd_info *mymtd;
  16215. +
  16216. +/*
  16217. + * Probe the flash density and setup window address and size
  16218. + * based on user CONFIG options. There are times when we don't
  16219. + * want the MTD driver to be probing the boot or user flash,
  16220. + * so having the option to enable only one bank is important.
  16221. + */
  16222. +int setup_flash_params()
  16223. +{
  16224. + u16 boot_swapboot;
  16225. + boot_swapboot = (au_readl(MEM_STSTAT) & (0x7<<1)) |
  16226. + ((bcsr->status >> 6) & 0x1);
  16227. + printk("Pb1550 MTD: boot:swap %d\n", boot_swapboot);
  16228. +
  16229. + switch (boot_swapboot) {
  16230. + case 0: /* 512Mbit devices, both enabled */
  16231. + case 1:
  16232. + case 8:
  16233. + case 9:
  16234. +#if defined(PB1550_BOTH_BANKS)
  16235. + window_addr = 0x18000000;
  16236. + window_size = 0x8000000;
  16237. +#elif defined(PB1550_BOOT_ONLY)
  16238. + window_addr = 0x1C000000;
  16239. + window_size = 0x4000000;
  16240. +#else /* USER ONLY */
  16241. + window_addr = 0x1E000000;
  16242. + window_size = 0x1000000;
  16243. +#endif
  16244. + break;
  16245. + case 0xC:
  16246. + case 0xD:
  16247. + case 0xE:
  16248. + case 0xF:
  16249. + /* 64 MB Boot NOR Flash is disabled */
  16250. + /* and the start address is moved to 0x0C00000 */
  16251. + window_addr = 0x0C000000;
  16252. + window_size = 0x4000000;
  16253. + default:
  16254. + printk("Pb1550 MTD: unsupported boot:swap setting\n");
  16255. + return 1;
  16256. + }
  16257. + return 0;
  16258. +}
  16259. +
  16260. +int __init pb1550_mtd_init(void)
  16261. +{
  16262. + struct mtd_partition *parts;
  16263. + int nb_parts = 0;
  16264. + char *part_type;
  16265. +
  16266. + /* Default flash buswidth */
  16267. + pb1550_map.buswidth = flash_buswidth;
  16268. +
  16269. + if (setup_flash_params())
  16270. + return -ENXIO;
  16271. +
  16272. + /*
  16273. + * Static partition definition selection
  16274. + */
  16275. + part_type = "static";
  16276. + parts = pb1550_partitions;
  16277. + nb_parts = NB_OF(pb1550_partitions);
  16278. + pb1550_map.size = window_size;
  16279. +
  16280. + /*
  16281. + * Now let's probe for the actual flash. Do it here since
  16282. + * specific machine settings might have been set above.
  16283. + */
  16284. + printk(KERN_NOTICE "Pb1550 flash: probing %d-bit flash bus\n",
  16285. + pb1550_map.buswidth*8);
  16286. + pb1550_map.map_priv_1 =
  16287. + (unsigned long)ioremap(window_addr, window_size);
  16288. + mymtd = do_map_probe("cfi_probe", &pb1550_map);
  16289. + if (!mymtd) return -ENXIO;
  16290. + mymtd->module = THIS_MODULE;
  16291. +
  16292. + add_mtd_partitions(mymtd, parts, nb_parts);
  16293. + return 0;
  16294. +}
  16295. +
  16296. +static void __exit pb1550_mtd_cleanup(void)
  16297. +{
  16298. + if (mymtd) {
  16299. + del_mtd_partitions(mymtd);
  16300. + map_destroy(mymtd);
  16301. + if (parsed_parts)
  16302. + kfree(parsed_parts);
  16303. + }
  16304. +}
  16305. +
  16306. +module_init(pb1550_mtd_init);
  16307. +module_exit(pb1550_mtd_cleanup);
  16308. +
  16309. +MODULE_AUTHOR("Embedded Edge, LLC");
  16310. +MODULE_DESCRIPTION("Pb1550 mtd map driver");
  16311. +MODULE_LICENSE("GPL");
  16312. --- a/drivers/mtd/maps/pb1xxx-flash.c
  16313. +++ b/drivers/mtd/maps/pb1xxx-flash.c
  16314. @@ -192,6 +192,34 @@ static struct mtd_partition pb1xxx_parti
  16315. #else
  16316. #error MTD_PB1500 define combo error /* should never happen */
  16317. #endif
  16318. +#elif defined(CONFIG_MTD_BOSPORUS)
  16319. +static unsigned char flash_buswidth = 2;
  16320. +static unsigned long flash_size = 0x02000000;
  16321. +#define WINDOW_ADDR 0x1F000000
  16322. +#define WINDOW_SIZE 0x2000000
  16323. +static struct mtd_partition pb1xxx_partitions[] = {
  16324. + {
  16325. + name: "User FS",
  16326. + size: 0x00400000,
  16327. + offset: 0x00000000,
  16328. + },{
  16329. + name: "Yamon-2",
  16330. + size: 0x00100000,
  16331. + offset: 0x00400000,
  16332. + },{
  16333. + name: "Root FS",
  16334. + size: 0x00700000,
  16335. + offset: 0x00500000,
  16336. + },{
  16337. + name: "Yamon-1",
  16338. + size: 0x00100000,
  16339. + offset: 0x00C00000,
  16340. + },{
  16341. + name: "Kernel",
  16342. + size: 0x00300000,
  16343. + offset: 0x00D00000,
  16344. + }
  16345. +};
  16346. #else
  16347. #error Unsupported board
  16348. #endif
  16349. --- /dev/null
  16350. +++ b/drivers/mtd/maps/xxs1500.c
  16351. @@ -0,0 +1,186 @@
  16352. +/*
  16353. + * Flash memory access on MyCable XXS1500 board
  16354. + *
  16355. + * (C) 2003 Pete Popov <[email protected]>
  16356. + *
  16357. + * $Id: xxs1500.c,v 1.1.2.1 2003/06/13 21:15:46 ppopov Exp $
  16358. + */
  16359. +
  16360. +#include <linux/config.h>
  16361. +#include <linux/module.h>
  16362. +#include <linux/types.h>
  16363. +#include <linux/kernel.h>
  16364. +
  16365. +#include <linux/mtd/mtd.h>
  16366. +#include <linux/mtd/map.h>
  16367. +#include <linux/mtd/partitions.h>
  16368. +
  16369. +#include <asm/io.h>
  16370. +#include <asm/au1000.h>
  16371. +
  16372. +#ifdef DEBUG_RW
  16373. +#define DBG(x...) printk(x)
  16374. +#else
  16375. +#define DBG(x...)
  16376. +#endif
  16377. +
  16378. +#ifdef CONFIG_MIPS_XXS1500
  16379. +#define WINDOW_ADDR 0x1F000000
  16380. +#define WINDOW_SIZE 0x1000000
  16381. +#endif
  16382. +
  16383. +__u8 physmap_read8(struct map_info *map, unsigned long ofs)
  16384. +{
  16385. + __u8 ret;
  16386. + ret = __raw_readb(map->map_priv_1 + ofs);
  16387. + DBG("read8 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  16388. + return ret;
  16389. +}
  16390. +
  16391. +__u16 physmap_read16(struct map_info *map, unsigned long ofs)
  16392. +{
  16393. + __u16 ret;
  16394. + ret = __raw_readw(map->map_priv_1 + ofs);
  16395. + DBG("read16 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  16396. + return ret;
  16397. +}
  16398. +
  16399. +__u32 physmap_read32(struct map_info *map, unsigned long ofs)
  16400. +{
  16401. + __u32 ret;
  16402. + ret = __raw_readl(map->map_priv_1 + ofs);
  16403. + DBG("read32 from %x, %x\n", (unsigned)(map->map_priv_1 + ofs), ret);
  16404. + return ret;
  16405. +}
  16406. +
  16407. +void physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
  16408. +{
  16409. + DBG("physmap_copy from %x to %x\n", (unsigned)from, (unsigned)to);
  16410. + memcpy_fromio(to, map->map_priv_1 + from, len);
  16411. +}
  16412. +
  16413. +void physmap_write8(struct map_info *map, __u8 d, unsigned long adr)
  16414. +{
  16415. + DBG("write8 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  16416. + __raw_writeb(d, map->map_priv_1 + adr);
  16417. + mb();
  16418. +}
  16419. +
  16420. +void physmap_write16(struct map_info *map, __u16 d, unsigned long adr)
  16421. +{
  16422. + DBG("write16 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  16423. + __raw_writew(d, map->map_priv_1 + adr);
  16424. + mb();
  16425. +}
  16426. +
  16427. +void physmap_write32(struct map_info *map, __u32 d, unsigned long adr)
  16428. +{
  16429. + DBG("write32 at %x, %x\n", (unsigned)(map->map_priv_1 + adr), d);
  16430. + __raw_writel(d, map->map_priv_1 + adr);
  16431. + mb();
  16432. +}
  16433. +
  16434. +void physmap_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
  16435. +{
  16436. + DBG("physmap_copy_to %x from %x\n", (unsigned)to, (unsigned)from);
  16437. + memcpy_toio(map->map_priv_1 + to, from, len);
  16438. +}
  16439. +
  16440. +
  16441. +
  16442. +static struct map_info xxs1500_map = {
  16443. + name: "XXS1500 flash",
  16444. + read8: physmap_read8,
  16445. + read16: physmap_read16,
  16446. + read32: physmap_read32,
  16447. + copy_from: physmap_copy_from,
  16448. + write8: physmap_write8,
  16449. + write16: physmap_write16,
  16450. + write32: physmap_write32,
  16451. + copy_to: physmap_copy_to,
  16452. +};
  16453. +
  16454. +
  16455. +static unsigned long flash_size = 0x00800000;
  16456. +static unsigned char flash_buswidth = 4;
  16457. +static struct mtd_partition xxs1500_partitions[] = {
  16458. + {
  16459. + name: "kernel image",
  16460. + size: 0x00200000,
  16461. + offset: 0,
  16462. + },{
  16463. + name: "user fs 0",
  16464. + size: (0x00C00000-0x200000),
  16465. + offset: MTDPART_OFS_APPEND,
  16466. + },{
  16467. + name: "yamon",
  16468. + size: 0x00100000,
  16469. + offset: MTDPART_OFS_APPEND,
  16470. + mask_flags: MTD_WRITEABLE
  16471. + },{
  16472. + name: "user fs 1",
  16473. + size: 0x2c0000,
  16474. + offset: MTDPART_OFS_APPEND,
  16475. + },{
  16476. + name: "yamon env vars",
  16477. + size: 0x040000,
  16478. + offset: MTDPART_OFS_APPEND,
  16479. + mask_flags: MTD_WRITEABLE
  16480. + }
  16481. +};
  16482. +
  16483. +
  16484. +#define NB_OF(x) (sizeof(x)/sizeof(x[0]))
  16485. +
  16486. +static struct mtd_partition *parsed_parts;
  16487. +static struct mtd_info *mymtd;
  16488. +
  16489. +int __init xxs1500_mtd_init(void)
  16490. +{
  16491. + struct mtd_partition *parts;
  16492. + int nb_parts = 0;
  16493. + char *part_type;
  16494. +
  16495. + /* Default flash buswidth */
  16496. + xxs1500_map.buswidth = flash_buswidth;
  16497. +
  16498. + /*
  16499. + * Static partition definition selection
  16500. + */
  16501. + part_type = "static";
  16502. + parts = xxs1500_partitions;
  16503. + nb_parts = NB_OF(xxs1500_partitions);
  16504. + xxs1500_map.size = flash_size;
  16505. +
  16506. + /*
  16507. + * Now let's probe for the actual flash. Do it here since
  16508. + * specific machine settings might have been set above.
  16509. + */
  16510. + printk(KERN_NOTICE "XXS1500 flash: probing %d-bit flash bus\n",
  16511. + xxs1500_map.buswidth*8);
  16512. + xxs1500_map.map_priv_1 =
  16513. + (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
  16514. + mymtd = do_map_probe("cfi_probe", &xxs1500_map);
  16515. + if (!mymtd) return -ENXIO;
  16516. + mymtd->module = THIS_MODULE;
  16517. +
  16518. + add_mtd_partitions(mymtd, parts, nb_parts);
  16519. + return 0;
  16520. +}
  16521. +
  16522. +static void __exit xxs1500_mtd_cleanup(void)
  16523. +{
  16524. + if (mymtd) {
  16525. + del_mtd_partitions(mymtd);
  16526. + map_destroy(mymtd);
  16527. + if (parsed_parts)
  16528. + kfree(parsed_parts);
  16529. + }
  16530. +}
  16531. +
  16532. +module_init(xxs1500_mtd_init);
  16533. +module_exit(xxs1500_mtd_cleanup);
  16534. +
  16535. +MODULE_AUTHOR("Pete Popov");
  16536. +MODULE_DESCRIPTION("XXS1500 CFI map driver");
  16537. +MODULE_LICENSE("GPL");
  16538. --- a/drivers/net/defxx.c
  16539. +++ b/drivers/net/defxx.c
  16540. @@ -10,24 +10,18 @@
  16541. *
  16542. * Abstract:
  16543. * A Linux device driver supporting the Digital Equipment Corporation
  16544. - * FDDI EISA and PCI controller families. Supported adapters include:
  16545. + * FDDI TURBOchannel, EISA and PCI controller families. Supported
  16546. + * adapters include:
  16547. *
  16548. - * DEC FDDIcontroller/EISA (DEFEA)
  16549. - * DEC FDDIcontroller/PCI (DEFPA)
  16550. + * DEC FDDIcontroller/TURBOchannel (DEFTA)
  16551. + * DEC FDDIcontroller/EISA (DEFEA)
  16552. + * DEC FDDIcontroller/PCI (DEFPA)
  16553. *
  16554. - * Maintainers:
  16555. - * LVS Lawrence V. Stefani
  16556. - *
  16557. - * Contact:
  16558. - * The author may be reached at:
  16559. + * The original author:
  16560. + * LVS Lawrence V. Stefani <[email protected]>
  16561. *
  16562. - * Inet: [email protected]
  16563. - * (NOTE! this address no longer works -jgarzik)
  16564. - *
  16565. - * Mail: Digital Equipment Corporation
  16566. - * 550 King Street
  16567. - * M/S: LKG1-3/M07
  16568. - * Littleton, MA 01460
  16569. + * Maintainers:
  16570. + * macro Maciej W. Rozycki <[email protected]>
  16571. *
  16572. * Credits:
  16573. * I'd like to thank Patricia Cross for helping me get started with
  16574. @@ -197,16 +191,16 @@
  16575. * Sep 2000 tjeerd Fix leak on unload, cosmetic code cleanup
  16576. * Feb 2001 Skb allocation fixes
  16577. * Feb 2001 davej PCI enable cleanups.
  16578. + * 04 Aug 2003 macro Converted to the DMA API.
  16579. + * 14 Aug 2004 macro Fix device names reported.
  16580. + * 26 Sep 2004 macro TURBOchannel support.
  16581. */
  16582. /* Include files */
  16583. #include <linux/module.h>
  16584. -
  16585. #include <linux/kernel.h>
  16586. -#include <linux/sched.h>
  16587. #include <linux/string.h>
  16588. -#include <linux/ptrace.h>
  16589. #include <linux/errno.h>
  16590. #include <linux/ioport.h>
  16591. #include <linux/slab.h>
  16592. @@ -215,19 +209,33 @@
  16593. #include <linux/delay.h>
  16594. #include <linux/init.h>
  16595. #include <linux/netdevice.h>
  16596. +#include <linux/fddidevice.h>
  16597. +#include <linux/skbuff.h>
  16598. +
  16599. #include <asm/byteorder.h>
  16600. #include <asm/bitops.h>
  16601. #include <asm/io.h>
  16602. -#include <linux/fddidevice.h>
  16603. -#include <linux/skbuff.h>
  16604. +#ifdef CONFIG_TC
  16605. +#include <asm/dec/tc.h>
  16606. +#else
  16607. +static int search_tc_card(const char *name) { return -ENODEV; }
  16608. +static void claim_tc_card(int slot) { }
  16609. +static void release_tc_card(int slot) { }
  16610. +static unsigned long get_tc_base_addr(int slot) { return 0; }
  16611. +static unsigned long get_tc_irq_nr(int slot) { return -1; }
  16612. +#endif
  16613. #include "defxx.h"
  16614. -/* Version information string - should be updated prior to each new release!!! */
  16615. +/* Version information string should be updated prior to each new release! */
  16616. +#define DRV_NAME "defxx"
  16617. +#define DRV_VERSION "v1.07T"
  16618. +#define DRV_RELDATE "2004/09/26"
  16619. static char version[] __devinitdata =
  16620. - "defxx.c:v1.05e 2001/02/03 Lawrence V. Stefani and others\n";
  16621. + DRV_NAME ": " DRV_VERSION " " DRV_RELDATE
  16622. + " Lawrence V. Stefani and others\n";
  16623. #define DYNAMIC_BUFFERS 1
  16624. @@ -243,7 +251,7 @@ static char version[] __devinitdata =
  16625. static void dfx_bus_init(struct net_device *dev);
  16626. static void dfx_bus_config_check(DFX_board_t *bp);
  16627. -static int dfx_driver_init(struct net_device *dev);
  16628. +static int dfx_driver_init(struct net_device *dev, const char *print_name);
  16629. static int dfx_adap_init(DFX_board_t *bp, int get_buffers);
  16630. static int dfx_open(struct net_device *dev);
  16631. @@ -337,48 +345,84 @@ static inline void dfx_port_write_byte(
  16632. int offset,
  16633. u8 data
  16634. )
  16635. +{
  16636. + if (bp->bus_type == DFX_BUS_TYPE_TC)
  16637. + {
  16638. + volatile u8 *addr = (void *)(bp->base_addr + offset);
  16639. + *addr = data;
  16640. + mb();
  16641. + }
  16642. + else
  16643. {
  16644. u16 port = bp->base_addr + offset;
  16645. outb(data, port);
  16646. }
  16647. +}
  16648. static inline void dfx_port_read_byte(
  16649. DFX_board_t *bp,
  16650. int offset,
  16651. u8 *data
  16652. )
  16653. +{
  16654. + if (bp->bus_type == DFX_BUS_TYPE_TC)
  16655. + {
  16656. + volatile u8 *addr = (void *)(bp->base_addr + offset);
  16657. + mb();
  16658. + *data = *addr;
  16659. + }
  16660. + else
  16661. {
  16662. u16 port = bp->base_addr + offset;
  16663. *data = inb(port);
  16664. }
  16665. +}
  16666. static inline void dfx_port_write_long(
  16667. DFX_board_t *bp,
  16668. int offset,
  16669. u32 data
  16670. )
  16671. +{
  16672. + if (bp->bus_type == DFX_BUS_TYPE_TC)
  16673. + {
  16674. + volatile u32 *addr = (void *)(bp->base_addr + offset);
  16675. + *addr = data;
  16676. + mb();
  16677. + }
  16678. + else
  16679. {
  16680. u16 port = bp->base_addr + offset;
  16681. outl(data, port);
  16682. }
  16683. +}
  16684. static inline void dfx_port_read_long(
  16685. DFX_board_t *bp,
  16686. int offset,
  16687. u32 *data
  16688. )
  16689. +{
  16690. + if (bp->bus_type == DFX_BUS_TYPE_TC)
  16691. + {
  16692. + volatile u32 *addr = (void *)(bp->base_addr + offset);
  16693. + mb();
  16694. + *data = *addr;
  16695. + }
  16696. + else
  16697. {
  16698. u16 port = bp->base_addr + offset;
  16699. *data = inl(port);
  16700. }
  16701. +}
  16702. /*
  16703. @@ -393,8 +437,9 @@ static inline void dfx_port_read_long(
  16704. * Condition code
  16705. *
  16706. * Arguments:
  16707. - * pdev - pointer to pci device information (NULL for EISA)
  16708. - * ioaddr - pointer to port (NULL for PCI)
  16709. + * pdev - pointer to pci device information (NULL for EISA or TURBOchannel)
  16710. + * bus_type - bus type (one of DFX_BUS_TYPE_*)
  16711. + * handle - bus-specific data: slot (TC), pointer to port (EISA), NULL (PCI)
  16712. *
  16713. * Functional Description:
  16714. *
  16715. @@ -410,54 +455,68 @@ static inline void dfx_port_read_long(
  16716. * initialized and the board resources are read and stored in
  16717. * the device structure.
  16718. */
  16719. -static int __devinit dfx_init_one_pci_or_eisa(struct pci_dev *pdev, long ioaddr)
  16720. +static int __devinit dfx_init_one_pci_or_eisa(struct pci_dev *pdev, u32 bus_type, long handle)
  16721. {
  16722. + static int version_disp;
  16723. + char *print_name = DRV_NAME;
  16724. struct net_device *dev;
  16725. DFX_board_t *bp; /* board pointer */
  16726. + long ioaddr; /* pointer to port */
  16727. + unsigned long len; /* resource length */
  16728. + int alloc_size; /* total buffer size used */
  16729. int err;
  16730. -#ifndef MODULE
  16731. - static int version_disp;
  16732. -
  16733. - if (!version_disp) /* display version info if adapter is found */
  16734. - {
  16735. + if (!version_disp) { /* display version info if adapter is found */
  16736. version_disp = 1; /* set display flag to TRUE so that */
  16737. printk(version); /* we only display this string ONCE */
  16738. }
  16739. -#endif
  16740. - /*
  16741. - * init_fddidev() allocates a device structure with private data, clears the device structure and private data,
  16742. - * and calls fddi_setup() and register_netdev(). Not much left to do for us here.
  16743. - */
  16744. - dev = init_fddidev(NULL, sizeof(*bp));
  16745. + if (pdev != NULL)
  16746. + print_name = pdev->slot_name;
  16747. +
  16748. + dev = alloc_fddidev(sizeof(*bp));
  16749. if (!dev) {
  16750. - printk (KERN_ERR "defxx: unable to allocate fddidev, aborting\n");
  16751. + printk(KERN_ERR "%s: unable to allocate fddidev, aborting\n",
  16752. + print_name);
  16753. return -ENOMEM;
  16754. }
  16755. /* Enable PCI device. */
  16756. - if (pdev != NULL) {
  16757. + if (bus_type == DFX_BUS_TYPE_PCI) {
  16758. err = pci_enable_device (pdev);
  16759. if (err) goto err_out;
  16760. ioaddr = pci_resource_start (pdev, 1);
  16761. }
  16762. SET_MODULE_OWNER(dev);
  16763. + SET_NETDEV_DEV(dev, &pdev->dev);
  16764. bp = dev->priv;
  16765. - if (!request_region (ioaddr, pdev ? PFI_K_CSR_IO_LEN : PI_ESIC_K_CSR_IO_LEN, dev->name)) {
  16766. - printk (KERN_ERR "%s: Cannot reserve I/O resource 0x%x @ 0x%lx, aborting\n",
  16767. - dev->name, PFI_K_CSR_IO_LEN, ioaddr);
  16768. + if (bus_type == DFX_BUS_TYPE_TC) {
  16769. + /* TURBOchannel board */
  16770. + bp->slot = handle;
  16771. + claim_tc_card(bp->slot);
  16772. + ioaddr = get_tc_base_addr(handle) + PI_TC_K_CSR_OFFSET;
  16773. + len = PI_TC_K_CSR_LEN;
  16774. + } else if (bus_type == DFX_BUS_TYPE_EISA) {
  16775. + /* EISA board */
  16776. + ioaddr = handle;
  16777. + len = PI_ESIC_K_CSR_IO_LEN;
  16778. + } else
  16779. + /* PCI board */
  16780. + len = PFI_K_CSR_IO_LEN;
  16781. + dev->base_addr = ioaddr; /* save port (I/O) base address */
  16782. +
  16783. + if (!request_region(ioaddr, len, print_name)) {
  16784. + printk(KERN_ERR "%s: Cannot reserve I/O resource "
  16785. + "0x%lx @ 0x%lx, aborting\n", print_name, len, ioaddr);
  16786. err = -EBUSY;
  16787. goto err_out;
  16788. }
  16789. /* Initialize new device structure */
  16790. - dev->base_addr = ioaddr; /* save port (I/O) base address */
  16791. -
  16792. dev->get_stats = dfx_ctl_get_stats;
  16793. dev->open = dfx_open;
  16794. dev->stop = dfx_close;
  16795. @@ -465,37 +524,54 @@ static int __devinit dfx_init_one_pci_or
  16796. dev->set_multicast_list = dfx_ctl_set_multicast_list;
  16797. dev->set_mac_address = dfx_ctl_set_mac_address;
  16798. - if (pdev == NULL) {
  16799. - /* EISA board */
  16800. - bp->bus_type = DFX_BUS_TYPE_EISA;
  16801. + bp->bus_type = bus_type;
  16802. + if (bus_type == DFX_BUS_TYPE_TC || bus_type == DFX_BUS_TYPE_EISA) {
  16803. + /* TURBOchannel or EISA board */
  16804. bp->next = root_dfx_eisa_dev;
  16805. root_dfx_eisa_dev = dev;
  16806. } else {
  16807. /* PCI board */
  16808. - bp->bus_type = DFX_BUS_TYPE_PCI;
  16809. bp->pci_dev = pdev;
  16810. pci_set_drvdata (pdev, dev);
  16811. pci_set_master (pdev);
  16812. }
  16813. - if (dfx_driver_init(dev) != DFX_K_SUCCESS) {
  16814. +
  16815. + if (dfx_driver_init(dev, print_name) != DFX_K_SUCCESS) {
  16816. err = -ENODEV;
  16817. goto err_out_region;
  16818. }
  16819. + err = register_netdev(dev);
  16820. + if (err)
  16821. + goto err_out_kfree;
  16822. +
  16823. + printk("%s: registered as %s\n", print_name, dev->name);
  16824. return 0;
  16825. +err_out_kfree:
  16826. + alloc_size = sizeof(PI_DESCR_BLOCK) +
  16827. + PI_CMD_REQ_K_SIZE_MAX + PI_CMD_RSP_K_SIZE_MAX +
  16828. +#ifndef DYNAMIC_BUFFERS
  16829. + (bp->rcv_bufs_to_post * PI_RCV_DATA_K_SIZE_MAX) +
  16830. +#endif
  16831. + sizeof(PI_CONSUMER_BLOCK) +
  16832. + (PI_ALIGN_K_DESC_BLK - 1);
  16833. + if (bp->kmalloced)
  16834. + pci_free_consistent(pdev, alloc_size,
  16835. + bp->kmalloced, bp->kmalloced_dma);
  16836. err_out_region:
  16837. - release_region(ioaddr, pdev ? PFI_K_CSR_IO_LEN : PI_ESIC_K_CSR_IO_LEN);
  16838. + release_region(ioaddr, len);
  16839. err_out:
  16840. - unregister_netdev(dev);
  16841. - kfree(dev);
  16842. + if (bp->bus_type == DFX_BUS_TYPE_TC)
  16843. + release_tc_card(bp->slot);
  16844. + free_netdev(dev);
  16845. return err;
  16846. }
  16847. static int __devinit dfx_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
  16848. {
  16849. - return dfx_init_one_pci_or_eisa(pdev, 0);
  16850. + return dfx_init_one_pci_or_eisa(pdev, DFX_BUS_TYPE_PCI, 0);
  16851. }
  16852. static int __init dfx_eisa_init(void)
  16853. @@ -507,6 +583,7 @@ static int __init dfx_eisa_init(void)
  16854. DBG_printk("In dfx_eisa_init...\n");
  16855. +#ifdef CONFIG_EISA
  16856. /* Scan for FDDI EISA controllers */
  16857. for (i=0; i < DFX_MAX_EISA_SLOTS; i++) /* only scan for up to 16 EISA slots */
  16858. @@ -517,9 +594,27 @@ static int __init dfx_eisa_init(void)
  16859. {
  16860. port = (i << 12); /* recalc base addr */
  16861. - if (dfx_init_one_pci_or_eisa(NULL, port) == 0) rc = 0;
  16862. + if (dfx_init_one_pci_or_eisa(NULL, DFX_BUS_TYPE_EISA, port) == 0) rc = 0;
  16863. }
  16864. }
  16865. +#endif
  16866. + return rc;
  16867. +}
  16868. +
  16869. +static int __init dfx_tc_init(void)
  16870. +{
  16871. + int rc = -ENODEV;
  16872. + int slot; /* TC slot number */
  16873. +
  16874. + DBG_printk("In dfx_tc_init...\n");
  16875. +
  16876. + /* Scan for FDDI TC controllers */
  16877. + while ((slot = search_tc_card("PMAF-F")) >= 0) {
  16878. + if (dfx_init_one_pci_or_eisa(NULL, DFX_BUS_TYPE_TC, slot) == 0)
  16879. + rc = 0;
  16880. + else
  16881. + break;
  16882. + }
  16883. return rc;
  16884. }
  16885. @@ -583,8 +678,9 @@ static void __devinit dfx_bus_init(struc
  16886. /* Initialize adapter based on bus type */
  16887. - if (bp->bus_type == DFX_BUS_TYPE_EISA)
  16888. - {
  16889. + if (bp->bus_type == DFX_BUS_TYPE_TC) {
  16890. + dev->irq = get_tc_irq_nr(bp->slot);
  16891. + } else if (bp->bus_type == DFX_BUS_TYPE_EISA) {
  16892. /* Get the interrupt level from the ESIC chip */
  16893. dfx_port_read_byte(bp, PI_ESIC_K_IO_CONFIG_STAT_0, &val);
  16894. @@ -766,6 +862,7 @@ static void __devinit dfx_bus_config_che
  16895. *
  16896. * Arguments:
  16897. * dev - pointer to device information
  16898. + * print_name - printable device name
  16899. *
  16900. * Functional Description:
  16901. * This function allocates additional resources such as the host memory
  16902. @@ -780,20 +877,21 @@ static void __devinit dfx_bus_config_che
  16903. * or read adapter MAC address
  16904. *
  16905. * Assumptions:
  16906. - * Memory allocated from kmalloc() call is physically contiguous, locked
  16907. - * memory whose physical address equals its virtual address.
  16908. + * Memory allocated from pci_alloc_consistent() call is physically
  16909. + * contiguous, locked memory.
  16910. *
  16911. * Side Effects:
  16912. * Adapter is reset and should be in DMA_UNAVAILABLE state before
  16913. * returning from this routine.
  16914. */
  16915. -static int __devinit dfx_driver_init(struct net_device *dev)
  16916. +static int __devinit dfx_driver_init(struct net_device *dev,
  16917. + const char *print_name)
  16918. {
  16919. DFX_board_t *bp = dev->priv;
  16920. int alloc_size; /* total buffer size needed */
  16921. char *top_v, *curr_v; /* virtual addrs into memory block */
  16922. - u32 top_p, curr_p; /* physical addrs into memory block */
  16923. + dma_addr_t top_p, curr_p; /* physical addrs into memory block */
  16924. u32 data; /* host data register value */
  16925. DBG_printk("In dfx_driver_init...\n");
  16926. @@ -837,26 +935,20 @@ static int __devinit dfx_driver_init(str
  16927. /* Read the factory MAC address from the adapter then save it */
  16928. - if (dfx_hw_port_ctrl_req(bp,
  16929. - PI_PCTRL_M_MLA,
  16930. - PI_PDATA_A_MLA_K_LO,
  16931. - 0,
  16932. - &data) != DFX_K_SUCCESS)
  16933. - {
  16934. - printk("%s: Could not read adapter factory MAC address!\n", dev->name);
  16935. + if (dfx_hw_port_ctrl_req(bp, PI_PCTRL_M_MLA, PI_PDATA_A_MLA_K_LO, 0,
  16936. + &data) != DFX_K_SUCCESS) {
  16937. + printk("%s: Could not read adapter factory MAC address!\n",
  16938. + print_name);
  16939. return(DFX_K_FAILURE);
  16940. - }
  16941. + }
  16942. memcpy(&bp->factory_mac_addr[0], &data, sizeof(u32));
  16943. - if (dfx_hw_port_ctrl_req(bp,
  16944. - PI_PCTRL_M_MLA,
  16945. - PI_PDATA_A_MLA_K_HI,
  16946. - 0,
  16947. - &data) != DFX_K_SUCCESS)
  16948. - {
  16949. - printk("%s: Could not read adapter factory MAC address!\n", dev->name);
  16950. + if (dfx_hw_port_ctrl_req(bp, PI_PCTRL_M_MLA, PI_PDATA_A_MLA_K_HI, 0,
  16951. + &data) != DFX_K_SUCCESS) {
  16952. + printk("%s: Could not read adapter factory MAC address!\n",
  16953. + print_name);
  16954. return(DFX_K_FAILURE);
  16955. - }
  16956. + }
  16957. memcpy(&bp->factory_mac_addr[4], &data, sizeof(u16));
  16958. /*
  16959. @@ -867,28 +959,27 @@ static int __devinit dfx_driver_init(str
  16960. */
  16961. memcpy(dev->dev_addr, bp->factory_mac_addr, FDDI_K_ALEN);
  16962. - if (bp->bus_type == DFX_BUS_TYPE_EISA)
  16963. - printk("%s: DEFEA at I/O addr = 0x%lX, IRQ = %d, Hardware addr = %02X-%02X-%02X-%02X-%02X-%02X\n",
  16964. - dev->name,
  16965. - dev->base_addr,
  16966. - dev->irq,
  16967. - dev->dev_addr[0],
  16968. - dev->dev_addr[1],
  16969. - dev->dev_addr[2],
  16970. - dev->dev_addr[3],
  16971. - dev->dev_addr[4],
  16972. - dev->dev_addr[5]);
  16973. + if (bp->bus_type == DFX_BUS_TYPE_TC)
  16974. + printk("%s: DEFTA at addr = 0x%lX, IRQ = %d, "
  16975. + "Hardware addr = %02X-%02X-%02X-%02X-%02X-%02X\n",
  16976. + print_name, dev->base_addr, dev->irq,
  16977. + dev->dev_addr[0], dev->dev_addr[1],
  16978. + dev->dev_addr[2], dev->dev_addr[3],
  16979. + dev->dev_addr[4], dev->dev_addr[5]);
  16980. + else if (bp->bus_type == DFX_BUS_TYPE_EISA)
  16981. + printk("%s: DEFEA at I/O addr = 0x%lX, IRQ = %d, "
  16982. + "Hardware addr = %02X-%02X-%02X-%02X-%02X-%02X\n",
  16983. + print_name, dev->base_addr, dev->irq,
  16984. + dev->dev_addr[0], dev->dev_addr[1],
  16985. + dev->dev_addr[2], dev->dev_addr[3],
  16986. + dev->dev_addr[4], dev->dev_addr[5]);
  16987. else
  16988. - printk("%s: DEFPA at I/O addr = 0x%lX, IRQ = %d, Hardware addr = %02X-%02X-%02X-%02X-%02X-%02X\n",
  16989. - dev->name,
  16990. - dev->base_addr,
  16991. - dev->irq,
  16992. - dev->dev_addr[0],
  16993. - dev->dev_addr[1],
  16994. - dev->dev_addr[2],
  16995. - dev->dev_addr[3],
  16996. - dev->dev_addr[4],
  16997. - dev->dev_addr[5]);
  16998. + printk("%s: DEFPA at I/O addr = 0x%lX, IRQ = %d, "
  16999. + "Hardware addr = %02X-%02X-%02X-%02X-%02X-%02X\n",
  17000. + print_name, dev->base_addr, dev->irq,
  17001. + dev->dev_addr[0], dev->dev_addr[1],
  17002. + dev->dev_addr[2], dev->dev_addr[3],
  17003. + dev->dev_addr[4], dev->dev_addr[5]);
  17004. /*
  17005. * Get memory for descriptor block, consumer block, and other buffers
  17006. @@ -903,14 +994,15 @@ static int __devinit dfx_driver_init(str
  17007. #endif
  17008. sizeof(PI_CONSUMER_BLOCK) +
  17009. (PI_ALIGN_K_DESC_BLK - 1);
  17010. - bp->kmalloced = top_v = (char *) kmalloc(alloc_size, GFP_KERNEL);
  17011. - if (top_v == NULL)
  17012. - {
  17013. - printk("%s: Could not allocate memory for host buffers and structures!\n", dev->name);
  17014. + bp->kmalloced = top_v = pci_alloc_consistent(bp->pci_dev, alloc_size,
  17015. + &bp->kmalloced_dma);
  17016. + if (top_v == NULL) {
  17017. + printk("%s: Could not allocate memory for host buffers "
  17018. + "and structures!\n", print_name);
  17019. return(DFX_K_FAILURE);
  17020. - }
  17021. + }
  17022. memset(top_v, 0, alloc_size); /* zero out memory before continuing */
  17023. - top_p = virt_to_bus(top_v); /* get physical address of buffer */
  17024. + top_p = bp->kmalloced_dma; /* get physical address of buffer */
  17025. /*
  17026. * To guarantee the 8K alignment required for the descriptor block, 8K - 1
  17027. @@ -924,7 +1016,7 @@ static int __devinit dfx_driver_init(str
  17028. * for allocating the needed memory.
  17029. */
  17030. - curr_p = (u32) (ALIGN(top_p, PI_ALIGN_K_DESC_BLK));
  17031. + curr_p = ALIGN(top_p, PI_ALIGN_K_DESC_BLK);
  17032. curr_v = top_v + (curr_p - top_p);
  17033. /* Reserve space for descriptor block */
  17034. @@ -965,14 +1057,20 @@ static int __devinit dfx_driver_init(str
  17035. /* Display virtual and physical addresses if debug driver */
  17036. - DBG_printk("%s: Descriptor block virt = %0lX, phys = %0X\n", dev->name, (long)bp->descr_block_virt, bp->descr_block_phys);
  17037. - DBG_printk("%s: Command Request buffer virt = %0lX, phys = %0X\n", dev->name, (long)bp->cmd_req_virt, bp->cmd_req_phys);
  17038. - DBG_printk("%s: Command Response buffer virt = %0lX, phys = %0X\n", dev->name, (long)bp->cmd_rsp_virt, bp->cmd_rsp_phys);
  17039. - DBG_printk("%s: Receive buffer block virt = %0lX, phys = %0X\n", dev->name, (long)bp->rcv_block_virt, bp->rcv_block_phys);
  17040. - DBG_printk("%s: Consumer block virt = %0lX, phys = %0X\n", dev->name, (long)bp->cons_block_virt, bp->cons_block_phys);
  17041. + DBG_printk("%s: Descriptor block virt = %0lX, phys = %0X\n",
  17042. + print_name,
  17043. + (long)bp->descr_block_virt, bp->descr_block_phys);
  17044. + DBG_printk("%s: Command Request buffer virt = %0lX, phys = %0X\n",
  17045. + print_name, (long)bp->cmd_req_virt, bp->cmd_req_phys);
  17046. + DBG_printk("%s: Command Response buffer virt = %0lX, phys = %0X\n",
  17047. + print_name, (long)bp->cmd_rsp_virt, bp->cmd_rsp_phys);
  17048. + DBG_printk("%s: Receive buffer block virt = %0lX, phys = %0X\n",
  17049. + print_name, (long)bp->rcv_block_virt, bp->rcv_block_phys);
  17050. + DBG_printk("%s: Consumer block virt = %0lX, phys = %0X\n",
  17051. + print_name, (long)bp->cons_block_virt, bp->cons_block_phys);
  17052. return(DFX_K_SUCCESS);
  17053. - }
  17054. +}
  17055. /*
  17056. @@ -1218,7 +1316,9 @@ static int dfx_open(struct net_device *d
  17057. /* Register IRQ - support shared interrupts by passing device ptr */
  17058. - ret = request_irq(dev->irq, (void *)dfx_interrupt, SA_SHIRQ, dev->name, dev);
  17059. + ret = request_irq(dev->irq, (void *)dfx_interrupt,
  17060. + (bp->bus_type == DFX_BUS_TYPE_TC) ? 0 : SA_SHIRQ,
  17061. + dev->name, dev);
  17062. if (ret) {
  17063. printk(KERN_ERR "%s: Requested IRQ %d is busy\n", dev->name, dev->irq);
  17064. return ret;
  17065. @@ -1737,7 +1837,7 @@ static void dfx_interrupt(int irq, void
  17066. dfx_port_write_long(bp, PFI_K_REG_MODE_CTRL,
  17067. (PFI_MODE_M_PDQ_INT_ENB + PFI_MODE_M_DMA_ENB));
  17068. }
  17069. - else
  17070. + else if (bp->bus_type == DFX_BUS_TYPE_EISA)
  17071. {
  17072. /* Disable interrupts at the ESIC */
  17073. @@ -1755,6 +1855,13 @@ static void dfx_interrupt(int irq, void
  17074. tmp |= PI_CONFIG_STAT_0_M_INT_ENB;
  17075. dfx_port_write_byte(bp, PI_ESIC_K_IO_CONFIG_STAT_0, tmp);
  17076. }
  17077. + else {
  17078. + /* TC doesn't share interrupts so no need to disable them */
  17079. +
  17080. + /* Call interrupt service routine for this adapter */
  17081. +
  17082. + dfx_int_common(dev);
  17083. + }
  17084. spin_unlock(&bp->lock);
  17085. }
  17086. @@ -2663,12 +2770,12 @@ static int dfx_hw_dma_uninit(DFX_board_t
  17087. static void my_skb_align(struct sk_buff *skb, int n)
  17088. {
  17089. - u32 x=(u32)skb->data; /* We only want the low bits .. */
  17090. - u32 v;
  17091. + unsigned long x = (unsigned long)skb->data;
  17092. + unsigned long v;
  17093. - v=(x+n-1)&~(n-1); /* Where we want to be */
  17094. + v = ALIGN(x, n); /* Where we want to be */
  17095. - skb_reserve(skb, v-x);
  17096. + skb_reserve(skb, v - x);
  17097. }
  17098. @@ -2745,7 +2852,10 @@ static int dfx_rcv_init(DFX_board_t *bp,
  17099. */
  17100. my_skb_align(newskb, 128);
  17101. - bp->descr_block_virt->rcv_data[i+j].long_1 = virt_to_bus(newskb->data);
  17102. + bp->descr_block_virt->rcv_data[i + j].long_1 =
  17103. + (u32)pci_map_single(bp->pci_dev, newskb->data,
  17104. + NEW_SKB_SIZE,
  17105. + PCI_DMA_FROMDEVICE);
  17106. /*
  17107. * p_rcv_buff_va is only used inside the
  17108. * kernel so we put the skb pointer here.
  17109. @@ -2859,9 +2969,17 @@ static void dfx_rcv_queue_process(
  17110. my_skb_align(newskb, 128);
  17111. skb = (struct sk_buff *)bp->p_rcv_buff_va[entry];
  17112. + pci_unmap_single(bp->pci_dev,
  17113. + bp->descr_block_virt->rcv_data[entry].long_1,
  17114. + NEW_SKB_SIZE,
  17115. + PCI_DMA_FROMDEVICE);
  17116. skb_reserve(skb, RCV_BUFF_K_PADDING);
  17117. bp->p_rcv_buff_va[entry] = (char *)newskb;
  17118. - bp->descr_block_virt->rcv_data[entry].long_1 = virt_to_bus(newskb->data);
  17119. + bp->descr_block_virt->rcv_data[entry].long_1 =
  17120. + (u32)pci_map_single(bp->pci_dev,
  17121. + newskb->data,
  17122. + NEW_SKB_SIZE,
  17123. + PCI_DMA_FROMDEVICE);
  17124. } else
  17125. skb = NULL;
  17126. } else
  17127. @@ -2934,7 +3052,7 @@ static void dfx_rcv_queue_process(
  17128. * is contained in a single physically contiguous buffer
  17129. * in which the virtual address of the start of packet
  17130. * (skb->data) can be converted to a physical address
  17131. - * by using virt_to_bus().
  17132. + * by using pci_map_single().
  17133. *
  17134. * Since the adapter architecture requires a three byte
  17135. * packet request header to prepend the start of packet,
  17136. @@ -3082,12 +3200,13 @@ static int dfx_xmt_queue_pkt(
  17137. * skb->data.
  17138. * 6. The physical address of the start of packet
  17139. * can be determined from the virtual address
  17140. - * by using virt_to_bus() and is only 32-bits
  17141. + * by using pci_map_single() and is only 32-bits
  17142. * wide.
  17143. */
  17144. p_xmt_descr->long_0 = (u32) (PI_XMT_DESCR_M_SOP | PI_XMT_DESCR_M_EOP | ((skb->len) << PI_XMT_DESCR_V_SEG_LEN));
  17145. - p_xmt_descr->long_1 = (u32) virt_to_bus(skb->data);
  17146. + p_xmt_descr->long_1 = (u32)pci_map_single(bp->pci_dev, skb->data,
  17147. + skb->len, PCI_DMA_TODEVICE);
  17148. /*
  17149. * Verify that descriptor is actually available
  17150. @@ -3171,6 +3290,7 @@ static int dfx_xmt_done(DFX_board_t *bp)
  17151. {
  17152. XMT_DRIVER_DESCR *p_xmt_drv_descr; /* ptr to transmit driver descriptor */
  17153. PI_TYPE_2_CONSUMER *p_type_2_cons; /* ptr to rcv/xmt consumer block register */
  17154. + u8 comp; /* local transmit completion index */
  17155. int freed = 0; /* buffers freed */
  17156. /* Service all consumed transmit frames */
  17157. @@ -3188,7 +3308,11 @@ static int dfx_xmt_done(DFX_board_t *bp)
  17158. bp->xmt_total_bytes += p_xmt_drv_descr->p_skb->len;
  17159. /* Return skb to operating system */
  17160. -
  17161. + comp = bp->rcv_xmt_reg.index.xmt_comp;
  17162. + pci_unmap_single(bp->pci_dev,
  17163. + bp->descr_block_virt->xmt_data[comp].long_1,
  17164. + p_xmt_drv_descr->p_skb->len,
  17165. + PCI_DMA_TODEVICE);
  17166. dev_kfree_skb_irq(p_xmt_drv_descr->p_skb);
  17167. /*
  17168. @@ -3297,6 +3421,7 @@ static void dfx_xmt_flush( DFX_board_t *
  17169. {
  17170. u32 prod_cons; /* rcv/xmt consumer block longword */
  17171. XMT_DRIVER_DESCR *p_xmt_drv_descr; /* ptr to transmit driver descriptor */
  17172. + u8 comp; /* local transmit completion index */
  17173. /* Flush all outstanding transmit frames */
  17174. @@ -3307,7 +3432,11 @@ static void dfx_xmt_flush( DFX_board_t *
  17175. p_xmt_drv_descr = &(bp->xmt_drv_descr_blk[bp->rcv_xmt_reg.index.xmt_comp]);
  17176. /* Return skb to operating system */
  17177. -
  17178. + comp = bp->rcv_xmt_reg.index.xmt_comp;
  17179. + pci_unmap_single(bp->pci_dev,
  17180. + bp->descr_block_virt->xmt_data[comp].long_1,
  17181. + p_xmt_drv_descr->p_skb->len,
  17182. + PCI_DMA_TODEVICE);
  17183. dev_kfree_skb(p_xmt_drv_descr->p_skb);
  17184. /* Increment transmit error counter */
  17185. @@ -3337,12 +3466,36 @@ static void dfx_xmt_flush( DFX_board_t *
  17186. static void __devexit dfx_remove_one_pci_or_eisa(struct pci_dev *pdev, struct net_device *dev)
  17187. {
  17188. - DFX_board_t *bp = dev->priv;
  17189. + DFX_board_t *bp = dev->priv;
  17190. + unsigned long len; /* resource length */
  17191. + int alloc_size; /* total buffer size used */
  17192. + if (bp->bus_type == DFX_BUS_TYPE_TC) {
  17193. + /* TURBOchannel board */
  17194. + len = PI_TC_K_CSR_LEN;
  17195. + } else if (bp->bus_type == DFX_BUS_TYPE_EISA) {
  17196. + /* EISA board */
  17197. + len = PI_ESIC_K_CSR_IO_LEN;
  17198. + } else {
  17199. + len = PFI_K_CSR_IO_LEN;
  17200. + }
  17201. unregister_netdev(dev);
  17202. - release_region(dev->base_addr, pdev ? PFI_K_CSR_IO_LEN : PI_ESIC_K_CSR_IO_LEN );
  17203. - if (bp->kmalloced) kfree(bp->kmalloced);
  17204. - kfree(dev);
  17205. + release_region(dev->base_addr, len);
  17206. +
  17207. + if (bp->bus_type == DFX_BUS_TYPE_TC)
  17208. + release_tc_card(bp->slot);
  17209. +
  17210. + alloc_size = sizeof(PI_DESCR_BLOCK) +
  17211. + PI_CMD_REQ_K_SIZE_MAX + PI_CMD_RSP_K_SIZE_MAX +
  17212. +#ifndef DYNAMIC_BUFFERS
  17213. + (bp->rcv_bufs_to_post * PI_RCV_DATA_K_SIZE_MAX) +
  17214. +#endif
  17215. + sizeof(PI_CONSUMER_BLOCK) +
  17216. + (PI_ALIGN_K_DESC_BLK - 1);
  17217. + if (bp->kmalloced)
  17218. + pci_free_consistent(pdev, alloc_size, bp->kmalloced,
  17219. + bp->kmalloced_dma);
  17220. + free_netdev(dev);
  17221. }
  17222. static void __devexit dfx_remove_one (struct pci_dev *pdev)
  17223. @@ -3353,21 +3506,22 @@ static void __devexit dfx_remove_one (st
  17224. pci_set_drvdata(pdev, NULL);
  17225. }
  17226. -static struct pci_device_id dfx_pci_tbl[] __devinitdata = {
  17227. +static struct pci_device_id dfx_pci_tbl[] = {
  17228. { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_FDDI, PCI_ANY_ID, PCI_ANY_ID, },
  17229. { 0, }
  17230. };
  17231. MODULE_DEVICE_TABLE(pci, dfx_pci_tbl);
  17232. static struct pci_driver dfx_driver = {
  17233. - name: "defxx",
  17234. - probe: dfx_init_one,
  17235. - remove: __devexit_p(dfx_remove_one),
  17236. - id_table: dfx_pci_tbl,
  17237. + .name = "defxx",
  17238. + .probe = dfx_init_one,
  17239. + .remove = __devexit_p(dfx_remove_one),
  17240. + .id_table = dfx_pci_tbl,
  17241. };
  17242. static int dfx_have_pci;
  17243. static int dfx_have_eisa;
  17244. +static int dfx_have_tc;
  17245. static void __exit dfx_eisa_cleanup(void)
  17246. @@ -3388,12 +3542,7 @@ static void __exit dfx_eisa_cleanup(void
  17247. static int __init dfx_init(void)
  17248. {
  17249. - int rc_pci, rc_eisa;
  17250. -
  17251. -/* when a module, this is printed whether or not devices are found in probe */
  17252. -#ifdef MODULE
  17253. - printk(version);
  17254. -#endif
  17255. + int rc_pci, rc_eisa, rc_tc;
  17256. rc_pci = pci_module_init(&dfx_driver);
  17257. if (rc_pci >= 0) dfx_have_pci = 1;
  17258. @@ -3401,20 +3550,27 @@ static int __init dfx_init(void)
  17259. rc_eisa = dfx_eisa_init();
  17260. if (rc_eisa >= 0) dfx_have_eisa = 1;
  17261. - return ((rc_eisa < 0) ? 0 : rc_eisa) + ((rc_pci < 0) ? 0 : rc_pci);
  17262. + rc_tc = dfx_tc_init();
  17263. + if (rc_tc >= 0) dfx_have_tc = 1;
  17264. +
  17265. + return ((rc_tc < 0) ? 0 : rc_tc) +
  17266. + ((rc_eisa < 0) ? 0 : rc_eisa) +
  17267. + ((rc_pci < 0) ? 0 : rc_pci);
  17268. }
  17269. static void __exit dfx_cleanup(void)
  17270. {
  17271. if (dfx_have_pci)
  17272. pci_unregister_driver(&dfx_driver);
  17273. - if (dfx_have_eisa)
  17274. + if (dfx_have_eisa || dfx_have_tc)
  17275. dfx_eisa_cleanup();
  17276. -
  17277. }
  17278. module_init(dfx_init);
  17279. module_exit(dfx_cleanup);
  17280. +MODULE_AUTHOR("Lawrence V. Stefani");
  17281. +MODULE_DESCRIPTION("DEC FDDIcontroller EISA/PCI (DEFEA/DEFPA) driver "
  17282. + DRV_VERSION " " DRV_RELDATE);
  17283. MODULE_LICENSE("GPL");
  17284. --- a/drivers/net/defxx.h
  17285. +++ b/drivers/net/defxx.h
  17286. @@ -12,17 +12,11 @@
  17287. * Contains all definitions specified by port specification and required
  17288. * by the defxx.c driver.
  17289. *
  17290. - * Maintainers:
  17291. - * LVS Lawrence V. Stefani
  17292. - *
  17293. - * Contact:
  17294. - * The author may be reached at:
  17295. + * The original author:
  17296. + * LVS Lawrence V. Stefani <[email protected]>
  17297. *
  17298. - * Inet: [email protected]
  17299. - * Mail: Digital Equipment Corporation
  17300. - * 550 King Street
  17301. - * M/S: LKG1-3/M07
  17302. - * Littleton, MA 01460
  17303. + * Maintainers:
  17304. + * macro Maciej W. Rozycki <[email protected]>
  17305. *
  17306. * Modification History:
  17307. * Date Name Description
  17308. @@ -30,6 +24,7 @@
  17309. * 09-Sep-96 LVS Added group_prom field. Moved read/write I/O
  17310. * macros to DEFXX.C.
  17311. * 12-Sep-96 LVS Removed packet request header pointers.
  17312. + * 04 Aug 2003 macro Converted to the DMA API.
  17313. */
  17314. #ifndef _DEFXX_H_
  17315. @@ -1467,6 +1462,11 @@ typedef union
  17316. #endif /* #ifndef BIG_ENDIAN */
  17317. +/* Define TC PDQ CSR offset and length */
  17318. +
  17319. +#define PI_TC_K_CSR_OFFSET 0x100000
  17320. +#define PI_TC_K_CSR_LEN 0x80 /* 128 bytes */
  17321. +
  17322. /* Define EISA controller register offsets */
  17323. #define PI_ESIC_K_BURST_HOLDOFF 0x040
  17324. @@ -1634,6 +1634,7 @@ typedef union
  17325. #define DFX_BUS_TYPE_PCI 0 /* type code for DEC FDDIcontroller/PCI */
  17326. #define DFX_BUS_TYPE_EISA 1 /* type code for DEC FDDIcontroller/EISA */
  17327. +#define DFX_BUS_TYPE_TC 2 /* type code for DEC FDDIcontroller/TURBOchannel */
  17328. #define DFX_FC_PRH2_PRH1_PRH0 0x54003820 /* Packet Request Header bytes + FC */
  17329. #define DFX_PRH0_BYTE 0x20 /* Packet Request Header byte 0 */
  17330. @@ -1704,17 +1705,19 @@ typedef struct DFX_board_tag
  17331. {
  17332. /* Keep virtual and physical pointers to locked, physically contiguous memory */
  17333. - char *kmalloced; /* kfree this on unload */
  17334. + char *kmalloced; /* pci_free_consistent this on unload */
  17335. + dma_addr_t kmalloced_dma;
  17336. + /* DMA handle for the above */
  17337. PI_DESCR_BLOCK *descr_block_virt; /* PDQ descriptor block virt address */
  17338. - u32 descr_block_phys; /* PDQ descriptor block phys address */
  17339. + dma_addr_t descr_block_phys; /* PDQ descriptor block phys address */
  17340. PI_DMA_CMD_REQ *cmd_req_virt; /* Command request buffer virt address */
  17341. - u32 cmd_req_phys; /* Command request buffer phys address */
  17342. + dma_addr_t cmd_req_phys; /* Command request buffer phys address */
  17343. PI_DMA_CMD_RSP *cmd_rsp_virt; /* Command response buffer virt address */
  17344. - u32 cmd_rsp_phys; /* Command response buffer phys address */
  17345. + dma_addr_t cmd_rsp_phys; /* Command response buffer phys address */
  17346. char *rcv_block_virt; /* LLC host receive queue buf blk virt */
  17347. - u32 rcv_block_phys; /* LLC host receive queue buf blk phys */
  17348. + dma_addr_t rcv_block_phys; /* LLC host receive queue buf blk phys */
  17349. PI_CONSUMER_BLOCK *cons_block_virt; /* PDQ consumer block virt address */
  17350. - u32 cons_block_phys; /* PDQ consumer block phys address */
  17351. + dma_addr_t cons_block_phys; /* PDQ consumer block phys address */
  17352. /* Keep local copies of Type 1 and Type 2 register data */
  17353. @@ -1758,8 +1761,9 @@ typedef struct DFX_board_tag
  17354. struct net_device *dev; /* pointer to device structure */
  17355. struct net_device *next;
  17356. - u32 bus_type; /* bus type (0 == PCI, 1 == EISA) */
  17357. - u16 base_addr; /* base I/O address (same as dev->base_addr) */
  17358. + u32 bus_type; /* bus type (0 == PCI, 1 == EISA, 2 == TC) */
  17359. + long base_addr; /* base I/O address (same as dev->base_addr) */
  17360. + int slot; /* TC slot number */
  17361. struct pci_dev * pci_dev;
  17362. u32 full_duplex_enb; /* FDDI Full Duplex enable (1 == on, 2 == off) */
  17363. u32 req_ttrt; /* requested TTRT value (in 80ns units) */
  17364. --- a/drivers/net/hamradio/hdlcdrv.c
  17365. +++ b/drivers/net/hamradio/hdlcdrv.c
  17366. @@ -587,6 +587,8 @@ static int hdlcdrv_close(struct net_devi
  17367. return -EINVAL;
  17368. s = (struct hdlcdrv_state *)dev->priv;
  17369. + netif_stop_queue(dev);
  17370. +
  17371. if (s->ops && s->ops->close)
  17372. i = s->ops->close(dev);
  17373. if (s->skb)
  17374. --- a/drivers/net/irda/au1k_ir.c
  17375. +++ b/drivers/net/irda/au1k_ir.c
  17376. @@ -81,10 +81,6 @@ static char version[] __devinitdata =
  17377. #define RUN_AT(x) (jiffies + (x))
  17378. -#if defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100)
  17379. -static BCSR * const bcsr = (BCSR *)0xAE000000;
  17380. -#endif
  17381. -
  17382. static spinlock_t ir_lock = SPIN_LOCK_UNLOCKED;
  17383. /*
  17384. --- a/drivers/net/sgiseeq.c
  17385. +++ b/drivers/net/sgiseeq.c
  17386. @@ -24,16 +24,16 @@
  17387. #include <asm/io.h>
  17388. #include <asm/system.h>
  17389. #include <asm/bitops.h>
  17390. +#include <asm/paccess.h>
  17391. #include <asm/page.h>
  17392. #include <asm/pgtable.h>
  17393. +#include <asm/sgi/mc.h>
  17394. #include <asm/sgi/hpc3.h>
  17395. #include <asm/sgi/ip22.h>
  17396. #include <asm/sgialib.h>
  17397. #include "sgiseeq.h"
  17398. -static char *version = "sgiseeq.c: David S. Miller ([email protected])\n";
  17399. -
  17400. static char *sgiseeqstr = "SGI Seeq8003";
  17401. /*
  17402. @@ -113,9 +113,9 @@ static struct net_device *root_sgiseeq_d
  17403. static inline void hpc3_eth_reset(struct hpc3_ethregs *hregs)
  17404. {
  17405. - hregs->rx_reset = HPC3_ERXRST_CRESET | HPC3_ERXRST_CLRIRQ;
  17406. + hregs->reset = HPC3_ERST_CRESET | HPC3_ERST_CLRIRQ;
  17407. udelay(20);
  17408. - hregs->rx_reset = 0;
  17409. + hregs->reset = 0;
  17410. }
  17411. static inline void reset_hpc3_and_seeq(struct hpc3_ethregs *hregs,
  17412. @@ -238,7 +238,6 @@ void sgiseeq_dump_rings(void)
  17413. #define TSTAT_INIT_SEEQ (SEEQ_TCMD_IPT|SEEQ_TCMD_I16|SEEQ_TCMD_IC|SEEQ_TCMD_IUF)
  17414. #define TSTAT_INIT_EDLC ((TSTAT_INIT_SEEQ) | SEEQ_TCMD_RB2)
  17415. -#define RDMACFG_INIT (HPC3_ERXDCFG_FRXDC | HPC3_ERXDCFG_FEOP | HPC3_ERXDCFG_FIRQ)
  17416. static int init_seeq(struct net_device *dev, struct sgiseeq_private *sp,
  17417. struct sgiseeq_regs *sregs)
  17418. @@ -260,8 +259,6 @@ static int init_seeq(struct net_device *
  17419. sregs->tstat = TSTAT_INIT_SEEQ;
  17420. }
  17421. - hregs->rx_dconfig |= RDMACFG_INIT;
  17422. -
  17423. hregs->rx_ndptr = PHYSADDR(&sp->srings.rx_desc[0]);
  17424. hregs->tx_ndptr = PHYSADDR(&sp->srings.tx_desc[0]);
  17425. @@ -432,7 +429,7 @@ static void sgiseeq_interrupt(int irq, v
  17426. spin_lock(&sp->tx_lock);
  17427. /* Ack the IRQ and set software state. */
  17428. - hregs->rx_reset = HPC3_ERXRST_CLRIRQ;
  17429. + hregs->reset = HPC3_ERST_CLRIRQ;
  17430. /* Always check for received packets. */
  17431. sgiseeq_rx(dev, sp, hregs, sregs);
  17432. @@ -616,7 +613,7 @@ static inline void setup_rx_ring(struct
  17433. #define ALIGNED(x) ((((unsigned long)(x)) + 0xf) & ~(0xf))
  17434. -int sgiseeq_init(struct hpc3_regs* regs, int irq)
  17435. +int sgiseeq_init(struct hpc3_regs* hpcregs, int irq, int has_eeprom)
  17436. {
  17437. struct net_device *dev;
  17438. struct sgiseeq_private *sp;
  17439. @@ -629,7 +626,7 @@ int sgiseeq_init(struct hpc3_regs* regs,
  17440. goto err_out;
  17441. }
  17442. /* Make private data page aligned */
  17443. - sp = (struct sgiseeq_private *) get_zeroed_page(GFP_KERNEL);
  17444. + sp = (struct sgiseeq_private *) get_zeroed_page(GFP_KERNEL);
  17445. if (!sp) {
  17446. printk(KERN_ERR "Sgiseeq: Page alloc failed, aborting.\n");
  17447. err = -ENOMEM;
  17448. @@ -644,7 +641,9 @@ int sgiseeq_init(struct hpc3_regs* regs,
  17449. #define EADDR_NVOFS 250
  17450. for (i = 0; i < 3; i++) {
  17451. - unsigned short tmp = ip22_nvram_read(EADDR_NVOFS / 2 + i);
  17452. + unsigned short tmp = has_eeprom ?
  17453. + ip22_eeprom_read(&hpcregs->eeprom, EADDR_NVOFS / 2+i) :
  17454. + ip22_nvram_read(EADDR_NVOFS / 2+i);
  17455. dev->dev_addr[2 * i] = tmp >> 8;
  17456. dev->dev_addr[2 * i + 1] = tmp & 0xff;
  17457. @@ -654,8 +653,8 @@ int sgiseeq_init(struct hpc3_regs* regs,
  17458. gpriv = sp;
  17459. gdev = dev;
  17460. #endif
  17461. - sp->sregs = (struct sgiseeq_regs *) &hpc3c0->eth_ext[0];
  17462. - sp->hregs = &hpc3c0->ethregs;
  17463. + sp->sregs = (struct sgiseeq_regs *) &hpcregs->eth_ext[0];
  17464. + sp->hregs = &hpcregs->ethregs;
  17465. sp->name = sgiseeqstr;
  17466. sp->mode = SEEQ_RCMD_RBCAST;
  17467. @@ -672,6 +671,11 @@ int sgiseeq_init(struct hpc3_regs* regs,
  17468. setup_rx_ring(sp->srings.rx_desc, SEEQ_RX_BUFFERS);
  17469. setup_tx_ring(sp->srings.tx_desc, SEEQ_TX_BUFFERS);
  17470. + /* Setup PIO and DMA transfer timing */
  17471. + sp->hregs->pconfig = 0x161;
  17472. + sp->hregs->dconfig = HPC3_EDCFG_FIRQ | HPC3_EDCFG_FEOP |
  17473. + HPC3_EDCFG_FRXDC | HPC3_EDCFG_PTO | 0x026;
  17474. +
  17475. /* Reset the chip. */
  17476. hpc3_eth_reset(sp->hregs);
  17477. @@ -699,7 +703,7 @@ int sgiseeq_init(struct hpc3_regs* regs,
  17478. goto err_out_free_irq;
  17479. }
  17480. - printk(KERN_INFO "%s: SGI Seeq8003 ", dev->name);
  17481. + printk(KERN_INFO "%s: %s ", dev->name, sgiseeqstr);
  17482. for (i = 0; i < 6; i++)
  17483. printk("%2.2x%c", dev->dev_addr[i], i == 5 ? '\n' : ':');
  17484. @@ -721,10 +725,22 @@ err_out:
  17485. static int __init sgiseeq_probe(void)
  17486. {
  17487. - printk(version);
  17488. + unsigned int tmp, ret1, ret2 = 0;
  17489. /* On board adapter on 1st HPC is always present */
  17490. - return sgiseeq_init(hpc3c0, SGI_ENET_IRQ);
  17491. + ret1 = sgiseeq_init(hpc3c0, SGI_ENET_IRQ, 0);
  17492. + /* Let's see if second HPC is there */
  17493. + if (!(ip22_is_fullhouse()) &&
  17494. + get_dbe(tmp, (unsigned int *)&hpc3c1->pbdma[1]) == 0) {
  17495. + sgimc->giopar |= SGIMC_GIOPAR_MASTEREXP1 |
  17496. + SGIMC_GIOPAR_EXP164 |
  17497. + SGIMC_GIOPAR_HPC264;
  17498. + hpc3c1->pbus_piocfg[0][0] = 0x3ffff;
  17499. + /* interrupt/config register on Challenge S Mezz board */
  17500. + hpc3c1->pbus_extregs[0][0] = 0x30;
  17501. + ret2 = sgiseeq_init(hpc3c1, SGI_GIO_0_IRQ, 1);
  17502. + }
  17503. + return (ret1 & ret2) ? ret1 : 0;
  17504. }
  17505. static void __exit sgiseeq_exit(void)
  17506. @@ -747,4 +763,6 @@ static void __exit sgiseeq_exit(void)
  17507. module_init(sgiseeq_probe);
  17508. module_exit(sgiseeq_exit);
  17509. +MODULE_DESCRIPTION("SGI Seeq 8003 driver");
  17510. +MODULE_AUTHOR("David S. Miller");
  17511. MODULE_LICENSE("GPL");
  17512. --- a/drivers/pci/pci.c
  17513. +++ b/drivers/pci/pci.c
  17514. @@ -1281,11 +1281,17 @@ static int __devinit pci_scan_bridge(str
  17515. {
  17516. unsigned int buses;
  17517. unsigned short cr;
  17518. + unsigned short bctl;
  17519. struct pci_bus *child;
  17520. int is_cardbus = (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS);
  17521. pci_read_config_dword(dev, PCI_PRIMARY_BUS, &buses);
  17522. DBG("Scanning behind PCI bridge %s, config %06x, pass %d\n", dev->slot_name, buses & 0xffffff, pass);
  17523. + /* Disable MasterAbortMode during probing to avoid reporting
  17524. + of bus errors (in some architectures) */
  17525. + pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &bctl);
  17526. + pci_write_config_word(dev, PCI_BRIDGE_CONTROL,
  17527. + bctl & ~PCI_BRIDGE_CTL_MASTER_ABORT);
  17528. if ((buses & 0xffff00) && !pcibios_assign_all_busses()) {
  17529. /*
  17530. * Bus already configured by firmware, process it in the first
  17531. @@ -1351,6 +1357,7 @@ static int __devinit pci_scan_bridge(str
  17532. pci_write_config_byte(dev, PCI_SUBORDINATE_BUS, max);
  17533. pci_write_config_word(dev, PCI_COMMAND, cr);
  17534. }
  17535. + pci_write_config_word(dev, PCI_BRIDGE_CONTROL, bctl);
  17536. sprintf(child->name, (is_cardbus ? "PCI CardBus #%02x" : "PCI Bus #%02x"), child->number);
  17537. return max;
  17538. }
  17539. --- a/drivers/pcmcia/au1000_db1x00.c
  17540. +++ b/drivers/pcmcia/au1000_db1x00.c
  17541. @@ -1,6 +1,6 @@
  17542. /*
  17543. *
  17544. - * Alchemy Semi Db1x00 boards specific pcmcia routines.
  17545. + * AMD Alchemy DUAL-SLOT Db1x00 boards' specific pcmcia routines.
  17546. *
  17547. * Copyright 2002 MontaVista Software Inc.
  17548. * Author: MontaVista Software, Inc.
  17549. @@ -54,9 +54,20 @@
  17550. #include <asm/au1000.h>
  17551. #include <asm/au1000_pcmcia.h>
  17552. +#if defined(CONFIG_MIPS_PB1200)
  17553. +#include <asm/pb1200.h>
  17554. +#elif defined(CONFIG_MIPS_DB1200)
  17555. +#include <asm/db1200.h>
  17556. +#else
  17557. #include <asm/db1x00.h>
  17558. +#endif
  17559. -static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  17560. +#define PCMCIA_MAX_SOCK 1
  17561. +#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK+1)
  17562. +
  17563. +/* VPP/VCC */
  17564. +#define SET_VCC_VPP(VCC, VPP, SLOT)\
  17565. + ((((VCC)<<2) | ((VPP)<<0)) << ((SLOT)*8))
  17566. static int db1x00_pcmcia_init(struct pcmcia_init *init)
  17567. {
  17568. @@ -76,7 +87,7 @@ static int
  17569. db1x00_pcmcia_socket_state(unsigned sock, struct pcmcia_state *state)
  17570. {
  17571. u32 inserted;
  17572. - unsigned char vs;
  17573. + u16 vs;
  17574. if(sock > PCMCIA_MAX_SOCK) return -1;
  17575. @@ -87,11 +98,11 @@ db1x00_pcmcia_socket_state(unsigned sock
  17576. if (sock == 0) {
  17577. vs = bcsr->status & 0x3;
  17578. - inserted = !(bcsr->status & (1<<4));
  17579. + inserted = BOARD_CARD_INSERTED(0);
  17580. }
  17581. else {
  17582. vs = (bcsr->status & 0xC)>>2;
  17583. - inserted = !(bcsr->status & (1<<5));
  17584. + inserted = BOARD_CARD_INSERTED(1);
  17585. }
  17586. DEBUG(KERN_DEBUG "db1x00 socket %d: inserted %d, vs %d\n",
  17587. @@ -144,16 +155,9 @@ static int db1x00_pcmcia_get_irq_info(st
  17588. if(info->sock > PCMCIA_MAX_SOCK) return -1;
  17589. if(info->sock == 0)
  17590. -#ifdef CONFIG_MIPS_DB1550
  17591. - info->irq = AU1000_GPIO_3;
  17592. + info->irq = BOARD_PC0_INT;
  17593. else
  17594. - info->irq = AU1000_GPIO_5;
  17595. -#else
  17596. - info->irq = AU1000_GPIO_2;
  17597. - else
  17598. - info->irq = AU1000_GPIO_5;
  17599. -#endif
  17600. -
  17601. + info->irq = BOARD_PC1_INT;
  17602. return 0;
  17603. }
  17604. --- a/drivers/pcmcia/Config.in
  17605. +++ b/drivers/pcmcia/Config.in
  17606. @@ -30,16 +30,14 @@ if [ "$CONFIG_PCMCIA" != "n" ]; then
  17607. dep_tristate ' M8xx support' CONFIG_PCMCIA_M8XX $CONFIG_PCMCIA
  17608. fi
  17609. if [ "$CONFIG_SOC_AU1X00" = "y" ]; then
  17610. - dep_tristate ' Au1x00 PCMCIA support' CONFIG_PCMCIA_AU1X00 $CONFIG_PCMCIA
  17611. - if [ "$CONFIG_PCMCIA_AU1X00" != "n" ]; then
  17612. - bool ' Pb1x00 board support' CONFIG_PCMCIA_PB1X00
  17613. - bool ' Db1x00 board support' CONFIG_PCMCIA_DB1X00
  17614. - bool ' XXS1500 board support' CONFIG_PCMCIA_XXS1500
  17615. - fi
  17616. + dep_tristate ' Au1x00 PCMCIA support' CONFIG_PCMCIA_AU1X00 $CONFIG_PCMCIA
  17617. fi
  17618. if [ "$CONFIG_SIBYTE_SB1xxx_SOC" = "y" ]; then
  17619. dep_bool ' SiByte PCMCIA support' CONFIG_PCMCIA_SIBYTE $CONFIG_PCMCIA $CONFIG_BLK_DEV_IDE_SIBYTE
  17620. fi
  17621. + if [ "$CONFIG_VRC4171" = "y" -o "$CONFIG_VRC4171" = "m" ]; then
  17622. + dep_tristate ' NEC VRC4171 Card Controllers support' CONFIG_PCMCIA_VRC4171 $CONFIG_PCMCIA
  17623. + fi
  17624. if [ "$CONFIG_VRC4173" = "y" -o "$CONFIG_VRC4173" = "m" ]; then
  17625. dep_tristate ' NEC VRC4173 CARDU support' CONFIG_PCMCIA_VRC4173 $CONFIG_PCMCIA
  17626. fi
  17627. --- a/drivers/pcmcia/Makefile
  17628. +++ b/drivers/pcmcia/Makefile
  17629. @@ -61,9 +61,18 @@ endif
  17630. obj-$(CONFIG_PCMCIA_AU1X00) += au1x00_ss.o
  17631. au1000_ss-objs-y := au1000_generic.o
  17632. -au1000_ss-objs-$(CONFIG_PCMCIA_PB1X00) += au1000_pb1x00.o
  17633. -au1000_ss-objs-$(CONFIG_PCMCIA_DB1X00) += au1000_db1x00.o
  17634. -au1000_ss-objs-$(CONFIG_PCMCIA_XXS1500) += au1000_xxs1500.o
  17635. +au1000_ss-objs-$(CONFIG_MIPS_PB1000) += au1000_pb1x00.o
  17636. +au1000_ss-objs-$(CONFIG_MIPS_PB1100) += au1000_pb1x00.o
  17637. +au1000_ss-objs-$(CONFIG_MIPS_PB1500) += au1000_pb1x00.o
  17638. +au1000_ss-objs-$(CONFIG_MIPS_PB1550) += au1000_pb1550.o
  17639. +au1000_ss-objs-$(CONFIG_MIPS_PB1200) += au1000_db1x00.o
  17640. +au1000_ss-objs-$(CONFIG_MIPS_DB1000) += au1000_db1x00.o
  17641. +au1000_ss-objs-$(CONFIG_MIPS_DB1100) += au1000_db1x00.o
  17642. +au1000_ss-objs-$(CONFIG_MIPS_DB1500) += au1000_db1x00.o
  17643. +au1000_ss-objs-$(CONFIG_MIPS_DB1550) += au1000_db1x00.o
  17644. +au1000_ss-objs-$(CONFIG_MIPS_DB1200) += au1000_db1x00.o
  17645. +au1000_ss-objs-$(CONFIG_MIPS_HYDROGEN3) += au1000_hydrogen3.o
  17646. +au1000_ss-objs-$(CONFIG_MIPS_XXS1500) += au1000_xxs1500.o
  17647. obj-$(CONFIG_PCMCIA_SA1100) += sa1100_cs.o
  17648. obj-$(CONFIG_PCMCIA_M8XX) += m8xx_pcmcia.o
  17649. @@ -89,6 +98,7 @@ sa1100_cs-objs-$(CONFIG_SA1100_STORK) +
  17650. sa1100_cs-objs-$(CONFIG_SA1100_XP860) += sa1100_xp860.o sa1111_generic.o
  17651. sa1100_cs-objs-$(CONFIG_SA1100_YOPY) += sa1100_yopy.o
  17652. +obj-$(CONFIG_PCMCIA_VRC4171) += vrc4171_card.o
  17653. obj-$(CONFIG_PCMCIA_VRC4173) += vrc4173_cardu.o
  17654. include $(TOPDIR)/Rules.make
  17655. --- /dev/null
  17656. +++ b/drivers/pcmcia/vrc4171_card.c
  17657. @@ -0,0 +1,886 @@
  17658. +/*
  17659. + * vrc4171_card.c, NEC VRC4171 Card Controller driver for Socket Services.
  17660. + *
  17661. + * Copyright (C) 2003 Yoichi Yuasa <[email protected]>
  17662. + *
  17663. + * This program is free software; you can redistribute it and/or modify
  17664. + * it under the terms of the GNU General Public License as published by
  17665. + * the Free Software Foundation; either version 2 of the License, or
  17666. + * (at your option) any later version.
  17667. + *
  17668. + * This program is distributed in the hope that it will be useful,
  17669. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17670. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17671. + * GNU General Public License for more details.
  17672. + *
  17673. + * You should have received a copy of the GNU General Public License
  17674. + * along with this program; if not, write to the Free Software
  17675. + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17676. + */
  17677. +#include <linux/init.h>
  17678. +#include <linux/ioport.h>
  17679. +#include <linux/irq.h>
  17680. +#include <linux/module.h>
  17681. +#include <linux/spinlock.h>
  17682. +#include <linux/sched.h>
  17683. +#include <linux/types.h>
  17684. +
  17685. +#include <asm/io.h>
  17686. +#include <asm/vr41xx/vrc4171.h>
  17687. +
  17688. +#include <pcmcia/ss.h>
  17689. +
  17690. +#include "i82365.h"
  17691. +
  17692. +MODULE_DESCRIPTION("NEC VRC4171 Card Controllers driver for Socket Services");
  17693. +MODULE_AUTHOR("Yoichi Yuasa <[email protected]>");
  17694. +MODULE_LICENSE("GPL");
  17695. +
  17696. +#define CARD_MAX_SLOTS 2
  17697. +#define CARD_SLOTA 0
  17698. +#define CARD_SLOTB 1
  17699. +#define CARD_SLOTB_OFFSET 0x40
  17700. +
  17701. +#define CARD_MEM_START 0x10000000
  17702. +#define CARD_MEM_END 0x13ffffff
  17703. +#define CARD_MAX_MEM_OFFSET 0x3ffffff
  17704. +#define CARD_MAX_MEM_SPEED 1000
  17705. +
  17706. +#define CARD_CONTROLLER_INDEX 0x03e0
  17707. +#define CARD_CONTROLLER_DATA 0x03e1
  17708. +#define CARD_CONTROLLER_SIZE 2
  17709. + /* Power register */
  17710. + #define VPP_GET_VCC 0x01
  17711. + #define POWER_ENABLE 0x10
  17712. + #define CARD_VOLTAGE_SENSE 0x1f
  17713. + #define VCC_3VORXV_CAPABLE 0x00
  17714. + #define VCC_XV_ONLY 0x01
  17715. + #define VCC_3V_CAPABLE 0x02
  17716. + #define VCC_5V_ONLY 0x03
  17717. + #define CARD_VOLTAGE_SELECT 0x2f
  17718. + #define VCC_3V 0x01
  17719. + #define VCC_5V 0x00
  17720. + #define VCC_XV 0x02
  17721. + #define VCC_STATUS_3V 0x02
  17722. + #define VCC_STATUS_5V 0x01
  17723. + #define VCC_STATUS_XV 0x03
  17724. + #define GLOBAL_CONTROL 0x1e
  17725. + #define EXWRBK 0x04
  17726. + #define IRQPM_EN 0x08
  17727. + #define CLRPMIRQ 0x10
  17728. +
  17729. +#define IO_MAX_MAPS 2
  17730. +#define MEM_MAX_MAPS 5
  17731. +
  17732. +enum {
  17733. + SLOTB_PROBE = 0,
  17734. + SLOTB_NOPROBE_IO,
  17735. + SLOTB_NOPROBE_MEM,
  17736. + SLOTB_NOPROBE_ALL
  17737. +};
  17738. +
  17739. +typedef struct vrc4171_socket {
  17740. + int noprobe;
  17741. + void (*handler)(void *, unsigned int);
  17742. + void *info;
  17743. + socket_cap_t cap;
  17744. + spinlock_t event_lock;
  17745. + uint16_t events;
  17746. + struct socket_info_t *pcmcia_socket;
  17747. + struct tq_struct tq_task;
  17748. + char name[24];
  17749. + int csc_irq;
  17750. + int io_irq;
  17751. +} vrc4171_socket_t;
  17752. +
  17753. +static vrc4171_socket_t vrc4171_sockets[CARD_MAX_SLOTS];
  17754. +static int vrc4171_slotb = SLOTB_IS_NONE;
  17755. +static unsigned int vrc4171_irq;
  17756. +static uint16_t vrc4171_irq_mask = 0xdeb8;
  17757. +
  17758. +extern struct socket_info_t *pcmcia_register_socket(int slot,
  17759. + struct pccard_operations *vtable,
  17760. + int use_bus_pm);
  17761. +extern void pcmcia_unregister_socket(struct socket_info_t *s);
  17762. +
  17763. +static inline uint8_t exca_read_byte(int slot, uint8_t index)
  17764. +{
  17765. + if (slot == CARD_SLOTB)
  17766. + index += CARD_SLOTB_OFFSET;
  17767. +
  17768. + outb(index, CARD_CONTROLLER_INDEX);
  17769. + return inb(CARD_CONTROLLER_DATA);
  17770. +}
  17771. +
  17772. +static inline uint16_t exca_read_word(int slot, uint8_t index)
  17773. +{
  17774. + uint16_t data;
  17775. +
  17776. + if (slot == CARD_SLOTB)
  17777. + index += CARD_SLOTB_OFFSET;
  17778. +
  17779. + outb(index++, CARD_CONTROLLER_INDEX);
  17780. + data = inb(CARD_CONTROLLER_DATA);
  17781. +
  17782. + outb(index, CARD_CONTROLLER_INDEX);
  17783. + data |= ((uint16_t)inb(CARD_CONTROLLER_DATA)) << 8;
  17784. +
  17785. + return data;
  17786. +}
  17787. +
  17788. +static inline uint8_t exca_write_byte(int slot, uint8_t index, uint8_t data)
  17789. +{
  17790. + if (slot == CARD_SLOTB)
  17791. + index += CARD_SLOTB_OFFSET;
  17792. +
  17793. + outb(index, CARD_CONTROLLER_INDEX);
  17794. + outb(data, CARD_CONTROLLER_DATA);
  17795. +
  17796. + return data;
  17797. +}
  17798. +
  17799. +static inline uint16_t exca_write_word(int slot, uint8_t index, uint16_t data)
  17800. +{
  17801. + if (slot == CARD_SLOTB)
  17802. + index += CARD_SLOTB_OFFSET;
  17803. +
  17804. + outb(index++, CARD_CONTROLLER_INDEX);
  17805. + outb(data, CARD_CONTROLLER_DATA);
  17806. +
  17807. + outb(index, CARD_CONTROLLER_INDEX);
  17808. + outb((uint8_t)(data >> 8), CARD_CONTROLLER_DATA);
  17809. +
  17810. + return data;
  17811. +}
  17812. +
  17813. +static inline int search_nonuse_irq(void)
  17814. +{
  17815. + int i;
  17816. +
  17817. + for (i = 0; i < 16; i++) {
  17818. + if (vrc4171_irq_mask & (1 << i)) {
  17819. + vrc4171_irq_mask &= ~(1 << i);
  17820. + return i;
  17821. + }
  17822. + }
  17823. +
  17824. + return -1;
  17825. +}
  17826. +
  17827. +static int pccard_init(unsigned int slot)
  17828. +{
  17829. + vrc4171_socket_t *socket = &vrc4171_sockets[slot];
  17830. +
  17831. + socket->cap.features |= SS_CAP_PCCARD | SS_CAP_PAGE_REGS;
  17832. + socket->cap.irq_mask = 0;
  17833. + socket->cap.pci_irq = vrc4171_irq;
  17834. + socket->cap.map_size = 0x1000;
  17835. + socket->events = 0;
  17836. + spin_lock_init(socket->event_lock);
  17837. + socket->csc_irq = search_nonuse_irq();
  17838. + socket->io_irq = search_nonuse_irq();
  17839. +
  17840. + return 0;
  17841. +}
  17842. +
  17843. +static int pccard_suspend(unsigned int slot)
  17844. +{
  17845. + return -EINVAL;
  17846. +}
  17847. +
  17848. +static int pccard_register_callback(unsigned int slot,
  17849. + void (*handler)(void *, unsigned int),
  17850. + void *info)
  17851. +{
  17852. + vrc4171_socket_t *socket;
  17853. +
  17854. + if (slot >= CARD_MAX_SLOTS)
  17855. + return -EINVAL;
  17856. +
  17857. + socket = &vrc4171_sockets[slot];
  17858. +
  17859. + socket->handler = handler;
  17860. + socket->info = info;
  17861. +
  17862. + if (handler)
  17863. + MOD_INC_USE_COUNT;
  17864. + else
  17865. + MOD_DEC_USE_COUNT;
  17866. +
  17867. + return 0;
  17868. +}
  17869. +
  17870. +static int pccard_inquire_socket(unsigned int slot, socket_cap_t *cap)
  17871. +{
  17872. + vrc4171_socket_t *socket;
  17873. +
  17874. + if (slot >= CARD_MAX_SLOTS || cap == NULL)
  17875. + return -EINVAL;
  17876. +
  17877. + socket = &vrc4171_sockets[slot];
  17878. +
  17879. + *cap = socket->cap;
  17880. +
  17881. + return 0;
  17882. +}
  17883. +
  17884. +static int pccard_get_status(unsigned int slot, u_int *value)
  17885. +{
  17886. + uint8_t status, sense;
  17887. + u_int val = 0;
  17888. +
  17889. + if (slot >= CARD_MAX_SLOTS || value == NULL)
  17890. + return -EINVAL;
  17891. +
  17892. + status = exca_read_byte(slot, I365_STATUS);
  17893. + if (exca_read_byte(slot, I365_INTCTL) & I365_PC_IOCARD) {
  17894. + if (status & I365_CS_STSCHG)
  17895. + val |= SS_STSCHG;
  17896. + } else {
  17897. + if (!(status & I365_CS_BVD1))
  17898. + val |= SS_BATDEAD;
  17899. + else if ((status & (I365_CS_BVD1 | I365_CS_BVD2)) == I365_CS_BVD1)
  17900. + val |= SS_BATWARN;
  17901. + }
  17902. + if ((status & I365_CS_DETECT) == I365_CS_DETECT)
  17903. + val |= SS_DETECT;
  17904. + if (status & I365_CS_WRPROT)
  17905. + val |= SS_WRPROT;
  17906. + if (status & I365_CS_READY)
  17907. + val |= SS_READY;
  17908. + if (status & I365_CS_POWERON)
  17909. + val |= SS_POWERON;
  17910. +
  17911. + sense = exca_read_byte(slot, CARD_VOLTAGE_SENSE);
  17912. + switch (sense) {
  17913. + case VCC_3VORXV_CAPABLE:
  17914. + val |= SS_3VCARD | SS_XVCARD;
  17915. + break;
  17916. + case VCC_XV_ONLY:
  17917. + val |= SS_XVCARD;
  17918. + break;
  17919. + case VCC_3V_CAPABLE:
  17920. + val |= SS_3VCARD;
  17921. + break;
  17922. + default:
  17923. + /* 5V only */
  17924. + break;
  17925. + }
  17926. +
  17927. + *value = val;
  17928. +
  17929. + return 0;
  17930. +}
  17931. +
  17932. +static inline u_char get_Vcc_value(uint8_t voltage)
  17933. +{
  17934. + switch (voltage) {
  17935. + case VCC_STATUS_3V:
  17936. + return 33;
  17937. + case VCC_STATUS_5V:
  17938. + return 50;
  17939. + default:
  17940. + break;
  17941. + }
  17942. +
  17943. + return 0;
  17944. +}
  17945. +
  17946. +static inline u_char get_Vpp_value(uint8_t power, u_char Vcc)
  17947. +{
  17948. + if ((power & 0x03) == 0x01 || (power & 0x03) == 0x02)
  17949. + return Vcc;
  17950. +
  17951. + return 0;
  17952. +}
  17953. +
  17954. +static int pccard_get_socket(unsigned int slot, socket_state_t *state)
  17955. +{
  17956. + vrc4171_socket_t *socket;
  17957. + uint8_t power, voltage, control, cscint;
  17958. +
  17959. + if (slot >= CARD_MAX_SLOTS || state == NULL)
  17960. + return -EINVAL;
  17961. +
  17962. + socket = &vrc4171_sockets[slot];
  17963. +
  17964. + power = exca_read_byte(slot, I365_POWER);
  17965. + voltage = exca_read_byte(slot, CARD_VOLTAGE_SELECT);
  17966. +
  17967. + state->Vcc = get_Vcc_value(voltage);
  17968. + state->Vpp = get_Vpp_value(power, state->Vcc);
  17969. +
  17970. + state->flags = 0;
  17971. + if (power & POWER_ENABLE)
  17972. + state->flags |= SS_PWR_AUTO;
  17973. + if (power & I365_PWR_OUT)
  17974. + state->flags |= SS_OUTPUT_ENA;
  17975. +
  17976. + control = exca_read_byte(slot, I365_INTCTL);
  17977. + if (control & I365_PC_IOCARD)
  17978. + state->flags |= SS_IOCARD;
  17979. + if (!(control & I365_PC_RESET))
  17980. + state->flags |= SS_RESET;
  17981. +
  17982. + cscint = exca_read_byte(slot, I365_CSCINT);
  17983. + state->csc_mask = 0;
  17984. + if (state->flags & SS_IOCARD) {
  17985. + if (cscint & I365_CSC_STSCHG)
  17986. + state->flags |= SS_STSCHG;
  17987. + } else {
  17988. + if (cscint & I365_CSC_BVD1)
  17989. + state->csc_mask |= SS_BATDEAD;
  17990. + if (cscint & I365_CSC_BVD2)
  17991. + state->csc_mask |= SS_BATWARN;
  17992. + }
  17993. + if (cscint & I365_CSC_READY)
  17994. + state->csc_mask |= SS_READY;
  17995. + if (cscint & I365_CSC_DETECT)
  17996. + state->csc_mask |= SS_DETECT;
  17997. +
  17998. + return 0;
  17999. +}
  18000. +
  18001. +static inline uint8_t set_Vcc_value(u_char Vcc)
  18002. +{
  18003. + switch (Vcc) {
  18004. + case 33:
  18005. + return VCC_3V;
  18006. + case 50:
  18007. + return VCC_5V;
  18008. + }
  18009. +
  18010. + /* Small voltage is chosen for safety. */
  18011. + return VCC_3V;
  18012. +}
  18013. +
  18014. +static int pccard_set_socket(unsigned int slot, socket_state_t *state)
  18015. +{
  18016. + vrc4171_socket_t *socket;
  18017. + uint8_t voltage, power, control, cscint;
  18018. +
  18019. + if (slot >= CARD_MAX_SLOTS ||
  18020. + (state->Vpp != state->Vcc && state->Vpp != 0) ||
  18021. + (state->Vcc != 50 && state->Vcc != 33 && state->Vcc != 0))
  18022. + return -EINVAL;
  18023. +
  18024. + socket = &vrc4171_sockets[slot];
  18025. +
  18026. + spin_lock_irq(&socket->event_lock);
  18027. +
  18028. + voltage = set_Vcc_value(state->Vcc);
  18029. + exca_write_byte(slot, CARD_VOLTAGE_SELECT, voltage);
  18030. +
  18031. + power = POWER_ENABLE;
  18032. + if (state->Vpp == state->Vcc)
  18033. + power |= VPP_GET_VCC;
  18034. + if (state->flags & SS_OUTPUT_ENA)
  18035. + power |= I365_PWR_OUT;
  18036. + exca_write_byte(slot, I365_POWER, power);
  18037. +
  18038. + control = 0;
  18039. + if (state->io_irq != 0)
  18040. + control |= socket->io_irq;
  18041. + if (state->flags & SS_IOCARD)
  18042. + control |= I365_PC_IOCARD;
  18043. + if (state->flags & SS_RESET)
  18044. + control &= ~I365_PC_RESET;
  18045. + else
  18046. + control |= I365_PC_RESET;
  18047. + exca_write_byte(slot, I365_INTCTL, control);
  18048. +
  18049. + cscint = 0;
  18050. + exca_write_byte(slot, I365_CSCINT, cscint);
  18051. + exca_read_byte(slot, I365_CSC); /* clear CardStatus change */
  18052. + if (state->csc_mask != 0)
  18053. + cscint |= socket->csc_irq << 8;
  18054. + if (state->flags & SS_IOCARD) {
  18055. + if (state->csc_mask & SS_STSCHG)
  18056. + cscint |= I365_CSC_STSCHG;
  18057. + } else {
  18058. + if (state->csc_mask & SS_BATDEAD)
  18059. + cscint |= I365_CSC_BVD1;
  18060. + if (state->csc_mask & SS_BATWARN)
  18061. + cscint |= I365_CSC_BVD2;
  18062. + }
  18063. + if (state->csc_mask & SS_READY)
  18064. + cscint |= I365_CSC_READY;
  18065. + if (state->csc_mask & SS_DETECT)
  18066. + cscint |= I365_CSC_DETECT;
  18067. + exca_write_byte(slot, I365_CSCINT, cscint);
  18068. +
  18069. + spin_unlock_irq(&socket->event_lock);
  18070. +
  18071. + return 0;
  18072. +}
  18073. +
  18074. +static int pccard_get_io_map(unsigned int slot, struct pccard_io_map *io)
  18075. +{
  18076. + vrc4171_socket_t *socket;
  18077. + uint8_t ioctl, addrwin;
  18078. + u_char map;
  18079. +
  18080. + if (slot >= CARD_MAX_SLOTS || io == NULL ||
  18081. + io->map >= IO_MAX_MAPS)
  18082. + return -EINVAL;
  18083. +
  18084. + socket = &vrc4171_sockets[slot];
  18085. + map = io->map;
  18086. +
  18087. + io->start = exca_read_word(slot, I365_IO(map)+I365_W_START);
  18088. + io->stop = exca_read_word(slot, I365_IO(map)+I365_W_STOP);
  18089. +
  18090. + ioctl = exca_read_byte(slot, I365_IOCTL);
  18091. + if (io->flags & I365_IOCTL_WAIT(map))
  18092. + io->speed = 1;
  18093. + else
  18094. + io->speed = 0;
  18095. +
  18096. + io->flags = 0;
  18097. + if (ioctl & I365_IOCTL_16BIT(map))
  18098. + io->flags |= MAP_16BIT;
  18099. + if (ioctl & I365_IOCTL_IOCS16(map))
  18100. + io->flags |= MAP_AUTOSZ;
  18101. + if (ioctl & I365_IOCTL_0WS(map))
  18102. + io->flags |= MAP_0WS;
  18103. +
  18104. + addrwin = exca_read_byte(slot, I365_ADDRWIN);
  18105. + if (addrwin & I365_ENA_IO(map))
  18106. + io->flags |= MAP_ACTIVE;
  18107. +
  18108. + return 0;
  18109. +}
  18110. +
  18111. +static int pccard_set_io_map(unsigned int slot, struct pccard_io_map *io)
  18112. +{
  18113. + vrc4171_socket_t *socket;
  18114. + uint8_t ioctl, addrwin;
  18115. + u_char map;
  18116. +
  18117. + if (slot >= CARD_MAX_SLOTS ||
  18118. + io == NULL || io->map >= IO_MAX_MAPS ||
  18119. + io->start > 0xffff || io->stop > 0xffff || io->start > io->stop)
  18120. + return -EINVAL;
  18121. +
  18122. + socket = &vrc4171_sockets[slot];
  18123. + map = io->map;
  18124. +
  18125. + addrwin = exca_read_byte(slot, I365_ADDRWIN);
  18126. + if (addrwin & I365_ENA_IO(map)) {
  18127. + addrwin &= ~I365_ENA_IO(map);
  18128. + exca_write_byte(slot, I365_ADDRWIN, addrwin);
  18129. + }
  18130. +
  18131. + exca_write_word(slot, I365_IO(map)+I365_W_START, io->start);
  18132. + exca_write_word(slot, I365_IO(map)+I365_W_STOP, io->stop);
  18133. +
  18134. + ioctl = 0;
  18135. + if (io->speed > 0)
  18136. + ioctl |= I365_IOCTL_WAIT(map);
  18137. + if (io->flags & MAP_16BIT)
  18138. + ioctl |= I365_IOCTL_16BIT(map);
  18139. + if (io->flags & MAP_AUTOSZ)
  18140. + ioctl |= I365_IOCTL_IOCS16(map);
  18141. + if (io->flags & MAP_0WS)
  18142. + ioctl |= I365_IOCTL_0WS(map);
  18143. + exca_write_byte(slot, I365_IOCTL, ioctl);
  18144. +
  18145. + if (io->flags & MAP_ACTIVE) {
  18146. + addrwin |= I365_ENA_IO(map);
  18147. + exca_write_byte(slot, I365_ADDRWIN, addrwin);
  18148. + }
  18149. +
  18150. + return 0;
  18151. +}
  18152. +
  18153. +static int pccard_get_mem_map(unsigned int slot, struct pccard_mem_map *mem)
  18154. +{
  18155. + vrc4171_socket_t *socket;
  18156. + uint8_t addrwin;
  18157. + u_long start, stop;
  18158. + u_int offset;
  18159. + u_char map;
  18160. +
  18161. + if (slot >= CARD_MAX_SLOTS || mem == NULL || mem->map >= MEM_MAX_MAPS)
  18162. + return -EINVAL;
  18163. +
  18164. + socket = &vrc4171_sockets[slot];
  18165. + map = mem->map;
  18166. +
  18167. + mem->flags = 0;
  18168. + mem->speed = 0;
  18169. +
  18170. + addrwin = exca_read_byte(slot, I365_ADDRWIN);
  18171. + if (addrwin & I365_ENA_MEM(map))
  18172. + mem->flags |= MAP_ACTIVE;
  18173. +
  18174. + start = exca_read_word(slot, I365_MEM(map)+I365_W_START);
  18175. + if (start & I365_MEM_16BIT)
  18176. + mem->flags |= MAP_16BIT;
  18177. + mem->sys_start = (start & 0x3fffUL) << 12;
  18178. +
  18179. + stop = exca_read_word(slot, I365_MEM(map)+I365_W_STOP);
  18180. + if (start & I365_MEM_WS0)
  18181. + mem->speed += 1;
  18182. + if (start & I365_MEM_WS1)
  18183. + mem->speed += 2;
  18184. + mem->sys_stop = ((stop & 0x3fffUL) << 12) + 0xfffUL;
  18185. +
  18186. + offset = exca_read_word(slot, I365_MEM(map)+I365_W_OFF);
  18187. + if (offset & I365_MEM_REG)
  18188. + mem->flags |= MAP_ATTRIB;
  18189. + if (offset & I365_MEM_WRPROT)
  18190. + mem->flags |= MAP_WRPROT;
  18191. + mem->card_start = (offset & 0x3fffUL) << 12;
  18192. +
  18193. + mem->sys_start += CARD_MEM_START;
  18194. + mem->sys_stop += CARD_MEM_START;
  18195. +
  18196. + return 0;
  18197. +}
  18198. +
  18199. +static int pccard_set_mem_map(unsigned int slot, struct pccard_mem_map *mem)
  18200. +{
  18201. + vrc4171_socket_t *socket;
  18202. + uint16_t start, stop, offset;
  18203. + uint8_t addrwin;
  18204. + u_char map;
  18205. +
  18206. + if (slot >= CARD_MAX_SLOTS ||
  18207. + mem == NULL || mem->map >= MEM_MAX_MAPS ||
  18208. + mem->sys_start < CARD_MEM_START || mem->sys_start > CARD_MEM_END ||
  18209. + mem->sys_stop < CARD_MEM_START || mem->sys_stop > CARD_MEM_END ||
  18210. + mem->sys_start > mem->sys_stop ||
  18211. + mem->card_start > CARD_MAX_MEM_OFFSET ||
  18212. + mem->speed > CARD_MAX_MEM_SPEED)
  18213. + return -EINVAL;
  18214. +
  18215. + socket = &vrc4171_sockets[slot];
  18216. + map = mem->map;
  18217. +
  18218. + addrwin = exca_read_byte(slot, I365_ADDRWIN);
  18219. + if (addrwin & I365_ENA_MEM(map)) {
  18220. + addrwin &= ~I365_ENA_MEM(map);
  18221. + exca_write_byte(slot, I365_ADDRWIN, addrwin);
  18222. + }
  18223. +
  18224. + start = (mem->sys_start >> 12) & 0x3fff;
  18225. + if (mem->flags & MAP_16BIT)
  18226. + start |= I365_MEM_16BIT;
  18227. + exca_write_word(slot, I365_MEM(map)+I365_W_START, start);
  18228. +
  18229. + stop = (mem->sys_stop >> 12) & 0x3fff;
  18230. + switch (mem->speed) {
  18231. + case 0:
  18232. + break;
  18233. + case 1:
  18234. + stop |= I365_MEM_WS0;
  18235. + break;
  18236. + case 2:
  18237. + stop |= I365_MEM_WS1;
  18238. + break;
  18239. + default:
  18240. + stop |= I365_MEM_WS0 | I365_MEM_WS1;
  18241. + break;
  18242. + }
  18243. + exca_write_word(slot, I365_MEM(map)+I365_W_STOP, stop);
  18244. +
  18245. + offset = (mem->card_start >> 12) & 0x3fff;
  18246. + if (mem->flags & MAP_ATTRIB)
  18247. + offset |= I365_MEM_REG;
  18248. + if (mem->flags & MAP_WRPROT)
  18249. + offset |= I365_MEM_WRPROT;
  18250. + exca_write_word(slot, I365_MEM(map)+I365_W_OFF, offset);
  18251. +
  18252. + if (mem->flags & MAP_ACTIVE) {
  18253. + addrwin |= I365_ENA_MEM(map);
  18254. + exca_write_byte(slot, I365_ADDRWIN, addrwin);
  18255. + }
  18256. +
  18257. + return 0;
  18258. +}
  18259. +
  18260. +static void pccard_proc_setup(unsigned int slot, struct proc_dir_entry *base)
  18261. +{
  18262. +}
  18263. +
  18264. +static struct pccard_operations vrc4171_pccard_operations = {
  18265. + .init = pccard_init,
  18266. + .suspend = pccard_suspend,
  18267. + .register_callback = pccard_register_callback,
  18268. + .inquire_socket = pccard_inquire_socket,
  18269. + .get_status = pccard_get_status,
  18270. + .get_socket = pccard_get_socket,
  18271. + .set_socket = pccard_set_socket,
  18272. + .get_io_map = pccard_get_io_map,
  18273. + .set_io_map = pccard_set_io_map,
  18274. + .get_mem_map = pccard_get_mem_map,
  18275. + .set_mem_map = pccard_set_mem_map,
  18276. + .proc_setup = pccard_proc_setup,
  18277. +};
  18278. +
  18279. +static void pccard_bh(void *data)
  18280. +{
  18281. + vrc4171_socket_t *socket = (vrc4171_socket_t *)data;
  18282. + uint16_t events;
  18283. +
  18284. + spin_lock_irq(&socket->event_lock);
  18285. + events = socket->events;
  18286. + socket->events = 0;
  18287. + spin_unlock_irq(&socket->event_lock);
  18288. +
  18289. + if (socket->handler)
  18290. + socket->handler(socket->info, events);
  18291. +}
  18292. +
  18293. +static inline uint16_t get_events(int slot)
  18294. +{
  18295. + uint16_t events = 0;
  18296. + uint8_t status, csc;
  18297. +
  18298. + status = exca_read_byte(slot, I365_STATUS);
  18299. + csc = exca_read_byte(slot, I365_CSC);
  18300. +
  18301. + if (exca_read_byte(slot, I365_INTCTL) & I365_PC_IOCARD) {
  18302. + if ((csc & I365_CSC_STSCHG) && (status & I365_CS_STSCHG))
  18303. + events |= SS_STSCHG;
  18304. + } else {
  18305. + if (csc & (I365_CSC_BVD1 | I365_CSC_BVD2)) {
  18306. + if (!(status & I365_CS_BVD1))
  18307. + events |= SS_BATDEAD;
  18308. + else if ((status & (I365_CS_BVD1 | I365_CS_BVD2)) == I365_CS_BVD1)
  18309. + events |= SS_BATWARN;
  18310. + }
  18311. + }
  18312. + if ((csc & I365_CSC_READY) && (status & I365_CS_READY))
  18313. + events |= SS_READY;
  18314. + if ((csc & I365_CSC_DETECT) && ((status & I365_CS_DETECT) == I365_CS_DETECT))
  18315. + events |= SS_DETECT;
  18316. +
  18317. + return events;
  18318. +}
  18319. +
  18320. +static void pccard_status_change(int slot, vrc4171_socket_t *socket)
  18321. +{
  18322. + uint16_t events;
  18323. +
  18324. + socket->tq_task.routine = pccard_bh;
  18325. + socket->tq_task.data = socket;
  18326. +
  18327. + events = get_events(slot);
  18328. + if (events) {
  18329. + spin_lock(&socket->event_lock);
  18330. + socket->events |= events;
  18331. + spin_unlock(&socket->event_lock);
  18332. + schedule_task(&socket->tq_task);
  18333. + }
  18334. +}
  18335. +
  18336. +static void pccard_interrupt(int irq, void *dev_id, struct pt_regs *regs)
  18337. +{
  18338. + vrc4171_socket_t *socket;
  18339. + uint16_t status;
  18340. +
  18341. + status = vrc4171_get_irq_status();
  18342. + if (status & IRQ_A) {
  18343. + socket = &vrc4171_sockets[CARD_SLOTA];
  18344. + if (socket->noprobe == SLOTB_PROBE) {
  18345. + if (status & (1 << socket->csc_irq))
  18346. + pccard_status_change(CARD_SLOTA, socket);
  18347. + }
  18348. + }
  18349. +
  18350. + if (status & IRQ_B) {
  18351. + socket = &vrc4171_sockets[CARD_SLOTB];
  18352. + if (socket->noprobe == SLOTB_PROBE) {
  18353. + if (status & (1 << socket->csc_irq))
  18354. + pccard_status_change(CARD_SLOTB, socket);
  18355. + }
  18356. + }
  18357. +}
  18358. +
  18359. +static inline void reserve_using_irq(int slot)
  18360. +{
  18361. + unsigned int irq;
  18362. +
  18363. + irq = exca_read_byte(slot, I365_INTCTL);
  18364. + irq &= 0x0f;
  18365. + vrc4171_irq_mask &= ~(1 << irq);
  18366. +
  18367. + irq = exca_read_byte(slot, I365_CSCINT);
  18368. + irq = (irq & 0xf0) >> 4;
  18369. + vrc4171_irq_mask &= ~(1 << irq);
  18370. +}
  18371. +
  18372. +static int __devinit vrc4171_add_socket(int slot)
  18373. +{
  18374. + vrc4171_socket_t *socket;
  18375. +
  18376. + if (slot >= CARD_MAX_SLOTS)
  18377. + return -EINVAL;
  18378. +
  18379. + socket = &vrc4171_sockets[slot];
  18380. + if (socket->noprobe != SLOTB_PROBE) {
  18381. + uint8_t addrwin;
  18382. +
  18383. + switch (socket->noprobe) {
  18384. + case SLOTB_NOPROBE_MEM:
  18385. + addrwin = exca_read_byte(slot, I365_ADDRWIN);
  18386. + addrwin &= 0x1f;
  18387. + exca_write_byte(slot, I365_ADDRWIN, addrwin);
  18388. + break;
  18389. + case SLOTB_NOPROBE_IO:
  18390. + addrwin = exca_read_byte(slot, I365_ADDRWIN);
  18391. + addrwin &= 0xc0;
  18392. + exca_write_byte(slot, I365_ADDRWIN, addrwin);
  18393. + break;
  18394. + default:
  18395. + break;
  18396. + }
  18397. +
  18398. + reserve_using_irq(slot);
  18399. +
  18400. + return 0;
  18401. + }
  18402. +
  18403. + sprintf(socket->name, "NEC VRC4171 Card Slot %1c", 'A' + slot);
  18404. +
  18405. + socket->pcmcia_socket = pcmcia_register_socket(slot, &vrc4171_pccard_operations, 1);
  18406. + if (socket->pcmcia_socket == NULL)
  18407. + return -ENOMEM;
  18408. +
  18409. + exca_write_byte(slot, I365_ADDRWIN, 0);
  18410. +
  18411. + exca_write_byte(slot, GLOBAL_CONTROL, 0);
  18412. +
  18413. + return 0;
  18414. +}
  18415. +
  18416. +static void vrc4171_remove_socket(int slot)
  18417. +{
  18418. + vrc4171_socket_t *socket;
  18419. +
  18420. + if (slot >= CARD_MAX_SLOTS)
  18421. + return;
  18422. +
  18423. + socket = &vrc4171_sockets[slot];
  18424. +
  18425. + if (socket->pcmcia_socket != NULL) {
  18426. + pcmcia_unregister_socket(socket->pcmcia_socket);
  18427. + socket->pcmcia_socket = NULL;
  18428. + }
  18429. +}
  18430. +
  18431. +static int __devinit vrc4171_card_setup(char *options)
  18432. +{
  18433. + if (options == NULL || *options == '\0')
  18434. + return 0;
  18435. +
  18436. + if (strncmp(options, "irq:", 4) == 0) {
  18437. + int irq;
  18438. + options += 4;
  18439. + irq = simple_strtoul(options, &options, 0);
  18440. + if (irq >= 0 && irq < NR_IRQS)
  18441. + vrc4171_irq = irq;
  18442. +
  18443. + if (*options != ',')
  18444. + return 0;
  18445. + options++;
  18446. + }
  18447. +
  18448. + if (strncmp(options, "slota:", 6) == 0) {
  18449. + options += 6;
  18450. + if (*options != '\0') {
  18451. + if (strncmp(options, "noprobe", 7) == 0) {
  18452. + vrc4171_sockets[CARD_SLOTA].noprobe = 1;
  18453. + options += 7;
  18454. + }
  18455. +
  18456. + if (*options != ',')
  18457. + return 0;
  18458. + options++;
  18459. + } else
  18460. + return 0;
  18461. +
  18462. + }
  18463. +
  18464. + if (strncmp(options, "slotb:", 6) == 0) {
  18465. + options += 6;
  18466. + if (*options != '\0') {
  18467. + if (strncmp(options, "pccard", 6) == 0) {
  18468. + vrc4171_slotb = SLOTB_IS_PCCARD;
  18469. + options += 6;
  18470. + } else if (strncmp(options, "cf", 2) == 0) {
  18471. + vrc4171_slotb = SLOTB_IS_CF;
  18472. + options += 2;
  18473. + } else if (strncmp(options, "flashrom", 8) == 0) {
  18474. + vrc4171_slotb = SLOTB_IS_FLASHROM;
  18475. + options += 8;
  18476. + } else if (strncmp(options, "none", 4) == 0) {
  18477. + vrc4171_slotb = SLOTB_IS_NONE;
  18478. + options += 4;
  18479. + }
  18480. +
  18481. + if (*options != ',')
  18482. + return 0;
  18483. + options++;
  18484. +
  18485. + if ( strncmp(options, "memnoprobe", 10) == 0)
  18486. + vrc4171_sockets[CARD_SLOTB].noprobe = SLOTB_NOPROBE_MEM;
  18487. + if ( strncmp(options, "ionoprobe", 9) == 0)
  18488. + vrc4171_sockets[CARD_SLOTB].noprobe = SLOTB_NOPROBE_IO;
  18489. + if ( strncmp(options, "noprobe", 7) == 0)
  18490. + vrc4171_sockets[CARD_SLOTB].noprobe = SLOTB_NOPROBE_ALL;
  18491. + }
  18492. + }
  18493. +
  18494. + return 0;
  18495. +}
  18496. +
  18497. +__setup("vrc4171_card=", vrc4171_card_setup);
  18498. +
  18499. +static int __devinit vrc4171_card_init(void)
  18500. +{
  18501. + int retval, slot;
  18502. +
  18503. + vrc4171_set_multifunction_pin(vrc4171_slotb);
  18504. +
  18505. + if (request_region(CARD_CONTROLLER_INDEX, CARD_CONTROLLER_SIZE,
  18506. + "NEC VRC4171 Card Controller") == NULL)
  18507. + return -EBUSY;
  18508. +
  18509. + for (slot = 0; slot < CARD_MAX_SLOTS; slot++) {
  18510. + if (slot == CARD_SLOTB && vrc4171_slotb == SLOTB_IS_NONE)
  18511. + break;
  18512. +
  18513. + retval = vrc4171_add_socket(slot);
  18514. + if (retval != 0)
  18515. + return retval;
  18516. + }
  18517. +
  18518. + retval = request_irq(vrc4171_irq, pccard_interrupt, SA_SHIRQ,
  18519. + "NEC VRC4171 Card Controller", vrc4171_sockets);
  18520. + if (retval < 0) {
  18521. + for (slot = 0; slot < CARD_MAX_SLOTS; slot++)
  18522. + vrc4171_remove_socket(slot);
  18523. +
  18524. + return retval;
  18525. + }
  18526. +
  18527. + printk(KERN_INFO "NEC VRC4171 Card Controller, connected to IRQ %d\n", vrc4171_irq);
  18528. +
  18529. + return 0;
  18530. +}
  18531. +
  18532. +static void __devexit vrc4171_card_exit(void)
  18533. +{
  18534. + int slot;
  18535. +
  18536. + for (slot = 0; slot < CARD_MAX_SLOTS; slot++)
  18537. + vrc4171_remove_socket(slot);
  18538. +
  18539. + release_region(CARD_CONTROLLER_INDEX, CARD_CONTROLLER_SIZE);
  18540. +}
  18541. +
  18542. +module_init(vrc4171_card_init);
  18543. +module_exit(vrc4171_card_exit);
  18544. --- a/drivers/scsi/NCR53C9x.h
  18545. +++ b/drivers/scsi/NCR53C9x.h
  18546. @@ -144,12 +144,7 @@
  18547. #ifndef MULTIPLE_PAD_SIZES
  18548. -#ifdef CONFIG_CPU_HAS_WB
  18549. -#include <asm/wbflush.h>
  18550. -#define esp_write(__reg, __val) do{(__reg) = (__val); wbflush();} while(0)
  18551. -#else
  18552. -#define esp_write(__reg, __val) ((__reg) = (__val))
  18553. -#endif
  18554. +#define esp_write(__reg, __val) do{(__reg) = (__val); iob();} while(0)
  18555. #define esp_read(__reg) (__reg)
  18556. struct ESP_regs {
  18557. --- a/drivers/sound/au1550_i2s.c
  18558. +++ b/drivers/sound/au1550_i2s.c
  18559. @@ -41,6 +41,7 @@
  18560. * 675 Mass Ave, Cambridge, MA 02139, USA.
  18561. *
  18562. */
  18563. +
  18564. #include <linux/version.h>
  18565. #include <linux/module.h>
  18566. #include <linux/string.h>
  18567. @@ -62,7 +63,45 @@
  18568. #include <asm/uaccess.h>
  18569. #include <asm/hardirq.h>
  18570. #include <asm/au1000.h>
  18571. +
  18572. +#if defined(CONFIG_SOC_AU1550)
  18573. #include <asm/pb1550.h>
  18574. +#endif
  18575. +
  18576. +#if defined(CONFIG_MIPS_PB1200)
  18577. +#define WM8731
  18578. +#define WM_MODE_USB
  18579. +#include <asm/pb1200.h>
  18580. +#endif
  18581. +
  18582. +#if defined(CONFIG_MIPS_FICMMP)
  18583. +#define WM8721
  18584. +#define WM_MODE_NORMAL
  18585. +#include <asm/ficmmp.h>
  18586. +#endif
  18587. +
  18588. +
  18589. +#define WM_VOLUME_MIN 47
  18590. +#define WM_VOLUME_SCALE 80
  18591. +
  18592. +#if defined(WM8731)
  18593. + /* OSS interface to the wm i2s.. */
  18594. + #define CODEC_NAME "Wolfson WM8731 I2S"
  18595. + #define WM_I2S_STEREO_MASK (SOUND_MASK_PCM | SOUND_MASK_LINE)
  18596. + #define WM_I2S_SUPPORTED_MASK (WM_I2S_STEREO_MASK | SOUND_MASK_MIC)
  18597. + #define WM_I2S_RECORD_MASK (SOUND_MASK_MIC | SOUND_MASK_LINE1 | SOUND_MASK_LINE)
  18598. +#elif defined(WM8721)
  18599. + #define CODEC_NAME "Wolfson WM8721 I2S"
  18600. + #define WM_I2S_STEREO_MASK (SOUND_MASK_PCM)
  18601. + #define WM_I2S_SUPPORTED_MASK (WM_I2S_STEREO_MASK)
  18602. + #define WM_I2S_RECORD_MASK (0)
  18603. +#endif
  18604. +
  18605. +
  18606. +#define supported_mixer(FOO) ((FOO >= 0) && \
  18607. + (FOO < SOUND_MIXER_NRDEVICES) && \
  18608. + WM_I2S_SUPPORTED_MASK & (1<<FOO) )
  18609. +
  18610. #include <asm/au1xxx_psc.h>
  18611. #include <asm/au1xxx_dbdma.h>
  18612. @@ -98,13 +137,51 @@
  18613. * 0 = no VRA, 1 = use VRA if codec supports it
  18614. * The framework is here, but we currently force no VRA.
  18615. */
  18616. +#if defined(CONFIG_MIPS_PB1200) | defined(CONFIG_MIPS_PB1550)
  18617. static int vra = 0;
  18618. +#elif defined(CONFIG_MIPS_FICMMP)
  18619. +static int vra = 1;
  18620. +#endif
  18621. +
  18622. +#define WM_REG_L_HEADPHONE_OUT 0x02
  18623. +#define WM_REG_R_HEADPHONE_OUT 0x03
  18624. +#define WM_REG_ANALOGUE_AUDIO_PATH_CTRL 0x04
  18625. +#define WM_REG_DIGITAL_AUDIO_PATH_CTRL 0x05
  18626. +#define WM_REG_POWER_DOWN_CTRL 0x06
  18627. +#define WM_REG_DIGITAL_AUDIO_IF 0x07
  18628. +#define WM_REG_SAMPLING_CONTROL 0x08
  18629. +#define WM_REG_ACTIVE_CTRL 0x09
  18630. +#define WM_REG_RESET 0x0F
  18631. +#define WM_SC_SR_96000 (0x7<<2)
  18632. +#define WM_SC_SR_88200 (0xF<<2)
  18633. +#define WM_SC_SR_48000 (0x0<<2)
  18634. +#define WM_SC_SR_44100 (0x8<<2)
  18635. +#define WM_SC_SR_32000 (0x6<<2)
  18636. +#define WM_SC_SR_8018 (0x9<<2)
  18637. +#define WM_SC_SR_8000 (0x1<<2)
  18638. +#define WM_SC_MODE_USB 1
  18639. +#define WM_SC_MODE_NORMAL 0
  18640. +#define WM_SC_BOSR_250FS (0<<1)
  18641. +#define WM_SC_BOSR_272FS (1<<1)
  18642. +#define WM_SC_BOSR_256FS (0<<1)
  18643. +#define WM_SC_BOSR_128FS (0<<1)
  18644. +#define WM_SC_BOSR_384FS (1<<1)
  18645. +#define WM_SC_BOSR_192FS (1<<1)
  18646. +
  18647. +#define WS_64FS 31
  18648. +#define WS_96FS 47
  18649. +#define WS_128FS 63
  18650. +#define WS_192FS 95
  18651. +
  18652. +#define MIN_Q_COUNT 2
  18653. +
  18654. MODULE_PARM(vra, "i");
  18655. MODULE_PARM_DESC(vra, "if 1 use VRA if codec supports it");
  18656. static struct au1550_state {
  18657. /* soundcore stuff */
  18658. int dev_audio;
  18659. + int dev_mixer;
  18660. spinlock_t lock;
  18661. struct semaphore open_sem;
  18662. @@ -114,6 +191,11 @@ static struct au1550_state {
  18663. int no_vra;
  18664. volatile psc_i2s_t *psc_addr;
  18665. + int level_line;
  18666. + int level_mic;
  18667. + int level_left;
  18668. + int level_right;
  18669. +
  18670. struct dmabuf {
  18671. u32 dmanr;
  18672. unsigned sample_rate;
  18673. @@ -195,60 +277,224 @@ au1550_delay(int msec)
  18674. }
  18675. }
  18676. -/* Just a place holder. The Wolfson codec is a write only device,
  18677. - * so we would have to keep a local copy of the data.
  18678. - */
  18679. -#if 0
  18680. -static u8
  18681. -rdcodec(u8 addr)
  18682. -{
  18683. - return 0 /* data */;
  18684. -}
  18685. -#endif
  18686. -
  18687. -
  18688. static void
  18689. -wrcodec(u8 ctlreg, u8 val)
  18690. +wrcodec(u8 ctlreg, u16 val)
  18691. {
  18692. int rcnt;
  18693. extern int pb1550_wm_codec_write(u8 addr, u8 reg, u8 val);
  18694. -
  18695. /* The codec is a write only device, with a 16-bit control/data
  18696. * word. Although it is written as two bytes on the I2C, the
  18697. * format is actually 7 bits of register and 9 bits of data.
  18698. * The ls bit of the first byte is the ms bit of the data.
  18699. */
  18700. rcnt = 0;
  18701. - while ((pb1550_wm_codec_write((0x36 >> 1), ctlreg, val) != 1)
  18702. - && (rcnt < 50)) {
  18703. + while ((pb1550_wm_codec_write((0x36 >> 1),
  18704. + (ctlreg << 1) | ((val >> 8) & 0x01),
  18705. + (u8) (val & 0x00FF)) != 1) &&
  18706. + (rcnt < 50)) {
  18707. rcnt++;
  18708. -#if 0
  18709. - printk("Codec write retry %02x %02x\n", ctlreg, val);
  18710. -#endif
  18711. }
  18712. +
  18713. + au1550_delay(10);
  18714. +}
  18715. +
  18716. +static int
  18717. +au1550_open_mixdev(struct inode *inode, struct file *file)
  18718. +{
  18719. + file->private_data = &au1550_state;
  18720. + return 0;
  18721. +}
  18722. +
  18723. +static int
  18724. +au1550_release_mixdev(struct inode *inode, struct file *file)
  18725. +{
  18726. + return 0;
  18727. +}
  18728. +
  18729. +static int wm_i2s_read_mixer(struct au1550_state *s, int oss_channel)
  18730. +{
  18731. + int ret = 0;
  18732. +
  18733. + if (WM_I2S_STEREO_MASK & (1 << oss_channel)) {
  18734. + /* nice stereo mixers .. */
  18735. +
  18736. + ret = s->level_left | (s->level_right << 8);
  18737. + } else if (oss_channel == SOUND_MIXER_MIC) {
  18738. + ret = 0;
  18739. + /* TODO: Implement read mixer for input/output codecs */
  18740. + }
  18741. +
  18742. + return ret;
  18743. }
  18744. +static void wm_i2s_write_mixer(struct au1550_state *s, int oss_channel, unsigned int left, unsigned int right)
  18745. +{
  18746. + if (WM_I2S_STEREO_MASK & (1 << oss_channel)) {
  18747. + /* stereo mixers */
  18748. + s->level_left = left;
  18749. + s->level_right = right;
  18750. +
  18751. + right = (right * WM_VOLUME_SCALE) / 100;
  18752. + left = (left * WM_VOLUME_SCALE) / 100;
  18753. + if (right > WM_VOLUME_SCALE)
  18754. + right = WM_VOLUME_SCALE;
  18755. + if (left > WM_VOLUME_SCALE)
  18756. + left = WM_VOLUME_SCALE;
  18757. +
  18758. + right += WM_VOLUME_MIN;
  18759. + left += WM_VOLUME_MIN;
  18760. +
  18761. + wrcodec(WM_REG_L_HEADPHONE_OUT, left);
  18762. + wrcodec(WM_REG_R_HEADPHONE_OUT, right);
  18763. +
  18764. + }else if (oss_channel == SOUND_MIXER_MIC) {
  18765. + /* TODO: implement write mixer for input/output codecs */
  18766. + }
  18767. +}
  18768. +
  18769. +/* a thin wrapper for write_mixer */
  18770. +static void wm_i2s_set_mixer(struct au1550_state *s, unsigned int oss_mixer, unsigned int val )
  18771. +{
  18772. + unsigned int left,right;
  18773. +
  18774. + /* cleanse input a little */
  18775. + right = ((val >> 8) & 0xff) ;
  18776. + left = (val & 0xff) ;
  18777. +
  18778. + if (right > 100) right = 100;
  18779. + if (left > 100) left = 100;
  18780. +
  18781. + wm_i2s_write_mixer(s, oss_mixer, left, right);
  18782. +}
  18783. +
  18784. +static int
  18785. +au1550_ioctl_mixdev(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
  18786. +{
  18787. + struct au1550_state *s = (struct au1550_state *)file->private_data;
  18788. +
  18789. + int i, val = 0;
  18790. +
  18791. + if (cmd == SOUND_MIXER_INFO) {
  18792. + mixer_info info;
  18793. + strncpy(info.id, CODEC_NAME, sizeof(info.id));
  18794. + strncpy(info.name, CODEC_NAME, sizeof(info.name));
  18795. + info.modify_counter = 0;
  18796. + if (copy_to_user((void *)arg, &info, sizeof(info)))
  18797. + return -EFAULT;
  18798. + return 0;
  18799. + }
  18800. + if (cmd == SOUND_OLD_MIXER_INFO) {
  18801. + _old_mixer_info info;
  18802. + strncpy(info.id, CODEC_NAME, sizeof(info.id));
  18803. + strncpy(info.name, CODEC_NAME, sizeof(info.name));
  18804. + if (copy_to_user((void *)arg, &info, sizeof(info)))
  18805. + return -EFAULT;
  18806. + return 0;
  18807. + }
  18808. +
  18809. + if (_IOC_TYPE(cmd) != 'M' || _SIOC_SIZE(cmd) != sizeof(int))
  18810. + return -EINVAL;
  18811. +
  18812. + if (cmd == OSS_GETVERSION)
  18813. + return put_user(SOUND_VERSION, (int *)arg);
  18814. +
  18815. + if (_SIOC_DIR(cmd) == _SIOC_READ) {
  18816. + switch (_IOC_NR(cmd)) {
  18817. + case SOUND_MIXER_RECSRC: /* give them the current record src */
  18818. + val = 0;
  18819. + /*
  18820. + if (!codec->recmask_io) {
  18821. + val = 0;
  18822. + } else {
  18823. + val = codec->recmask_io(codec, 1, 0);
  18824. + }*/
  18825. + break;
  18826. +
  18827. + case SOUND_MIXER_DEVMASK: /* give them the supported mixers */
  18828. + val = WM_I2S_SUPPORTED_MASK;
  18829. + break;
  18830. +
  18831. + case SOUND_MIXER_RECMASK:
  18832. + /* Arg contains a bit for each supported recording
  18833. + * source */
  18834. + val = WM_I2S_RECORD_MASK;
  18835. + break;
  18836. +
  18837. + case SOUND_MIXER_STEREODEVS:
  18838. + /* Mixer channels supporting stereo */
  18839. + val = WM_I2S_STEREO_MASK;
  18840. + break;
  18841. +
  18842. + case SOUND_MIXER_CAPS:
  18843. + val = SOUND_CAP_EXCL_INPUT;
  18844. + break;
  18845. +
  18846. + default: /* read a specific mixer */
  18847. + i = _IOC_NR(cmd);
  18848. +
  18849. + if (!supported_mixer(i))
  18850. + return -EINVAL;
  18851. +
  18852. + val = wm_i2s_read_mixer(s, i);
  18853. + break;
  18854. + }
  18855. + return put_user(val, (int *)arg);
  18856. + }
  18857. +
  18858. + if (_SIOC_DIR(cmd) == (_SIOC_WRITE|_SIOC_READ)) {
  18859. + if (get_user(val, (int *)arg))
  18860. + return -EFAULT;
  18861. +
  18862. + switch (_IOC_NR(cmd)) {
  18863. + case SOUND_MIXER_RECSRC:
  18864. + /* Arg contains a bit for each recording source */
  18865. + if (!WM_I2S_RECORD_MASK)
  18866. + return -EINVAL;
  18867. + if (!val)
  18868. + return 0;
  18869. + if (!(val &= WM_I2S_RECORD_MASK))
  18870. + return -EINVAL;
  18871. +
  18872. + return 0;
  18873. + default: /* write a specific mixer */
  18874. + i = _IOC_NR(cmd);
  18875. +
  18876. + if (!supported_mixer(i))
  18877. + return -EINVAL;
  18878. +
  18879. + wm_i2s_set_mixer(s, i, val);
  18880. +
  18881. + return 0;
  18882. + }
  18883. +}
  18884. + return -EINVAL;
  18885. +}
  18886. +
  18887. +static loff_t
  18888. +au1550_llseek(struct file *file, loff_t offset, int origin)
  18889. +{
  18890. + return -ESPIPE;
  18891. +}
  18892. +
  18893. +static /*const */ struct file_operations au1550_mixer_fops = {
  18894. + owner:THIS_MODULE,
  18895. + llseek:au1550_llseek,
  18896. + ioctl:au1550_ioctl_mixdev,
  18897. + open:au1550_open_mixdev,
  18898. + release:au1550_release_mixdev,
  18899. +};
  18900. +
  18901. void
  18902. -codec_init(void)
  18903. +codec_init(struct au1550_state *s)
  18904. {
  18905. - wrcodec(0x1e, 0x00); /* Reset */
  18906. - au1550_delay(200);
  18907. - wrcodec(0x0c, 0x00); /* Power up everything */
  18908. - au1550_delay(10);
  18909. - wrcodec(0x12, 0x00); /* Deactivate codec */
  18910. - au1550_delay(10);
  18911. - wrcodec(0x08, 0x10); /* Select DAC outputs to line out */
  18912. - au1550_delay(10);
  18913. - wrcodec(0x0a, 0x00); /* Disable output mute */
  18914. - au1550_delay(10);
  18915. - wrcodec(0x05, 0x70); /* lower output volume on headphone */
  18916. - au1550_delay(10);
  18917. - wrcodec(0x0e, 0x02); /* Set slave, 16-bit, I2S modes */
  18918. - au1550_delay(10);
  18919. - wrcodec(0x10, 0x01); /* 12MHz (USB), 250fs */
  18920. - au1550_delay(10);
  18921. - wrcodec(0x12, 0x01); /* Activate codec */
  18922. - au1550_delay(10);
  18923. + wrcodec(WM_REG_RESET, 0x00); /* Reset */
  18924. + wrcodec(WM_REG_POWER_DOWN_CTRL, 0x00); /* Power up everything */
  18925. + wrcodec(WM_REG_ACTIVE_CTRL, 0x00); /* Deactivate codec */
  18926. + wrcodec(WM_REG_ANALOGUE_AUDIO_PATH_CTRL, 0x10); /* Select DAC outputs to line out */
  18927. + wrcodec(WM_REG_DIGITAL_AUDIO_PATH_CTRL, 0x00); /* Disable output mute */
  18928. + wm_i2s_write_mixer(s, SOUND_MIXER_PCM, 74, 74);
  18929. + wrcodec(WM_REG_DIGITAL_AUDIO_IF, 0x02); /* Set slave, 16-bit, I2S modes */
  18930. + wrcodec(WM_REG_ACTIVE_CTRL, 0x01); /* Activate codec */
  18931. }
  18932. /* stop the ADC before calling */
  18933. @@ -256,27 +502,16 @@ static void
  18934. set_adc_rate(struct au1550_state *s, unsigned rate)
  18935. {
  18936. struct dmabuf *adc = &s->dma_adc;
  18937. - struct dmabuf *dac = &s->dma_dac;
  18938. - if (s->no_vra) {
  18939. - /* calc SRC factor
  18940. - */
  18941. + #if defined(WM_MODE_USB)
  18942. adc->src_factor = (((SAMP_RATE*2) / rate) + 1) >> 1;
  18943. adc->sample_rate = SAMP_RATE / adc->src_factor;
  18944. return;
  18945. - }
  18946. + #else
  18947. + //TODO: Need code for normal mode
  18948. + #endif
  18949. adc->src_factor = 1;
  18950. -
  18951. -
  18952. -#if 0
  18953. - rate = rate > SAMP_RATE ? SAMP_RATE : rate;
  18954. -
  18955. - wrcodec(0, 0); /* I don't yet know what to write here if we vra */
  18956. -
  18957. - adc->sample_rate = rate;
  18958. - dac->sample_rate = rate;
  18959. -#endif
  18960. }
  18961. /* stop the DAC before calling */
  18962. @@ -284,26 +519,89 @@ static void
  18963. set_dac_rate(struct au1550_state *s, unsigned rate)
  18964. {
  18965. struct dmabuf *dac = &s->dma_dac;
  18966. - struct dmabuf *adc = &s->dma_adc;
  18967. - if (s->no_vra) {
  18968. - /* calc SRC factor
  18969. - */
  18970. - dac->src_factor = (((SAMP_RATE*2) / rate) + 1) >> 1;
  18971. - dac->sample_rate = SAMP_RATE / dac->src_factor;
  18972. - return;
  18973. + u16 sr, ws, div, bosr, mode;
  18974. + volatile psc_i2s_t* ip = (volatile psc_i2s_t *)I2S_PSC_BASE;
  18975. + u32 cfg;
  18976. +
  18977. + #if defined(CONFIG_MIPS_FICMMP)
  18978. + rate = ficmmp_set_i2s_sample_rate(rate);
  18979. + #endif
  18980. +
  18981. + switch(rate)
  18982. + {
  18983. + case 96000:
  18984. + sr = WM_SC_SR_96000;
  18985. + ws = WS_64FS;
  18986. + div = PSC_I2SCFG_DIV2;
  18987. + break;
  18988. + case 88200:
  18989. + sr = WM_SC_SR_88200;
  18990. + ws = WS_64FS;
  18991. + div = PSC_I2SCFG_DIV2;
  18992. + break;
  18993. + case 44100:
  18994. + sr = WM_SC_SR_44100;
  18995. + ws = WS_128FS;
  18996. + div = PSC_I2SCFG_DIV2;
  18997. + break;
  18998. + case 48000:
  18999. + sr = WM_SC_SR_48000;
  19000. + ws = WS_128FS;
  19001. + div = PSC_I2SCFG_DIV2;
  19002. + break;
  19003. + case 32000:
  19004. + sr = WM_SC_SR_32000;
  19005. + ws = WS_96FS;
  19006. + div = PSC_I2SCFG_DIV4;
  19007. + break;
  19008. + case 8018:
  19009. + sr = WM_SC_SR_8018;
  19010. + ws = WS_128FS;
  19011. + div = PSC_I2SCFG_DIV2;
  19012. + break;
  19013. + case 8000:
  19014. + default:
  19015. + sr = WM_SC_SR_8000;
  19016. + ws = WS_96FS;
  19017. + div = PSC_I2SCFG_DIV16;
  19018. + break;
  19019. }
  19020. + #if defined(WM_MODE_USB)
  19021. + mode = WM_SC_MODE_USB;
  19022. + #else
  19023. + mode = WM_SC_MODE_NORMAL;
  19024. + #endif
  19025. +
  19026. + bosr = 0;
  19027. +
  19028. dac->src_factor = 1;
  19029. + dac->sample_rate = rate;
  19030. -#if 0
  19031. - rate = rate > SAMP_RATE ? SAMP_RATE : rate;
  19032. + /* Deactivate codec */
  19033. + wrcodec(WM_REG_ACTIVE_CTRL, 0x00);
  19034. - wrcodec(0, 0); /* I don't yet know what to write here if we vra */
  19035. + /* Disable I2S controller */
  19036. + ip->psc_i2scfg &= ~PSC_I2SCFG_DE_ENABLE;
  19037. + /* Wait for device disabled */
  19038. + while ((ip->psc_i2sstat & PSC_I2SSTAT_DR) == 1);
  19039. +
  19040. + cfg = ip->psc_i2scfg;
  19041. + /* Clear WS and DIVIDER values */
  19042. + cfg &= ~(PSC_I2SCFG_WS_MASK | PSC_I2SCFG_DIV_MASK);
  19043. + cfg |= PSC_I2SCFG_WS(ws) | div;
  19044. + /* Reconfigure and enable */
  19045. + ip->psc_i2scfg = cfg | PSC_I2SCFG_DE_ENABLE;
  19046. - adc->sample_rate = rate;
  19047. - dac->sample_rate = rate;
  19048. -#endif
  19049. + /* Wait for device enabled */
  19050. + while ((ip->psc_i2sstat & PSC_I2SSTAT_DR) == 0);
  19051. +
  19052. + /* Set appropriate sampling rate */
  19053. + wrcodec(WM_REG_SAMPLING_CONTROL, bosr | mode | sr);
  19054. +
  19055. + /* Activate codec */
  19056. + wrcodec(WM_REG_ACTIVE_CTRL, 0x01);
  19057. }
  19058. static void
  19059. @@ -354,8 +652,7 @@ stop_adc(struct au1550_state *s)
  19060. ip->psc_i2spcr = PSC_I2SPCR_RP;
  19061. au_sync();
  19062. - /* Wait for Receive Busy to show disabled.
  19063. - */
  19064. + /* Wait for Receive Busy to show disabled. */
  19065. do {
  19066. stat = ip->psc_i2sstat;
  19067. au_sync();
  19068. @@ -463,7 +760,6 @@ prog_dmabuf(struct au1550_state *s, stru
  19069. if (db->num_channels == 1)
  19070. db->cnt_factor *= 2;
  19071. db->cnt_factor *= db->src_factor;
  19072. -
  19073. db->count = 0;
  19074. db->dma_qcount = 0;
  19075. db->nextIn = db->nextOut = db->rawbuf;
  19076. @@ -546,12 +842,13 @@ dac_dma_interrupt(int irq, void *dev_id,
  19077. if (i2s_stat & (PSC_I2SSTAT_TF | PSC_I2SSTAT_TR | PSC_I2SSTAT_TF))
  19078. dbg("I2S status = 0x%08x", i2s_stat);
  19079. #endif
  19080. +
  19081. db->dma_qcount--;
  19082. if (db->count >= db->fragsize) {
  19083. - if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut,
  19084. - db->fragsize) == 0) {
  19085. - err("qcount < 2 and no ring room!");
  19086. + if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut, db->fragsize) == 0)
  19087. + {
  19088. + err("qcount < MIN_Q_COUNT and no ring room!");
  19089. }
  19090. db->nextOut += db->fragsize;
  19091. if (db->nextOut >= db->rawbuf + db->dmasize)
  19092. @@ -606,65 +903,43 @@ adc_dma_interrupt(int irq, void *dev_id,
  19093. }
  19094. -static loff_t
  19095. -au1550_llseek(struct file *file, loff_t offset, int origin)
  19096. -{
  19097. - return -ESPIPE;
  19098. -}
  19099. -
  19100. -
  19101. -#if 0
  19102. -static int
  19103. -au1550_open_mixdev(struct inode *inode, struct file *file)
  19104. -{
  19105. - file->private_data = &au1550_state;
  19106. - return 0;
  19107. -}
  19108. -
  19109. -static int
  19110. -au1550_release_mixdev(struct inode *inode, struct file *file)
  19111. -{
  19112. - return 0;
  19113. -}
  19114. -
  19115. -static int
  19116. -mixdev_ioctl(struct ac97_codec *codec, unsigned int cmd,
  19117. - unsigned long arg)
  19118. -{
  19119. - return codec->mixer_ioctl(codec, cmd, arg);
  19120. -}
  19121. -
  19122. -static int
  19123. -au1550_ioctl_mixdev(struct inode *inode, struct file *file,
  19124. - unsigned int cmd, unsigned long arg)
  19125. -{
  19126. - struct au1550_state *s = (struct au1550_state *)file->private_data;
  19127. - struct ac97_codec *codec = s->codec;
  19128. -
  19129. - return mixdev_ioctl(codec, cmd, arg);
  19130. -}
  19131. -
  19132. -static /*const */ struct file_operations au1550_mixer_fops = {
  19133. - owner:THIS_MODULE,
  19134. - llseek:au1550_llseek,
  19135. - ioctl:au1550_ioctl_mixdev,
  19136. - open:au1550_open_mixdev,
  19137. - release:au1550_release_mixdev,
  19138. -};
  19139. -#endif
  19140. -
  19141. static int
  19142. drain_dac(struct au1550_state *s, int nonblock)
  19143. {
  19144. unsigned long flags;
  19145. int count, tmo;
  19146. + struct dmabuf *db = &s->dma_dac;
  19147. +
  19148. + //DPRINTF();
  19149. if (s->dma_dac.mapped || !s->dma_dac.ready || s->dma_dac.stopped)
  19150. return 0;
  19151. for (;;) {
  19152. spin_lock_irqsave(&s->lock, flags);
  19153. - count = s->dma_dac.count;
  19154. + count = db->count;
  19155. +
  19156. + /* Pad the ddma buffer with zeros if the amount remaining
  19157. + * is not a multiple of fragsize */
  19158. + if(count % db->fragsize != 0)
  19159. + {
  19160. + int pad = db->fragsize - (count % db->fragsize);
  19161. + char* bufptr = db->nextIn;
  19162. + char* bufend = db->rawbuf + db->dmasize;
  19163. +
  19164. + if((bufend - bufptr) < pad)
  19165. + printk("Error! ddma padding is bigger than available ring space!\n");
  19166. + else
  19167. + {
  19168. + memset((void*)bufptr, 0, pad);
  19169. + count += pad;
  19170. + db->nextIn += pad;
  19171. + db->count += pad;
  19172. + if (db->dma_qcount == 0)
  19173. + start_dac(s);
  19174. + db->dma_qcount++;
  19175. + }
  19176. + }
  19177. spin_unlock_irqrestore(&s->lock, flags);
  19178. if (count <= 0)
  19179. break;
  19180. @@ -672,9 +947,9 @@ drain_dac(struct au1550_state *s, int no
  19181. break;
  19182. if (nonblock)
  19183. return -EBUSY;
  19184. - tmo = 1000 * count / (s->no_vra ?
  19185. - SAMP_RATE : s->dma_dac.sample_rate);
  19186. + tmo = 1000 * count / s->dma_dac.sample_rate;
  19187. tmo /= s->dma_dac.dma_bytes_per_sample;
  19188. +
  19189. au1550_delay(tmo);
  19190. }
  19191. if (signal_pending(current))
  19192. @@ -698,8 +973,7 @@ static inline s16 U8_TO_S16(u8 ch)
  19193. * If interpolating (no VRA), duplicate every audio frame src_factor times.
  19194. */
  19195. static int
  19196. -translate_from_user(struct dmabuf *db, char* dmabuf, char* userbuf,
  19197. - int dmacount)
  19198. +translate_from_user(struct dmabuf *db, char* dmabuf, char* userbuf, int dmacount)
  19199. {
  19200. int sample, i;
  19201. int interp_bytes_per_sample;
  19202. @@ -737,11 +1011,12 @@ translate_from_user(struct dmabuf *db, c
  19203. /* duplicate every audio frame src_factor times
  19204. */
  19205. - for (i = 0; i < db->src_factor; i++)
  19206. + for (i = 0; i < db->src_factor; i++) {
  19207. memcpy(dmabuf, dmasample, db->dma_bytes_per_sample);
  19208. + dmabuf += interp_bytes_per_sample;
  19209. + }
  19210. userbuf += db->user_bytes_per_sample;
  19211. - dmabuf += interp_bytes_per_sample;
  19212. }
  19213. return num_samples * interp_bytes_per_sample;
  19214. @@ -996,15 +1271,14 @@ au1550_write(struct file *file, const ch
  19215. * on the dma queue. If the queue count reaches zero,
  19216. * we know the dma has stopped.
  19217. */
  19218. - while ((db->dma_qcount < 2) && (db->count >= db->fragsize)) {
  19219. + while ((db->dma_qcount < MIN_Q_COUNT) && (db->count >= db->fragsize)) {
  19220. if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut,
  19221. db->fragsize) == 0) {
  19222. - err("qcount < 2 and no ring room!");
  19223. + err("qcount < MIN_Q_COUNT and no ring room!");
  19224. }
  19225. db->nextOut += db->fragsize;
  19226. if (db->nextOut >= db->rawbuf + db->dmasize)
  19227. db->nextOut -= db->dmasize;
  19228. - db->count -= db->fragsize;
  19229. db->total_bytes += db->dma_fragsize;
  19230. if (db->dma_qcount == 0)
  19231. start_dac(s);
  19232. @@ -1017,7 +1291,6 @@ au1550_write(struct file *file, const ch
  19233. buffer += usercnt;
  19234. ret += usercnt;
  19235. } /* while (count > 0) */
  19236. -
  19237. out:
  19238. up(&s->sem);
  19239. out2:
  19240. @@ -1371,9 +1644,6 @@ au1550_ioctl(struct inode *inode, struct
  19241. s->dma_dac.cnt_factor;
  19242. abinfo.fragstotal = s->dma_dac.numfrag;
  19243. abinfo.fragments = abinfo.bytes >> s->dma_dac.fragshift;
  19244. -#ifdef AU1000_VERBOSE_DEBUG
  19245. - dbg("bytes=%d, fragments=%d", abinfo.bytes, abinfo.fragments);
  19246. -#endif
  19247. return copy_to_user((void *) arg, &abinfo,
  19248. sizeof(abinfo)) ? -EFAULT : 0;
  19249. @@ -1536,13 +1806,9 @@ au1550_ioctl(struct inode *inode, struct
  19250. case SNDCTL_DSP_SETSYNCRO:
  19251. case SOUND_PCM_READ_FILTER:
  19252. return -EINVAL;
  19253. + default: break;
  19254. }
  19255. -
  19256. -#if 0
  19257. - return mixdev_ioctl(s->codec, cmd, arg);
  19258. -#else
  19259. return 0;
  19260. -#endif
  19261. }
  19262. @@ -1664,15 +1930,15 @@ static /*const */ struct file_operations
  19263. MODULE_AUTHOR("Advanced Micro Devices (AMD), [email protected]");
  19264. MODULE_DESCRIPTION("Au1550 Audio Driver");
  19265. +#if defined(WM_MODE_USB)
  19266. /* Set up an internal clock for the PSC3. This will then get
  19267. * driven out of the Au1550 as the master.
  19268. */
  19269. static void
  19270. intclk_setup(void)
  19271. {
  19272. - uint clk, rate, stat;
  19273. -
  19274. - /* Wire up Freq4 as a clock for the PSC3.
  19275. + uint clk, rate;
  19276. + /* Wire up Freq4 as a clock for the PSC.
  19277. * We know SMBus uses Freq3.
  19278. * By making changes to this rate, plus the word strobe
  19279. * size, we can make fine adjustments to the actual data rate.
  19280. @@ -1700,11 +1966,17 @@ intclk_setup(void)
  19281. */
  19282. clk = au_readl(SYS_CLKSRC);
  19283. au_sync();
  19284. +#if defined(CONFIG_SOC_AU1550)
  19285. clk &= ~0x01f00000;
  19286. clk |= (6 << 22);
  19287. +#elif defined(CONFIG_SOC_AU1200)
  19288. + clk &= ~0x3e000000;
  19289. + clk |= (6 << 27);
  19290. +#endif
  19291. au_writel(clk, SYS_CLKSRC);
  19292. au_sync();
  19293. }
  19294. +#endif
  19295. static int __devinit
  19296. au1550_probe(void)
  19297. @@ -1724,6 +1996,11 @@ au1550_probe(void)
  19298. init_MUTEX(&s->open_sem);
  19299. spin_lock_init(&s->lock);
  19300. + /* CPLD Mux for I2s */
  19301. +
  19302. +#if defined(CONFIG_MIPS_PB1200)
  19303. + bcsr->resets |= BCSR_RESETS_PCS1MUX;
  19304. +#endif
  19305. s->psc_addr = (volatile psc_i2s_t *)I2S_PSC_BASE;
  19306. ip = s->psc_addr;
  19307. @@ -1765,9 +2042,8 @@ au1550_probe(void)
  19308. if ((s->dev_audio = register_sound_dsp(&au1550_audio_fops, -1)) < 0)
  19309. goto err_dev1;
  19310. -#if 0
  19311. - if ((s->codec->dev_mixer =
  19312. - register_sound_mixer(&au1550_mixer_fops, -1)) < 0)
  19313. +#if 1
  19314. + if ((s->dev_mixer = register_sound_mixer(&au1550_mixer_fops, -1)) < 0)
  19315. goto err_dev2;
  19316. #endif
  19317. @@ -1777,7 +2053,6 @@ au1550_probe(void)
  19318. proc_au1550_dump, NULL);
  19319. #endif /* AU1550_DEBUG */
  19320. - intclk_setup();
  19321. /* The GPIO for the appropriate PSC was configured by the
  19322. * board specific start up.
  19323. @@ -1786,7 +2061,12 @@ au1550_probe(void)
  19324. */
  19325. ip->psc_ctrl = PSC_CTRL_DISABLE; /* Disable PSC */
  19326. au_sync();
  19327. +#if defined(WM_MODE_USB)
  19328. + intclk_setup();
  19329. ip->psc_sel = (PSC_SEL_CLK_INTCLK | PSC_SEL_PS_I2SMODE);
  19330. +#else
  19331. + ip->psc_sel = (PSC_SEL_CLK_EXTCLK | PSC_SEL_PS_I2SMODE);
  19332. +#endif
  19333. au_sync();
  19334. /* Enable PSC
  19335. @@ -1806,42 +2086,18 @@ au1550_probe(void)
  19336. * Actual I2S mode (first bit delayed by one clock).
  19337. * Master mode (We provide the clock from the PSC).
  19338. */
  19339. - val = PSC_I2SCFG_SET_LEN(16);
  19340. -#ifdef TRY_441KHz
  19341. - /* This really should be 250, but it appears that all of the
  19342. - * PLLs, dividers and so on in the chain shift it. That's the
  19343. - * problem with sourceing the clock instead of letting the very
  19344. - * stable codec provide it. But, the PSC doesn't appear to want
  19345. - * to work in slave mode, so this is what we get. It's not
  19346. - * studio quality timing, but it's good enough for listening
  19347. - * to mp3s.
  19348. - */
  19349. - val |= PSC_I2SCFG_SET_WS(252);
  19350. -#else
  19351. - val |= PSC_I2SCFG_SET_WS(250);
  19352. -#endif
  19353. - val |= PSC_I2SCFG_RT_FIFO8 | PSC_I2SCFG_TT_FIFO8 | \
  19354. +
  19355. + val = PSC_I2SCFG_SET_LEN(16) | PSC_I2SCFG_WS(WS_128FS) | PSC_I2SCFG_RT_FIFO8 | PSC_I2SCFG_TT_FIFO8 | \
  19356. PSC_I2SCFG_BI | PSC_I2SCFG_XM;
  19357. - ip->psc_i2scfg = val;
  19358. - au_sync();
  19359. - val |= PSC_I2SCFG_DE_ENABLE;
  19360. - ip->psc_i2scfg = val;
  19361. - au_sync();
  19362. + ip->psc_i2scfg = val | PSC_I2SCFG_DE_ENABLE;
  19363. - /* Wait for Device ready.
  19364. - */
  19365. - do {
  19366. - val = ip->psc_i2sstat;
  19367. - au_sync();
  19368. - } while ((val & PSC_I2SSTAT_DR) == 0);
  19369. + set_dac_rate(s, 8000); //Set default rate
  19370. - val = ip->psc_i2scfg;
  19371. - au_sync();
  19372. + codec_init(s);
  19373. - codec_init();
  19374. + s->no_vra = vra ? 0 : 1;
  19375. - s->no_vra = 1;
  19376. if (s->no_vra)
  19377. info("no VRA, interpolating and decimating");
  19378. @@ -1866,6 +2122,8 @@ au1550_probe(void)
  19379. err_dev2:
  19380. unregister_sound_dsp(s->dev_audio);
  19381. #endif
  19382. + err_dev2:
  19383. + unregister_sound_dsp(s->dev_audio);
  19384. err_dev1:
  19385. au1xxx_dbdma_chan_free(s->dma_adc.dmanr);
  19386. err_dma2:
  19387. --- a/drivers/sound/au1550_psc.c
  19388. +++ b/drivers/sound/au1550_psc.c
  19389. @@ -30,6 +30,7 @@
  19390. * 675 Mass Ave, Cambridge, MA 02139, USA.
  19391. *
  19392. */
  19393. +
  19394. #include <linux/version.h>
  19395. #include <linux/module.h>
  19396. #include <linux/string.h>
  19397. @@ -63,6 +64,14 @@
  19398. #include <asm/db1x00.h>
  19399. #endif
  19400. +#ifdef CONFIG_MIPS_PB1200
  19401. +#include <asm/pb1200.h>
  19402. +#endif
  19403. +
  19404. +#ifdef CONFIG_MIPS_DB1200
  19405. +#include <asm/db1200.h>
  19406. +#endif
  19407. +
  19408. #undef OSS_DOCUMENTED_MIXER_SEMANTICS
  19409. #define AU1550_MODULE_NAME "Au1550 psc audio"
  19410. @@ -521,7 +530,14 @@ stop_adc(struct au1550_state *s)
  19411. spin_unlock_irqrestore(&s->lock, flags);
  19412. }
  19413. -
  19414. +/*
  19415. + NOTE: The xmit slots cannot be changed on the fly when in full-duplex
  19416. + because the AC'97 block must be stopped/started. When using this driver
  19417. + in full-duplex (in & out at the same time), the DMA engine will stop if
  19418. + you disable the block.
  19419. + TODO: change implementation to properly restart adc/dac after setting
  19420. + xmit slots.
  19421. +*/
  19422. static void
  19423. set_xmit_slots(int num_channels)
  19424. {
  19425. @@ -565,6 +581,14 @@ set_xmit_slots(int num_channels)
  19426. } while ((stat & PSC_AC97STAT_DR) == 0);
  19427. }
  19428. +/*
  19429. + NOTE: The recv slots cannot be changed on the fly when in full-duplex
  19430. + because the AC'97 block must be stopped/started. When using this driver
  19431. + in full-duplex (in & out at the same time), the DMA engine will stop if
  19432. + you disable the block.
  19433. + TODO: change implementation to properly restart adc/dac after setting
  19434. + recv slots.
  19435. +*/
  19436. static void
  19437. set_recv_slots(int num_channels)
  19438. {
  19439. @@ -608,7 +632,6 @@ start_dac(struct au1550_state *s)
  19440. spin_lock_irqsave(&s->lock, flags);
  19441. - set_xmit_slots(db->num_channels);
  19442. au_writel(PSC_AC97PCR_TC, PSC_AC97PCR);
  19443. au_sync();
  19444. au_writel(PSC_AC97PCR_TS, PSC_AC97PCR);
  19445. @@ -640,7 +663,6 @@ start_adc(struct au1550_state *s)
  19446. db->nextIn -= db->dmasize;
  19447. }
  19448. - set_recv_slots(db->num_channels);
  19449. au1xxx_dbdma_start(db->dmanr);
  19450. au_writel(PSC_AC97PCR_RC, PSC_AC97PCR);
  19451. au_sync();
  19452. @@ -752,12 +774,16 @@ dac_dma_interrupt(int irq, void *dev_id,
  19453. if (ac97c_stat & (AC97C_XU | AC97C_XO | AC97C_TE))
  19454. dbg("AC97C status = 0x%08x", ac97c_stat);
  19455. #endif
  19456. + /* There is a possiblity that we are getting 1 interrupt for
  19457. + multiple descriptors. Use ddma api to find out how many
  19458. + completed.
  19459. + */
  19460. db->dma_qcount--;
  19461. if (db->count >= db->fragsize) {
  19462. if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut,
  19463. db->fragsize) == 0) {
  19464. - err("qcount < 2 and no ring room!");
  19465. + err("qcount < 2 and no ring room1!");
  19466. }
  19467. db->nextOut += db->fragsize;
  19468. if (db->nextOut >= db->rawbuf + db->dmasize)
  19469. @@ -941,11 +967,12 @@ translate_from_user(struct dmabuf *db, c
  19470. /* duplicate every audio frame src_factor times
  19471. */
  19472. - for (i = 0; i < db->src_factor; i++)
  19473. + for (i = 0; i < db->src_factor; i++) {
  19474. memcpy(dmabuf, dmasample, db->dma_bytes_per_sample);
  19475. + dmabuf += interp_bytes_per_sample;
  19476. + }
  19477. userbuf += db->user_bytes_per_sample;
  19478. - dmabuf += interp_bytes_per_sample;
  19479. }
  19480. return num_samples * interp_bytes_per_sample;
  19481. @@ -1203,7 +1230,7 @@ au1550_write(struct file *file, const ch
  19482. while ((db->dma_qcount < 2) && (db->count >= db->fragsize)) {
  19483. if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut,
  19484. db->fragsize) == 0) {
  19485. - err("qcount < 2 and no ring room!");
  19486. + err("qcount < 2 and no ring room!0");
  19487. }
  19488. db->nextOut += db->fragsize;
  19489. if (db->nextOut >= db->rawbuf + db->dmasize)
  19490. @@ -1481,6 +1508,7 @@ au1550_ioctl(struct inode *inode, struct
  19491. return -EINVAL;
  19492. stop_adc(s);
  19493. s->dma_adc.num_channels = val;
  19494. + set_recv_slots(val);
  19495. if ((ret = prog_dmabuf_adc(s)))
  19496. return ret;
  19497. }
  19498. @@ -1538,6 +1566,7 @@ au1550_ioctl(struct inode *inode, struct
  19499. }
  19500. s->dma_dac.num_channels = val;
  19501. + set_xmit_slots(val);
  19502. if ((ret = prog_dmabuf_dac(s)))
  19503. return ret;
  19504. }
  19505. @@ -1832,10 +1861,8 @@ au1550_open(struct inode *inode, struct
  19506. down(&s->open_sem);
  19507. }
  19508. - stop_dac(s);
  19509. - stop_adc(s);
  19510. -
  19511. if (file->f_mode & FMODE_READ) {
  19512. + stop_adc(s);
  19513. s->dma_adc.ossfragshift = s->dma_adc.ossmaxfrags =
  19514. s->dma_adc.subdivision = s->dma_adc.total_bytes = 0;
  19515. s->dma_adc.num_channels = 1;
  19516. @@ -1846,6 +1873,7 @@ au1550_open(struct inode *inode, struct
  19517. }
  19518. if (file->f_mode & FMODE_WRITE) {
  19519. + stop_dac(s);
  19520. s->dma_dac.ossfragshift = s->dma_dac.ossmaxfrags =
  19521. s->dma_dac.subdivision = s->dma_dac.total_bytes = 0;
  19522. s->dma_dac.num_channels = 1;
  19523. @@ -2091,6 +2119,9 @@ au1550_probe(void)
  19524. ac97_read_proc, &s->codec);
  19525. #endif
  19526. + set_xmit_slots(1);
  19527. + set_recv_slots(1);
  19528. +
  19529. return 0;
  19530. err_dev3:
  19531. --- a/drivers/sound/Config.in
  19532. +++ b/drivers/sound/Config.in
  19533. @@ -72,10 +72,15 @@ fi
  19534. if [ "$CONFIG_DDB5477" = "y" ]; then
  19535. dep_tristate ' NEC Vrc5477 AC97 sound' CONFIG_SOUND_VRC5477 $CONFIG_SOUND
  19536. fi
  19537. -if [ "$CONFIG_SOC_AU1X00" = "y" -o "$CONFIG_SOC_AU1500" = "y" ]; then
  19538. - dep_tristate ' Au1x00 Sound' CONFIG_SOUND_AU1X00 $CONFIG_SOUND
  19539. - dep_tristate ' Au1550 PSC Sound' CONFIG_SOUND_AU1550_PSC $CONFIG_SOUND
  19540. - dep_tristate ' Au1550 I2S Sound' CONFIG_SOUND_AU1550_I2S $CONFIG_SOUND
  19541. +if [ "$CONFIG_SOC_AU1000" = "y" -o \
  19542. + "$CONFIG_SOC_AU1500" = "y" -o \
  19543. + "$CONFIG_SOC_AU1100" = "y" ]; then
  19544. + dep_tristate ' Au1x00 AC97 Sound' CONFIG_SOUND_AU1X00 $CONFIG_SOUND
  19545. +fi
  19546. +if [ "$CONFIG_SOC_AU1550" = "y" -o \
  19547. + "$CONFIG_SOC_AU1200" = "y" ]; then
  19548. + dep_tristate ' Au1550/Au1200 PSC AC97 Sound' CONFIG_SOUND_AU1550_PSC $CONFIG_SOUND
  19549. + dep_tristate ' Au1550/Au1200 PSC I2S Sound' CONFIG_SOUND_AU1550_I2S $CONFIG_SOUND
  19550. fi
  19551. dep_tristate ' Trident 4DWave DX/NX, SiS 7018 or ALi 5451 PCI Audio Core' CONFIG_SOUND_TRIDENT $CONFIG_SOUND $CONFIG_PCI
  19552. --- a/drivers/tc/lk201.c
  19553. +++ b/drivers/tc/lk201.c
  19554. @@ -5,7 +5,7 @@
  19555. * for more details.
  19556. *
  19557. * Copyright (C) 1999-2002 Harald Koerfgen <[email protected]>
  19558. - * Copyright (C) 2001, 2002, 2003 Maciej W. Rozycki <[email protected]>
  19559. + * Copyright (C) 2001, 2002, 2003, 2004 Maciej W. Rozycki
  19560. */
  19561. #include <linux/config.h>
  19562. @@ -23,8 +23,8 @@
  19563. #include <asm/keyboard.h>
  19564. #include <asm/dec/tc.h>
  19565. #include <asm/dec/machtype.h>
  19566. +#include <asm/dec/serial.h>
  19567. -#include "zs.h"
  19568. #include "lk201.h"
  19569. /*
  19570. @@ -55,19 +55,20 @@ unsigned char *kbd_sysrq_xlate = lk201_s
  19571. unsigned char kbd_sysrq_key = -1;
  19572. #endif
  19573. -#define KEYB_LINE 3
  19574. +#define KEYB_LINE_ZS 3
  19575. +#define KEYB_LINE_DZ 0
  19576. -static int __init lk201_init(struct dec_serial *);
  19577. -static void __init lk201_info(struct dec_serial *);
  19578. -static void lk201_kbd_rx_char(unsigned char, unsigned char);
  19579. +static int __init lk201_init(void *);
  19580. +static void __init lk201_info(void *);
  19581. +static void lk201_rx_char(unsigned char, unsigned char);
  19582. -struct zs_hook lk201_kbdhook = {
  19583. +static struct dec_serial_hook lk201_hook = {
  19584. .init_channel = lk201_init,
  19585. .init_info = lk201_info,
  19586. .rx_char = NULL,
  19587. .poll_rx_char = NULL,
  19588. .poll_tx_char = NULL,
  19589. - .cflags = B4800 | CS8 | CSTOPB | CLOCAL
  19590. + .cflags = B4800 | CS8 | CSTOPB | CLOCAL,
  19591. };
  19592. /*
  19593. @@ -93,28 +94,28 @@ static unsigned char lk201_reset_string[
  19594. LK_CMD_ENB_BELL, LK_PARAM_VOLUME(4),
  19595. };
  19596. -static struct dec_serial* lk201kbd_info;
  19597. +static void *lk201_handle;
  19598. -static int lk201_send(struct dec_serial *info, unsigned char ch)
  19599. +static int lk201_send(unsigned char ch)
  19600. {
  19601. - if (info->hook->poll_tx_char(info, ch)) {
  19602. + if (lk201_hook.poll_tx_char(lk201_handle, ch)) {
  19603. printk(KERN_ERR "lk201: transmit timeout\n");
  19604. return -EIO;
  19605. }
  19606. return 0;
  19607. }
  19608. -static inline int lk201_get_id(struct dec_serial *info)
  19609. +static inline int lk201_get_id(void)
  19610. {
  19611. - return lk201_send(info, LK_CMD_REQ_ID);
  19612. + return lk201_send(LK_CMD_REQ_ID);
  19613. }
  19614. -static int lk201_reset(struct dec_serial *info)
  19615. +static int lk201_reset(void)
  19616. {
  19617. int i, r;
  19618. for (i = 0; i < sizeof(lk201_reset_string); i++) {
  19619. - r = lk201_send(info, lk201_reset_string[i]);
  19620. + r = lk201_send(lk201_reset_string[i]);
  19621. if (r < 0)
  19622. return r;
  19623. }
  19624. @@ -203,24 +204,26 @@ static void parse_kbd_rate(struct kbd_re
  19625. static int write_kbd_rate(struct kbd_repeat *rep)
  19626. {
  19627. - struct dec_serial* info = lk201kbd_info;
  19628. int delay, rate;
  19629. int i;
  19630. delay = rep->delay / 5;
  19631. rate = rep->rate;
  19632. for (i = 0; i < 4; i++) {
  19633. - if (info->hook->poll_tx_char(info, LK_CMD_RPT_RATE(i)))
  19634. + if (lk201_hook.poll_tx_char(lk201_handle,
  19635. + LK_CMD_RPT_RATE(i)))
  19636. return 1;
  19637. - if (info->hook->poll_tx_char(info, LK_PARAM_DELAY(delay)))
  19638. + if (lk201_hook.poll_tx_char(lk201_handle,
  19639. + LK_PARAM_DELAY(delay)))
  19640. return 1;
  19641. - if (info->hook->poll_tx_char(info, LK_PARAM_RATE(rate)))
  19642. + if (lk201_hook.poll_tx_char(lk201_handle,
  19643. + LK_PARAM_RATE(rate)))
  19644. return 1;
  19645. }
  19646. return 0;
  19647. }
  19648. -static int lk201kbd_rate(struct kbd_repeat *rep)
  19649. +static int lk201_kbd_rate(struct kbd_repeat *rep)
  19650. {
  19651. if (rep == NULL)
  19652. return -EINVAL;
  19653. @@ -237,10 +240,8 @@ static int lk201kbd_rate(struct kbd_repe
  19654. return 0;
  19655. }
  19656. -static void lk201kd_mksound(unsigned int hz, unsigned int ticks)
  19657. +static void lk201_kd_mksound(unsigned int hz, unsigned int ticks)
  19658. {
  19659. - struct dec_serial* info = lk201kbd_info;
  19660. -
  19661. if (!ticks)
  19662. return;
  19663. @@ -253,20 +254,19 @@ static void lk201kd_mksound(unsigned int
  19664. ticks = 7;
  19665. ticks = 7 - ticks;
  19666. - if (info->hook->poll_tx_char(info, LK_CMD_ENB_BELL))
  19667. + if (lk201_hook.poll_tx_char(lk201_handle, LK_CMD_ENB_BELL))
  19668. return;
  19669. - if (info->hook->poll_tx_char(info, LK_PARAM_VOLUME(ticks)))
  19670. + if (lk201_hook.poll_tx_char(lk201_handle, LK_PARAM_VOLUME(ticks)))
  19671. return;
  19672. - if (info->hook->poll_tx_char(info, LK_CMD_BELL))
  19673. + if (lk201_hook.poll_tx_char(lk201_handle, LK_CMD_BELL))
  19674. return;
  19675. }
  19676. void kbd_leds(unsigned char leds)
  19677. {
  19678. - struct dec_serial* info = lk201kbd_info;
  19679. unsigned char l = 0;
  19680. - if (!info) /* FIXME */
  19681. + if (!lk201_handle) /* FIXME */
  19682. return;
  19683. /* FIXME -- Only Hold and Lock LEDs for now. --macro */
  19684. @@ -275,13 +275,13 @@ void kbd_leds(unsigned char leds)
  19685. if (leds & LED_CAP)
  19686. l |= LK_LED_LOCK;
  19687. - if (info->hook->poll_tx_char(info, LK_CMD_LEDS_ON))
  19688. + if (lk201_hook.poll_tx_char(lk201_handle, LK_CMD_LEDS_ON))
  19689. return;
  19690. - if (info->hook->poll_tx_char(info, LK_PARAM_LED_MASK(l)))
  19691. + if (lk201_hook.poll_tx_char(lk201_handle, LK_PARAM_LED_MASK(l)))
  19692. return;
  19693. - if (info->hook->poll_tx_char(info, LK_CMD_LEDS_OFF))
  19694. + if (lk201_hook.poll_tx_char(lk201_handle, LK_CMD_LEDS_OFF))
  19695. return;
  19696. - if (info->hook->poll_tx_char(info, LK_PARAM_LED_MASK(~l)))
  19697. + if (lk201_hook.poll_tx_char(lk201_handle, LK_PARAM_LED_MASK(~l)))
  19698. return;
  19699. }
  19700. @@ -307,7 +307,7 @@ char kbd_unexpected_up(unsigned char key
  19701. return 0x80;
  19702. }
  19703. -static void lk201_kbd_rx_char(unsigned char ch, unsigned char stat)
  19704. +static void lk201_rx_char(unsigned char ch, unsigned char fl)
  19705. {
  19706. static unsigned char id[6];
  19707. static int id_i;
  19708. @@ -316,9 +316,8 @@ static void lk201_kbd_rx_char(unsigned c
  19709. static int prev_scancode;
  19710. unsigned char c = scancodeRemap[ch];
  19711. - if (stat && stat != TTY_OVERRUN) {
  19712. - printk(KERN_ERR "lk201: keyboard receive error: 0x%02x\n",
  19713. - stat);
  19714. + if (fl != TTY_NORMAL && fl != TTY_OVERRUN) {
  19715. + printk(KERN_ERR "lk201: keyboard receive error: 0x%02x\n", fl);
  19716. return;
  19717. }
  19718. @@ -335,7 +334,7 @@ static void lk201_kbd_rx_char(unsigned c
  19719. /* OK, the power-up concluded. */
  19720. lk201_report(id);
  19721. if (id[2] == LK_STAT_PWRUP_OK)
  19722. - lk201_get_id(lk201kbd_info);
  19723. + lk201_get_id();
  19724. else {
  19725. id_i = 0;
  19726. printk(KERN_ERR "lk201: keyboard power-up "
  19727. @@ -345,7 +344,7 @@ static void lk201_kbd_rx_char(unsigned c
  19728. /* We got the ID; report it and start operation. */
  19729. id_i = 0;
  19730. lk201_id(id);
  19731. - lk201_reset(lk201kbd_info);
  19732. + lk201_reset();
  19733. }
  19734. return;
  19735. }
  19736. @@ -398,29 +397,28 @@ static void lk201_kbd_rx_char(unsigned c
  19737. tasklet_schedule(&keyboard_tasklet);
  19738. }
  19739. -static void __init lk201_info(struct dec_serial *info)
  19740. +static void __init lk201_info(void *handle)
  19741. {
  19742. }
  19743. -static int __init lk201_init(struct dec_serial *info)
  19744. +static int __init lk201_init(void *handle)
  19745. {
  19746. /* First install handlers. */
  19747. - lk201kbd_info = info;
  19748. - kbd_rate = lk201kbd_rate;
  19749. - kd_mksound = lk201kd_mksound;
  19750. + lk201_handle = handle;
  19751. + kbd_rate = lk201_kbd_rate;
  19752. + kd_mksound = lk201_kd_mksound;
  19753. - info->hook->rx_char = lk201_kbd_rx_char;
  19754. + lk201_hook.rx_char = lk201_rx_char;
  19755. /* Then just issue a reset -- the handlers will do the rest. */
  19756. - lk201_send(info, LK_CMD_POWER_UP);
  19757. + lk201_send(LK_CMD_POWER_UP);
  19758. return 0;
  19759. }
  19760. void __init kbd_init_hw(void)
  19761. {
  19762. - extern int register_zs_hook(unsigned int, struct zs_hook *);
  19763. - extern int unregister_zs_hook(unsigned int);
  19764. + int keyb_line;
  19765. /* Maxine uses LK501 at the Access.Bus. */
  19766. if (!LK_IFACE)
  19767. @@ -428,19 +426,15 @@ void __init kbd_init_hw(void)
  19768. printk(KERN_INFO "lk201: DECstation LK keyboard driver v0.05.\n");
  19769. - if (LK_IFACE_ZS) {
  19770. - /*
  19771. - * kbd_init_hw() is being called before
  19772. - * rs_init() so just register the kbd hook
  19773. - * and let zs_init do the rest :-)
  19774. - */
  19775. - if(!register_zs_hook(KEYB_LINE, &lk201_kbdhook))
  19776. - unregister_zs_hook(KEYB_LINE);
  19777. - } else {
  19778. - /*
  19779. - * TODO: modify dz.c to allow similar hooks
  19780. - * for LK201 handling on DS2100, DS3100, and DS5000/200
  19781. - */
  19782. - printk(KERN_ERR "lk201: support for DZ11 not yet ready.\n");
  19783. - }
  19784. + /*
  19785. + * kbd_init_hw() is being called before
  19786. + * rs_init() so just register the kbd hook
  19787. + * and let zs_init do the rest :-)
  19788. + */
  19789. + if (LK_IFACE_ZS)
  19790. + keyb_line = KEYB_LINE_ZS;
  19791. + else
  19792. + keyb_line = KEYB_LINE_DZ;
  19793. + if (!register_dec_serial_hook(keyb_line, &lk201_hook))
  19794. + unregister_dec_serial_hook(keyb_line);
  19795. }
  19796. --- a/drivers/tc/zs.c
  19797. +++ b/drivers/tc/zs.c
  19798. @@ -68,6 +68,8 @@
  19799. #include <asm/bitops.h>
  19800. #include <asm/uaccess.h>
  19801. #include <asm/bootinfo.h>
  19802. +#include <asm/dec/serial.h>
  19803. +
  19804. #ifdef CONFIG_DECSTATION
  19805. #include <asm/dec/interrupts.h>
  19806. #include <asm/dec/machtype.h>
  19807. @@ -160,8 +162,8 @@ struct tty_struct zs_ttys[NUM_CHANNELS];
  19808. #ifdef CONFIG_SERIAL_DEC_CONSOLE
  19809. static struct console sercons;
  19810. #endif
  19811. -#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) \
  19812. - && !defined(MODULE)
  19813. +#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && \
  19814. + !defined(MODULE)
  19815. static unsigned long break_pressed; /* break, really ... */
  19816. #endif
  19817. @@ -196,7 +198,6 @@ static int serial_refcount;
  19818. /*
  19819. * Debugging.
  19820. */
  19821. -#undef SERIAL_DEBUG_INTR
  19822. #undef SERIAL_DEBUG_OPEN
  19823. #undef SERIAL_DEBUG_FLOW
  19824. #undef SERIAL_DEBUG_THROTTLE
  19825. @@ -221,10 +222,6 @@ static struct tty_struct *serial_table[N
  19826. static struct termios *serial_termios[NUM_CHANNELS];
  19827. static struct termios *serial_termios_locked[NUM_CHANNELS];
  19828. -#ifndef MIN
  19829. -#define MIN(a,b) ((a) < (b) ? (a) : (b))
  19830. -#endif
  19831. -
  19832. /*
  19833. * tmp_buf is used as a temporary buffer by serial_write. We need to
  19834. * lock it in case the copy_from_user blocks while swapping in a page,
  19835. @@ -386,8 +383,6 @@ static inline void rs_recv_clear(struct
  19836. * -----------------------------------------------------------------------
  19837. */
  19838. -static int tty_break; /* Set whenever BREAK condition is detected. */
  19839. -
  19840. /*
  19841. * This routine is used by the interrupt handler to schedule
  19842. * processing in the software interrupt portion of the driver.
  19843. @@ -414,20 +409,15 @@ static _INLINE_ void receive_chars(struc
  19844. if (!tty && (!info->hook || !info->hook->rx_char))
  19845. continue;
  19846. - if (tty_break) {
  19847. - tty_break = 0;
  19848. -#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && !defined(MODULE)
  19849. - if (info->line == sercons.index) {
  19850. - if (!break_pressed) {
  19851. - break_pressed = jiffies;
  19852. - goto ignore_char;
  19853. - }
  19854. - break_pressed = 0;
  19855. - }
  19856. -#endif
  19857. + flag = TTY_NORMAL;
  19858. + if (info->tty_break) {
  19859. + info->tty_break = 0;
  19860. flag = TTY_BREAK;
  19861. if (info->flags & ZILOG_SAK)
  19862. do_SAK(tty);
  19863. + /* Ignore the null char got when BREAK is removed. */
  19864. + if (ch == 0)
  19865. + continue;
  19866. } else {
  19867. if (stat & Rx_OVR) {
  19868. flag = TTY_OVERRUN;
  19869. @@ -435,20 +425,22 @@ static _INLINE_ void receive_chars(struc
  19870. flag = TTY_FRAME;
  19871. } else if (stat & PAR_ERR) {
  19872. flag = TTY_PARITY;
  19873. - } else
  19874. - flag = 0;
  19875. - if (flag)
  19876. + }
  19877. + if (flag != TTY_NORMAL)
  19878. /* reset the error indication */
  19879. write_zsreg(info->zs_channel, R0, ERR_RES);
  19880. }
  19881. -#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && !defined(MODULE)
  19882. +#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && \
  19883. + !defined(MODULE)
  19884. if (break_pressed && info->line == sercons.index) {
  19885. - if (ch != 0 &&
  19886. - time_before(jiffies, break_pressed + HZ*5)) {
  19887. + /* Ignore the null char got when BREAK is removed. */
  19888. + if (ch == 0)
  19889. + continue;
  19890. + if (time_before(jiffies, break_pressed + HZ * 5)) {
  19891. handle_sysrq(ch, regs, NULL, NULL);
  19892. break_pressed = 0;
  19893. - goto ignore_char;
  19894. + continue;
  19895. }
  19896. break_pressed = 0;
  19897. }
  19898. @@ -459,23 +451,7 @@ static _INLINE_ void receive_chars(struc
  19899. return;
  19900. }
  19901. - if (tty->flip.count >= TTY_FLIPBUF_SIZE) {
  19902. - static int flip_buf_ovf;
  19903. - ++flip_buf_ovf;
  19904. - continue;
  19905. - }
  19906. - tty->flip.count++;
  19907. - {
  19908. - static int flip_max_cnt;
  19909. - if (flip_max_cnt < tty->flip.count)
  19910. - flip_max_cnt = tty->flip.count;
  19911. - }
  19912. -
  19913. - *tty->flip.flag_buf_ptr++ = flag;
  19914. - *tty->flip.char_buf_ptr++ = ch;
  19915. -#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && !defined(MODULE)
  19916. - ignore_char:
  19917. -#endif
  19918. + tty_insert_flip_char(tty, ch, flag);
  19919. }
  19920. if (tty)
  19921. tty_flip_buffer_push(tty);
  19922. @@ -517,11 +493,15 @@ static _INLINE_ void status_handle(struc
  19923. /* Get status from Read Register 0 */
  19924. stat = read_zsreg(info->zs_channel, R0);
  19925. - if (stat & BRK_ABRT) {
  19926. -#ifdef SERIAL_DEBUG_INTR
  19927. - printk("handling break....");
  19928. + if ((stat & BRK_ABRT) && !(info->read_reg_zero & BRK_ABRT)) {
  19929. +#if defined(CONFIG_SERIAL_DEC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && \
  19930. + !defined(MODULE)
  19931. + if (info->line == sercons.index) {
  19932. + if (!break_pressed)
  19933. + break_pressed = jiffies;
  19934. + } else
  19935. #endif
  19936. - tty_break = 1;
  19937. + info->tty_break = 1;
  19938. }
  19939. if (info->zs_channel != info->zs_chan_a) {
  19940. @@ -957,7 +937,7 @@ static int rs_write(struct tty_struct *
  19941. save_flags(flags);
  19942. while (1) {
  19943. cli();
  19944. - c = MIN(count, MIN(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
  19945. + c = min(count, min(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
  19946. SERIAL_XMIT_SIZE - info->xmit_head));
  19947. if (c <= 0)
  19948. break;
  19949. @@ -965,7 +945,7 @@ static int rs_write(struct tty_struct *
  19950. if (from_user) {
  19951. down(&tmp_buf_sem);
  19952. copy_from_user(tmp_buf, buf, c);
  19953. - c = MIN(c, MIN(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
  19954. + c = min(c, min(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
  19955. SERIAL_XMIT_SIZE - info->xmit_head));
  19956. memcpy(info->xmit_buf + info->xmit_head, tmp_buf, c);
  19957. up(&tmp_buf_sem);
  19958. @@ -1282,46 +1262,48 @@ static int rs_ioctl(struct tty_struct *t
  19959. }
  19960. switch (cmd) {
  19961. - case TIOCMGET:
  19962. - error = verify_area(VERIFY_WRITE, (void *) arg,
  19963. - sizeof(unsigned int));
  19964. - if (error)
  19965. - return error;
  19966. - return get_modem_info(info, (unsigned int *) arg);
  19967. - case TIOCMBIS:
  19968. - case TIOCMBIC:
  19969. - case TIOCMSET:
  19970. - return set_modem_info(info, cmd, (unsigned int *) arg);
  19971. - case TIOCGSERIAL:
  19972. - error = verify_area(VERIFY_WRITE, (void *) arg,
  19973. - sizeof(struct serial_struct));
  19974. - if (error)
  19975. - return error;
  19976. - return get_serial_info(info,
  19977. - (struct serial_struct *) arg);
  19978. - case TIOCSSERIAL:
  19979. - return set_serial_info(info,
  19980. - (struct serial_struct *) arg);
  19981. - case TIOCSERGETLSR: /* Get line status register */
  19982. - error = verify_area(VERIFY_WRITE, (void *) arg,
  19983. - sizeof(unsigned int));
  19984. - if (error)
  19985. - return error;
  19986. - else
  19987. - return get_lsr_info(info, (unsigned int *) arg);
  19988. + case TIOCMGET:
  19989. + error = verify_area(VERIFY_WRITE, (void *)arg,
  19990. + sizeof(unsigned int));
  19991. + if (error)
  19992. + return error;
  19993. + return get_modem_info(info, (unsigned int *)arg);
  19994. - case TIOCSERGSTRUCT:
  19995. - error = verify_area(VERIFY_WRITE, (void *) arg,
  19996. - sizeof(struct dec_serial));
  19997. - if (error)
  19998. - return error;
  19999. - copy_from_user((struct dec_serial *) arg,
  20000. - info, sizeof(struct dec_serial));
  20001. - return 0;
  20002. + case TIOCMBIS:
  20003. + case TIOCMBIC:
  20004. + case TIOCMSET:
  20005. + return set_modem_info(info, cmd, (unsigned int *)arg);
  20006. - default:
  20007. - return -ENOIOCTLCMD;
  20008. - }
  20009. + case TIOCGSERIAL:
  20010. + error = verify_area(VERIFY_WRITE, (void *)arg,
  20011. + sizeof(struct serial_struct));
  20012. + if (error)
  20013. + return error;
  20014. + return get_serial_info(info, (struct serial_struct *)arg);
  20015. +
  20016. + case TIOCSSERIAL:
  20017. + return set_serial_info(info, (struct serial_struct *)arg);
  20018. +
  20019. + case TIOCSERGETLSR: /* Get line status register */
  20020. + error = verify_area(VERIFY_WRITE, (void *)arg,
  20021. + sizeof(unsigned int));
  20022. + if (error)
  20023. + return error;
  20024. + else
  20025. + return get_lsr_info(info, (unsigned int *)arg);
  20026. +
  20027. + case TIOCSERGSTRUCT:
  20028. + error = verify_area(VERIFY_WRITE, (void *)arg,
  20029. + sizeof(struct dec_serial));
  20030. + if (error)
  20031. + return error;
  20032. + copy_from_user((struct dec_serial *)arg, info,
  20033. + sizeof(struct dec_serial));
  20034. + return 0;
  20035. +
  20036. + default:
  20037. + return -ENOIOCTLCMD;
  20038. + }
  20039. return 0;
  20040. }
  20041. @@ -1446,7 +1428,8 @@ static void rs_close(struct tty_struct *
  20042. static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
  20043. {
  20044. struct dec_serial *info = (struct dec_serial *) tty->driver_data;
  20045. - unsigned long orig_jiffies, char_time;
  20046. + unsigned long orig_jiffies;
  20047. + int char_time;
  20048. if (serial_paranoia_check(info, tty->device, "rs_wait_until_sent"))
  20049. return;
  20050. @@ -1462,7 +1445,7 @@ static void rs_wait_until_sent(struct tt
  20051. if (char_time == 0)
  20052. char_time = 1;
  20053. if (timeout)
  20054. - char_time = MIN(char_time, timeout);
  20055. + char_time = min(char_time, timeout);
  20056. while ((read_zsreg(info->zs_channel, 1) & Tx_BUF_EMP) == 0) {
  20057. current->state = TASK_INTERRUPTIBLE;
  20058. schedule_timeout(char_time);
  20059. @@ -1714,7 +1697,7 @@ int rs_open(struct tty_struct *tty, stru
  20060. static void __init show_serial_version(void)
  20061. {
  20062. - printk("DECstation Z8530 serial driver version 0.08\n");
  20063. + printk("DECstation Z8530 serial driver version 0.09\n");
  20064. }
  20065. /* Initialize Z8530s zs_channels
  20066. @@ -1994,8 +1977,9 @@ int __init zs_init(void)
  20067. * polling I/O routines
  20068. */
  20069. static int
  20070. -zs_poll_tx_char(struct dec_serial *info, unsigned char ch)
  20071. +zs_poll_tx_char(void *handle, unsigned char ch)
  20072. {
  20073. + struct dec_serial *info = handle;
  20074. struct dec_zschannel *chan = info->zs_channel;
  20075. int ret;
  20076. @@ -2017,8 +2001,9 @@ zs_poll_tx_char(struct dec_serial *info,
  20077. }
  20078. static int
  20079. -zs_poll_rx_char(struct dec_serial *info)
  20080. +zs_poll_rx_char(void *handle)
  20081. {
  20082. + struct dec_serial *info = handle;
  20083. struct dec_zschannel *chan = info->zs_channel;
  20084. int ret;
  20085. @@ -2038,12 +2023,13 @@ zs_poll_rx_char(struct dec_serial *info)
  20086. return -ENODEV;
  20087. }
  20088. -unsigned int register_zs_hook(unsigned int channel, struct zs_hook *hook)
  20089. +int register_zs_hook(unsigned int channel, struct dec_serial_hook *hook)
  20090. {
  20091. struct dec_serial *info = &zs_soft[channel];
  20092. if (info->hook) {
  20093. - printk(__FUNCTION__": line %d has already a hook registered\n", channel);
  20094. + printk("%s: line %d has already a hook registered\n",
  20095. + __FUNCTION__, channel);
  20096. return 0;
  20097. } else {
  20098. @@ -2055,7 +2041,7 @@ unsigned int register_zs_hook(unsigned i
  20099. }
  20100. }
  20101. -unsigned int unregister_zs_hook(unsigned int channel)
  20102. +int unregister_zs_hook(unsigned int channel)
  20103. {
  20104. struct dec_serial *info = &zs_soft[channel];
  20105. @@ -2063,8 +2049,8 @@ unsigned int unregister_zs_hook(unsigned
  20106. info->hook = NULL;
  20107. return 1;
  20108. } else {
  20109. - printk(__FUNCTION__": trying to unregister hook on line %d,"
  20110. - " but none is registered\n", channel);
  20111. + printk("%s: trying to unregister hook on line %d,"
  20112. + " but none is registered\n", __FUNCTION__, channel);
  20113. return 0;
  20114. }
  20115. }
  20116. @@ -2319,22 +2305,23 @@ void kgdb_interruptible(int yes)
  20117. write_zsreg(chan, 9, nine);
  20118. }
  20119. -static int kgdbhook_init_channel(struct dec_serial* info)
  20120. +static int kgdbhook_init_channel(void *handle)
  20121. {
  20122. return 0;
  20123. }
  20124. -static void kgdbhook_init_info(struct dec_serial* info)
  20125. +static void kgdbhook_init_info(void *handle)
  20126. {
  20127. }
  20128. -static void kgdbhook_rx_char(struct dec_serial* info,
  20129. - unsigned char ch, unsigned char stat)
  20130. +static void kgdbhook_rx_char(void *handle, unsigned char ch, unsigned char fl)
  20131. {
  20132. + struct dec_serial *info = handle;
  20133. +
  20134. + if (fl != TTY_NORMAL)
  20135. + return;
  20136. if (ch == 0x03 || ch == '$')
  20137. breakpoint();
  20138. - if (stat & (Rx_OVR|FRM_ERR|PAR_ERR))
  20139. - write_zsreg(info->zs_channel, 0, ERR_RES);
  20140. }
  20141. /* This sets up the serial port we're using, and turns on
  20142. @@ -2360,11 +2347,11 @@ static inline void kgdb_chaninit(struct
  20143. * for /dev/ttyb which is determined in setup_arch() from the
  20144. * boot command line flags.
  20145. */
  20146. -struct zs_hook zs_kgdbhook = {
  20147. - init_channel : kgdbhook_init_channel,
  20148. - init_info : kgdbhook_init_info,
  20149. - cflags : B38400|CS8|CLOCAL,
  20150. - rx_char : kgdbhook_rx_char,
  20151. +struct dec_serial_hook zs_kgdbhook = {
  20152. + .init_channel = kgdbhook_init_channel,
  20153. + .init_info = kgdbhook_init_info,
  20154. + .rx_char = kgdbhook_rx_char,
  20155. + .cflags = B38400 | CS8 | CLOCAL,
  20156. }
  20157. void __init zs_kgdb_hook(int tty_num)
  20158. --- a/drivers/tc/zs.h
  20159. +++ b/drivers/tc/zs.h
  20160. @@ -1,14 +1,18 @@
  20161. /*
  20162. - * macserial.h: Definitions for the Macintosh Z8530 serial driver.
  20163. + * drivers/tc/zs.h: Definitions for the DECstation Z85C30 serial driver.
  20164. *
  20165. * Adapted from drivers/sbus/char/sunserial.h by Paul Mackerras.
  20166. + * Adapted from drivers/macintosh/macserial.h by Harald Koerfgen.
  20167. *
  20168. * Copyright (C) 1996 Paul Mackerras ([email protected])
  20169. * Copyright (C) 1995 David S. Miller ([email protected])
  20170. + * Copyright (C) 2004 Maciej W. Rozycki
  20171. */
  20172. #ifndef _DECSERIAL_H
  20173. #define _DECSERIAL_H
  20174. +#include <asm/dec/serial.h>
  20175. +
  20176. #define NUM_ZSREGS 16
  20177. struct serial_struct {
  20178. @@ -89,63 +93,50 @@ struct dec_zschannel {
  20179. unsigned char curregs[NUM_ZSREGS];
  20180. };
  20181. -struct dec_serial;
  20182. -
  20183. -struct zs_hook {
  20184. - int (*init_channel)(struct dec_serial* info);
  20185. - void (*init_info)(struct dec_serial* info);
  20186. - void (*rx_char)(unsigned char ch, unsigned char stat);
  20187. - int (*poll_rx_char)(struct dec_serial* info);
  20188. - int (*poll_tx_char)(struct dec_serial* info,
  20189. - unsigned char ch);
  20190. - unsigned cflags;
  20191. -};
  20192. -
  20193. struct dec_serial {
  20194. - struct dec_serial *zs_next; /* For IRQ servicing chain */
  20195. - struct dec_zschannel *zs_channel; /* Channel registers */
  20196. - struct dec_zschannel *zs_chan_a; /* A side registers */
  20197. - unsigned char read_reg_zero;
  20198. -
  20199. - char soft_carrier; /* Use soft carrier on this channel */
  20200. - char break_abort; /* Is serial console in, so process brk/abrt */
  20201. - struct zs_hook *hook; /* Hook on this channel */
  20202. - char is_cons; /* Is this our console. */
  20203. - unsigned char tx_active; /* character is being xmitted */
  20204. - unsigned char tx_stopped; /* output is suspended */
  20205. -
  20206. - /* We need to know the current clock divisor
  20207. - * to read the bps rate the chip has currently
  20208. - * loaded.
  20209. + struct dec_serial *zs_next; /* For IRQ servicing chain. */
  20210. + struct dec_zschannel *zs_channel; /* Channel registers. */
  20211. + struct dec_zschannel *zs_chan_a; /* A side registers. */
  20212. + unsigned char read_reg_zero;
  20213. +
  20214. + struct dec_serial_hook *hook; /* Hook on this channel. */
  20215. + int tty_break; /* Set on BREAK condition. */
  20216. + int is_cons; /* Is this our console. */
  20217. + int tx_active; /* Char is being xmitted. */
  20218. + int tx_stopped; /* Output is suspended. */
  20219. +
  20220. + /*
  20221. + * We need to know the current clock divisor
  20222. + * to read the bps rate the chip has currently loaded.
  20223. */
  20224. - unsigned char clk_divisor; /* May be 1, 16, 32, or 64 */
  20225. - int zs_baud;
  20226. + int clk_divisor; /* May be 1, 16, 32, or 64. */
  20227. + int zs_baud;
  20228. - char change_needed;
  20229. + char change_needed;
  20230. int magic;
  20231. int baud_base;
  20232. int port;
  20233. int irq;
  20234. - int flags; /* defined in tty.h */
  20235. - int type; /* UART type */
  20236. + int flags; /* Defined in tty.h. */
  20237. + int type; /* UART type. */
  20238. struct tty_struct *tty;
  20239. int read_status_mask;
  20240. int ignore_status_mask;
  20241. int timeout;
  20242. int xmit_fifo_size;
  20243. int custom_divisor;
  20244. - int x_char; /* xon/xoff character */
  20245. + int x_char; /* XON/XOFF character. */
  20246. int close_delay;
  20247. unsigned short closing_wait;
  20248. unsigned short closing_wait2;
  20249. unsigned long event;
  20250. unsigned long last_active;
  20251. int line;
  20252. - int count; /* # of fd on device */
  20253. - int blocked_open; /* # of blocked opens */
  20254. - long session; /* Session of opening process */
  20255. - long pgrp; /* pgrp of opening process */
  20256. + int count; /* # of fds on device. */
  20257. + int blocked_open; /* # of blocked opens. */
  20258. + long session; /* Sess of opening process. */
  20259. + long pgrp; /* Pgrp of opening process. */
  20260. unsigned char *xmit_buf;
  20261. int xmit_head;
  20262. int xmit_tail;
  20263. --- /dev/null
  20264. +++ b/drivers/video/au1200fb.c
  20265. @@ -0,0 +1,1564 @@
  20266. +/*
  20267. + * BRIEF MODULE DESCRIPTION
  20268. + * Au1200 LCD Driver.
  20269. + *
  20270. + * Copyright 2004 AMD
  20271. + * Author: AMD
  20272. + *
  20273. + * Based on:
  20274. + * linux/drivers/video/skeletonfb.c -- Skeleton for a frame buffer device
  20275. + * Created 28 Dec 1997 by Geert Uytterhoeven
  20276. + *
  20277. + * This program is free software; you can redistribute it and/or modify it
  20278. + * under the terms of the GNU General Public License as published by the
  20279. + * Free Software Foundation; either version 2 of the License, or (at your
  20280. + * option) any later version.
  20281. + *
  20282. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  20283. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  20284. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  20285. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  20286. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  20287. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  20288. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  20289. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  20290. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  20291. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  20292. + *
  20293. + * You should have received a copy of the GNU General Public License along
  20294. + * with this program; if not, write to the Free Software Foundation, Inc.,
  20295. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  20296. + */
  20297. +
  20298. +#include <linux/module.h>
  20299. +#include <linux/kernel.h>
  20300. +#include <linux/errno.h>
  20301. +#include <linux/string.h>
  20302. +#include <linux/mm.h>
  20303. +#include <linux/tty.h>
  20304. +#include <linux/slab.h>
  20305. +#include <linux/delay.h>
  20306. +#include <linux/fb.h>
  20307. +#include <linux/init.h>
  20308. +#include <asm/uaccess.h>
  20309. +
  20310. +#include <asm/au1000.h>
  20311. +#include <asm/au1xxx_gpio.h>
  20312. +#include "au1200fb.h"
  20313. +
  20314. +#include <video/fbcon.h>
  20315. +#include <video/fbcon-cfb16.h>
  20316. +#include <video/fbcon-cfb32.h>
  20317. +#define CMAPSIZE 16
  20318. +
  20319. +#define AU1200_LCD_GET_WINENABLE 1
  20320. +#define AU1200_LCD_SET_WINENABLE 2
  20321. +#define AU1200_LCD_GET_WINLOCATION 3
  20322. +#define AU1200_LCD_SET_WINLOCATION 4
  20323. +#define AU1200_LCD_GET_WINSIZE 5
  20324. +#define AU1200_LCD_SET_WINSIZE 6
  20325. +#define AU1200_LCD_GET_BACKCOLOR 7
  20326. +#define AU1200_LCD_SET_BACKCOLOR 8
  20327. +#define AU1200_LCD_GET_COLORKEY 9
  20328. +#define AU1200_LCD_SET_COLORKEY 10
  20329. +#define AU1200_LCD_GET_PANEL 11
  20330. +#define AU1200_LCD_SET_PANEL 12
  20331. +
  20332. +typedef struct au1200_lcd_getset_t
  20333. +{
  20334. + unsigned int subcmd;
  20335. + union {
  20336. + struct {
  20337. + int enable;
  20338. + } winenable;
  20339. + struct {
  20340. + int x, y;
  20341. + } winlocation;
  20342. + struct {
  20343. + int hsz, vsz;
  20344. + } winsize;
  20345. + struct {
  20346. + unsigned int color;
  20347. + } backcolor;
  20348. + struct {
  20349. + unsigned int key;
  20350. + unsigned int mask;
  20351. + } colorkey;
  20352. + struct {
  20353. + int panel;
  20354. + char desc[80];
  20355. + } panel;
  20356. + };
  20357. +} au1200_lcd_getset_t;
  20358. +
  20359. +AU1200_LCD *lcd = (AU1200_LCD *)AU1200_LCD_ADDR;
  20360. +static int window_index = 0; /* default is zero */
  20361. +static int panel_index = -1; /* default is call board_au1200fb_panel */
  20362. +
  20363. +struct window_settings
  20364. +{
  20365. + unsigned char name[64];
  20366. + uint32 mode_backcolor;
  20367. + uint32 mode_colorkey;
  20368. + uint32 mode_colorkeymsk;
  20369. + struct
  20370. + {
  20371. + int xres;
  20372. + int yres;
  20373. + int xpos;
  20374. + int ypos;
  20375. + uint32 mode_winctrl1; /* winctrl1[FRM,CCO,PO,PIPE] */
  20376. + uint32 mode_winenable;
  20377. + } w[4];
  20378. +};
  20379. +
  20380. +struct panel_settings
  20381. +{
  20382. + unsigned char name[64];
  20383. + /* panel physical dimensions */
  20384. + uint32 Xres;
  20385. + uint32 Yres;
  20386. + /* panel timings */
  20387. + uint32 mode_screen;
  20388. + uint32 mode_horztiming;
  20389. + uint32 mode_verttiming;
  20390. + uint32 mode_clkcontrol;
  20391. + uint32 mode_pwmdiv;
  20392. + uint32 mode_pwmhi;
  20393. + uint32 mode_outmask;
  20394. + uint32 mode_fifoctrl;
  20395. + uint32 mode_toyclksrc;
  20396. + uint32 mode_backlight;
  20397. + uint32 mode_auxpll;
  20398. + int (*device_init)(void);
  20399. + int (*device_shutdown)(void);
  20400. +};
  20401. +
  20402. +#if defined(__BIG_ENDIAN)
  20403. +#define LCD_WINCTRL1_PO_16BPP LCD_WINCTRL1_PO_00
  20404. +#else
  20405. +#define LCD_WINCTRL1_PO_16BPP LCD_WINCTRL1_PO_01
  20406. +#endif
  20407. +
  20408. +extern int board_au1200fb_panel (void);
  20409. +extern int board_au1200fb_panel_init (void);
  20410. +extern int board_au1200fb_panel_shutdown (void);
  20411. +
  20412. +#if defined(CONFIG_FOCUS_ENHANCEMENTS)
  20413. +extern int board_au1200fb_focus_init_hdtv(void);
  20414. +extern int board_au1200fb_focus_init_component(void);
  20415. +extern int board_au1200fb_focus_init_cvsv(void);
  20416. +extern int board_au1200fb_focus_shutdown(void);
  20417. +#endif
  20418. +
  20419. +/*
  20420. + * Default window configurations
  20421. + */
  20422. +static struct window_settings windows[] =
  20423. +{
  20424. + { /* Index 0 */
  20425. + "0-FS gfx, 1-video, 2-ovly gfx, 3-ovly gfx",
  20426. + /* mode_backcolor */ 0x006600ff,
  20427. + /* mode_colorkey,msk*/ 0, 0,
  20428. + {
  20429. + {
  20430. + /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
  20431. + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP,
  20432. + /* mode_winenable*/ LCD_WINENABLE_WEN0,
  20433. + },
  20434. + {
  20435. + /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
  20436. + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP,
  20437. + /* mode_winenable*/ 0,
  20438. + },
  20439. + {
  20440. + /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
  20441. + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP|LCD_WINCTRL1_PIPE,
  20442. + /* mode_winenable*/ 0,
  20443. + },
  20444. + {
  20445. + /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
  20446. + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP|LCD_WINCTRL1_PIPE,
  20447. + /* mode_winenable*/ 0,
  20448. + },
  20449. + },
  20450. + },
  20451. +
  20452. + { /* Index 1 */
  20453. + "0-FS gfx, 1-video, 2-ovly gfx, 3-ovly gfx",
  20454. + /* mode_backcolor */ 0x006600ff,
  20455. + /* mode_colorkey,msk*/ 0, 0,
  20456. + {
  20457. + {
  20458. + /* xres, yres, xpos, ypos */ 320, 240, 5, 5,
  20459. +#if 0
  20460. + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP,
  20461. +#endif
  20462. + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_24BPP|LCD_WINCTRL1_PO_00,
  20463. + /* mode_winenable*/ LCD_WINENABLE_WEN0,
  20464. + },
  20465. + {
  20466. + /* xres, yres, xpos, ypos */ 0, 0, 0, 0,
  20467. + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP,
  20468. + /* mode_winenable*/ 0,
  20469. + },
  20470. + {
  20471. + /* xres, yres, xpos, ypos */ 100, 100, 0, 0,
  20472. + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP|LCD_WINCTRL1_PIPE,
  20473. + /* mode_winenable*/ 0/*LCD_WINENABLE_WEN2*/,
  20474. + },
  20475. + {
  20476. + /* xres, yres, xpos, ypos */ 200, 25, 0, 0,
  20477. + /* mode_winctrl1 */ LCD_WINCTRL1_FRM_16BPP565|LCD_WINCTRL1_PO_16BPP|LCD_WINCTRL1_PIPE,
  20478. + /* mode_winenable*/ 0,
  20479. + },
  20480. + },
  20481. + },
  20482. + /* Need VGA 640 @ 24bpp, @ 32bpp */
  20483. + /* Need VGA 800 @ 24bpp, @ 32bpp */
  20484. + /* Need VGA 1024 @ 24bpp, @ 32bpp */
  20485. +} ;
  20486. +
  20487. +/*
  20488. + * Controller configurations for various panels.
  20489. + */
  20490. +static struct panel_settings panels[] =
  20491. +{
  20492. + { /* Index 0: QVGA 320x240 H:33.3kHz V:110Hz */
  20493. + "VGA_320x240",
  20494. + 320, 240,
  20495. + /* mode_screen */ LCD_SCREEN_SX_N(320) | LCD_SCREEN_SY_N(240),
  20496. + /* mode_horztiming */ 0x00c4623b,
  20497. + /* mode_verttiming */ 0x00502814,
  20498. + /* mode_clkcontrol */ 0x00020002, /* /4=24Mhz */
  20499. + /* mode_pwmdiv */ 0x00000000,
  20500. + /* mode_pwmhi */ 0x00000000,
  20501. + /* mode_outmask */ 0x00FFFFFF,
  20502. + /* mode_fifoctrl */ 0x2f2f2f2f,
  20503. + /* mode_toyclksrc */ 0x00000004, /* 96MHz AUXPLL directly */
  20504. + /* mode_backlight */ 0x00000000,
  20505. + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
  20506. + /* device_init */ NULL,
  20507. + /* device_shutdown */ NULL,
  20508. + },
  20509. +
  20510. + { /* Index 1: VGA 640x480 H:30.3kHz V:58Hz */
  20511. + "VGA_640x480",
  20512. + 640, 480,
  20513. + /* mode_screen */ 0x13f9df80,
  20514. + /* mode_horztiming */ 0x003c5859,
  20515. + /* mode_verttiming */ 0x00741201,
  20516. + /* mode_clkcontrol */ 0x00020001, /* /4=24Mhz */
  20517. + /* mode_pwmdiv */ 0x00000000,
  20518. + /* mode_pwmhi */ 0x00000000,
  20519. + /* mode_outmask */ 0x00FFFFFF,
  20520. + /* mode_fifoctrl */ 0x2f2f2f2f,
  20521. + /* mode_toyclksrc */ 0x00000004, /* AUXPLL directly */
  20522. + /* mode_backlight */ 0x00000000,
  20523. + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
  20524. + /* device_init */ NULL,
  20525. + /* device_shutdown */ NULL,
  20526. + },
  20527. +
  20528. + { /* Index 2: SVGA 800x600 H:46.1kHz V:69Hz */
  20529. + "SVGA_800x600",
  20530. + 800, 600,
  20531. + /* mode_screen */ 0x18fa5780,
  20532. + /* mode_horztiming */ 0x00dc7e77,
  20533. + /* mode_verttiming */ 0x00584805,
  20534. + /* mode_clkcontrol */ 0x00020000, /* /2=48Mhz */
  20535. + /* mode_pwmdiv */ 0x00000000,
  20536. + /* mode_pwmhi */ 0x00000000,
  20537. + /* mode_outmask */ 0x00FFFFFF,
  20538. + /* mode_fifoctrl */ 0x2f2f2f2f,
  20539. + /* mode_toyclksrc */ 0x00000004, /* AUXPLL directly */
  20540. + /* mode_backlight */ 0x00000000,
  20541. + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
  20542. + /* device_init */ NULL,
  20543. + /* device_shutdown */ NULL,
  20544. + },
  20545. +
  20546. + { /* Index 3: XVGA 1024x768 H:56.2kHz V:70Hz */
  20547. + "XVGA_1024x768",
  20548. + 1024, 768,
  20549. + /* mode_screen */ 0x1ffaff80,
  20550. + /* mode_horztiming */ 0x007d0e57,
  20551. + /* mode_verttiming */ 0x00740a01,
  20552. + /* mode_clkcontrol */ 0x000A0000, /* /1 */
  20553. + /* mode_pwmdiv */ 0x00000000,
  20554. + /* mode_pwmhi */ 0x00000000,
  20555. + /* mode_outmask */ 0x00FFFFFF,
  20556. + /* mode_fifoctrl */ 0x2f2f2f2f,
  20557. + /* mode_toyclksrc */ 0x00000004, /* AUXPLL directly */
  20558. + /* mode_backlight */ 0x00000000,
  20559. + /* mode_auxpll */ 6, /* 72MHz AUXPLL */
  20560. + /* device_init */ NULL,
  20561. + /* device_shutdown */ NULL,
  20562. + },
  20563. +
  20564. + { /* Index 4: XVGA 1280x1024 H:68.5kHz V:65Hz */
  20565. + "XVGA_1280x1024",
  20566. + 1280, 1024,
  20567. + /* mode_screen */ 0x27fbff80,
  20568. + /* mode_horztiming */ 0x00cdb2c7,
  20569. + /* mode_verttiming */ 0x00600002,
  20570. + /* mode_clkcontrol */ 0x000A0000, /* /1 */
  20571. + /* mode_pwmdiv */ 0x00000000,
  20572. + /* mode_pwmhi */ 0x00000000,
  20573. + /* mode_outmask */ 0x00FFFFFF,
  20574. + /* mode_fifoctrl */ 0x2f2f2f2f,
  20575. + /* mode_toyclksrc */ 0x00000004, /* AUXPLL directly */
  20576. + /* mode_backlight */ 0x00000000,
  20577. + /* mode_auxpll */ 10, /* 120MHz AUXPLL */
  20578. + /* device_init */ NULL,
  20579. + /* device_shutdown */ NULL,
  20580. + },
  20581. +
  20582. + { /* Index 5: Samsung 1024x768 TFT */
  20583. + "Samsung_1024x768_TFT",
  20584. + 1024, 768,
  20585. + /* mode_screen */ 0x1ffaff80,
  20586. + /* mode_horztiming */ 0x018cc677,
  20587. + /* mode_verttiming */ 0x00241217,
  20588. + /* mode_clkcontrol */ 0x00000000, /* SCB 0x1 /4=24Mhz */
  20589. + /* mode_pwmdiv */ 0x8000063f, /* SCB 0x0 */
  20590. + /* mode_pwmhi */ 0x03400000, /* SCB 0x0 */
  20591. + /* mode_outmask */ 0x00fcfcfc,
  20592. + /* mode_fifoctrl */ 0x2f2f2f2f,
  20593. + /* mode_toyclksrc */ 0x00000004, /* 96MHz AUXPLL directly */
  20594. + /* mode_backlight */ 0x00000000,
  20595. + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
  20596. + /* device_init */ board_au1200fb_panel_init,
  20597. + /* device_shutdown */ board_au1200fb_panel_shutdown,
  20598. + },
  20599. +
  20600. + { /* Index 6: Toshiba 640x480 TFT */
  20601. + "Toshiba_640x480_TFT",
  20602. + 640, 480,
  20603. + /* mode_screen */ LCD_SCREEN_SX_N(640) | LCD_SCREEN_SY_N(480),
  20604. + /* mode_horztiming */ LCD_HORZTIMING_HPW_N(96) | LCD_HORZTIMING_HND1_N(13) | LCD_HORZTIMING_HND2_N(51),
  20605. + /* mode_verttiming */ LCD_VERTTIMING_VPW_N(2) | LCD_VERTTIMING_VND1_N(11) | LCD_VERTTIMING_VND2_N(32) ,
  20606. + /* mode_clkcontrol */ 0x00000000, /* /4=24Mhz */
  20607. + /* mode_pwmdiv */ 0x8000063f,
  20608. + /* mode_pwmhi */ 0x03400000,
  20609. + /* mode_outmask */ 0x00fcfcfc,
  20610. + /* mode_fifoctrl */ 0x2f2f2f2f,
  20611. + /* mode_toyclksrc */ 0x00000004, /* 96MHz AUXPLL directly */
  20612. + /* mode_backlight */ 0x00000000,
  20613. + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
  20614. + /* device_init */ board_au1200fb_panel_init,
  20615. + /* device_shutdown */ board_au1200fb_panel_shutdown,
  20616. + },
  20617. +
  20618. + { /* Index 7: Sharp 320x240 TFT */
  20619. + "Sharp_320x240_TFT",
  20620. + 320, 240,
  20621. + /* mode_screen */ LCD_SCREEN_SX_N(320) | LCD_SCREEN_SY_N(240),
  20622. + /* mode_horztiming */ LCD_HORZTIMING_HPW_N(60) | LCD_HORZTIMING_HND1_N(13) | LCD_HORZTIMING_HND2_N(2),
  20623. + /* mode_verttiming */ LCD_VERTTIMING_VPW_N(2) | LCD_VERTTIMING_VND1_N(2) | LCD_VERTTIMING_VND2_N(5) ,
  20624. + /* mode_clkcontrol */ LCD_CLKCONTROL_PCD_N(7), /* /16=6Mhz */
  20625. + /* mode_pwmdiv */ 0x8000063f,
  20626. + /* mode_pwmhi */ 0x03400000,
  20627. + /* mode_outmask */ 0x00fcfcfc,
  20628. + /* mode_fifoctrl */ 0x2f2f2f2f,
  20629. + /* mode_toyclksrc */ 0x00000004, /* 96MHz AUXPLL directly */
  20630. + /* mode_backlight */ 0x00000000,
  20631. + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
  20632. + /* device_init */ board_au1200fb_panel_init,
  20633. + /* device_shutdown */ board_au1200fb_panel_shutdown,
  20634. + },
  20635. + { /* Index 8: Toppoly TD070WGCB2 7" 854x480 TFT */
  20636. + "Toppoly_TD070WGCB2",
  20637. + 854, 480,
  20638. + /* mode_screen */ LCD_SCREEN_SX_N(854) | LCD_SCREEN_SY_N(480),
  20639. + /* mode_horztiming */ LCD_HORZTIMING_HND2_N(44) | LCD_HORZTIMING_HND1_N(44) | LCD_HORZTIMING_HPW_N(114),
  20640. + /* mode_verttiming */ LCD_VERTTIMING_VND2_N(20) | LCD_VERTTIMING_VND1_N(21) | LCD_VERTTIMING_VPW_N(4),
  20641. + /* mode_clkcontrol */ 0x00020001, /* /4=24Mhz */
  20642. + /* mode_pwmdiv */ 0x8000063f,
  20643. + /* mode_pwmhi */ 0x03400000,
  20644. + /* mode_outmask */ 0x00FCFCFC,
  20645. + /* mode_fifoctrl */ 0x2f2f2f2f,
  20646. + /* mode_toyclksrc */ 0x00000004, /* AUXPLL directly */
  20647. + /* mode_backlight */ 0x00000000,
  20648. + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
  20649. + /* device_init */ board_au1200fb_panel_init,
  20650. + /* device_shutdown */ board_au1200fb_panel_shutdown,
  20651. + },
  20652. +#if defined(CONFIG_FOCUS_ENHANCEMENTS)
  20653. + { /* Index 9: Focus FS453 TV-Out 640x480 */
  20654. + "FS453_640x480 (Composite/S-Video)",
  20655. + 640, 480,
  20656. + /* mode_screen */ LCD_SCREEN_SX_N(640) | LCD_SCREEN_SY_N(480),
  20657. + /* mode_horztiming */ LCD_HORZTIMING_HND2_N(143) | LCD_HORZTIMING_HND1_N(143) | LCD_HORZTIMING_HPW_N(10),
  20658. + /* mode_verttiming */ LCD_VERTTIMING_VND2_N(30) | LCD_VERTTIMING_VND1_N(30) | LCD_VERTTIMING_VPW_N(5),
  20659. + /* mode_clkcontrol */ 0x00480000 | (1<<17) | (1<<18), /* External Clock, 1:1 clock ratio */
  20660. + /* mode_pwmdiv */ 0x00000000,
  20661. + /* mode_pwmhi */ 0x00000000,
  20662. + /* mode_outmask */ 0x00FFFFFF,
  20663. + /* mode_fifoctrl */ 0x2f2f2f2f,
  20664. + /* mode_toyclksrc */ 0x00000000,
  20665. + /* mode_backlight */ 0x00000000,
  20666. + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
  20667. + /* device_init */ board_au1200fb_focus_init_cvsv,
  20668. + /* device_shutdown */ board_au1200fb_focus_shutdown,
  20669. + },
  20670. +
  20671. + { /* Index 10: Focus FS453 TV-Out 640x480 */
  20672. + "FS453_640x480 (Component Video)",
  20673. + 640, 480,
  20674. + /* mode_screen */ LCD_SCREEN_SX_N(640) | LCD_SCREEN_SY_N(480),
  20675. + /* mode_horztiming */ LCD_HORZTIMING_HND2_N(143) | LCD_HORZTIMING_HND1_N(143) | LCD_HORZTIMING_HPW_N(10),
  20676. + /* mode_verttiming */ LCD_VERTTIMING_VND2_N(30) | LCD_VERTTIMING_VND1_N(30) | LCD_VERTTIMING_VPW_N(5),
  20677. + /* mode_clkcontrol */ 0x00480000 | (1<<17) | (1<<18), /* External Clock, 1:1 clock ratio */
  20678. + /* mode_pwmdiv */ 0x00000000,
  20679. + /* mode_pwmhi */ 0x00000000,
  20680. + /* mode_outmask */ 0x00FFFFFF,
  20681. + /* mode_fifoctrl */ 0x2f2f2f2f,
  20682. + /* mode_toyclksrc */ 0x00000000,
  20683. + /* mode_backlight */ 0x00000000,
  20684. + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
  20685. + /* device_init */ board_au1200fb_focus_init_component,
  20686. + /* device_shutdown */ board_au1200fb_focus_shutdown,
  20687. + },
  20688. +
  20689. + { /* Index 11: Focus FS453 TV-Out 640x480 */
  20690. + "FS453_640x480 (HDTV)",
  20691. + 720, 480,
  20692. + /* mode_screen */ LCD_SCREEN_SX_N(720) | LCD_SCREEN_SY_N(480),
  20693. + /* mode_horztiming */ LCD_HORZTIMING_HND2_N(28) | LCD_HORZTIMING_HND1_N(46) | LCD_HORZTIMING_HPW_N(64),
  20694. + /* mode_verttiming */ LCD_VERTTIMING_VND2_N(7) | LCD_VERTTIMING_VND1_N(31) | LCD_VERTTIMING_VPW_N(7),
  20695. + /* mode_clkcontrol */ 0x00480000 | (1<<17) | (1<<18), /* External Clock, 1:1 clock ratio */
  20696. + /* mode_pwmdiv */ 0x00000000,
  20697. + /* mode_pwmhi */ 0x00000000,
  20698. + /* mode_outmask */ 0x00FFFFFF,
  20699. + /* mode_fifoctrl */ 0x2f2f2f2f,
  20700. + /* mode_toyclksrc */ 0x00000000,
  20701. + /* mode_backlight */ 0x00000000,
  20702. + /* mode_auxpll */ 8, /* 96MHz AUXPLL */
  20703. + /* device_init */ board_au1200fb_focus_init_hdtv,
  20704. + /* device_shutdown */ board_au1200fb_focus_shutdown,
  20705. + },
  20706. +#endif
  20707. +};
  20708. +
  20709. +#define NUM_PANELS (sizeof(panels) / sizeof(struct panel_settings))
  20710. +
  20711. +static struct window_settings *win;
  20712. +static struct panel_settings *panel;
  20713. +
  20714. +struct au1200fb_info {
  20715. + struct fb_info_gen gen;
  20716. + unsigned long fb_virt_start;
  20717. + unsigned long fb_size;
  20718. + unsigned long fb_phys;
  20719. + int mmaped;
  20720. + int nohwcursor;
  20721. + int noblanking;
  20722. +
  20723. + struct { unsigned red, green, blue, pad; } palette[256];
  20724. +
  20725. +#if defined(FBCON_HAS_CFB16)
  20726. + u16 fbcon_cmap16[16];
  20727. +#endif
  20728. +#if defined(FBCON_HAS_CFB32)
  20729. + u32 fbcon_cmap32[16];
  20730. +#endif
  20731. +};
  20732. +
  20733. +
  20734. +struct au1200fb_par {
  20735. + struct fb_var_screeninfo var;
  20736. +
  20737. + int line_length; /* in bytes */
  20738. + int cmap_len; /* color-map length */
  20739. +};
  20740. +
  20741. +#ifndef CONFIG_FB_AU1200_DEVS
  20742. +#define CONFIG_FB_AU1200_DEVS 1
  20743. +#endif
  20744. +
  20745. +static struct au1200fb_info fb_infos[CONFIG_FB_AU1200_DEVS];
  20746. +static struct au1200fb_par fb_pars[CONFIG_FB_AU1200_DEVS];
  20747. +static struct display disps[CONFIG_FB_AU1200_DEVS];
  20748. +
  20749. +int au1200fb_init(void);
  20750. +void au1200fb_setup(char *options, int *ints);
  20751. +static int au1200fb_mmap(struct fb_info *fb, struct file *file,
  20752. + struct vm_area_struct *vma);
  20753. +static int au1200_blank(int blank_mode, struct fb_info_gen *info);
  20754. +static int au1200fb_ioctl(struct inode *inode, struct file *file, u_int cmd,
  20755. + u_long arg, int con, struct fb_info *info);
  20756. +
  20757. +void au1200_nocursor(struct display *p, int mode, int xx, int yy){};
  20758. +
  20759. +static int au1200_setlocation (int plane, int xpos, int ypos);
  20760. +static int au1200_setsize (int plane, int xres, int yres);
  20761. +static void au1200_setmode(int plane);
  20762. +static void au1200_setpanel (struct panel_settings *newpanel);
  20763. +
  20764. +static struct fb_ops au1200fb_ops = {
  20765. + owner: THIS_MODULE,
  20766. + fb_get_fix: fbgen_get_fix,
  20767. + fb_get_var: fbgen_get_var,
  20768. + fb_set_var: fbgen_set_var,
  20769. + fb_get_cmap: fbgen_get_cmap,
  20770. + fb_set_cmap: fbgen_set_cmap,
  20771. + fb_pan_display: fbgen_pan_display,
  20772. + fb_ioctl: au1200fb_ioctl,
  20773. + fb_mmap: au1200fb_mmap,
  20774. +};
  20775. +
  20776. +
  20777. +static int
  20778. +winbpp (unsigned int winctrl1)
  20779. +{
  20780. + /* how many bytes of memory are needed for each pixel format */
  20781. + switch (winctrl1 & LCD_WINCTRL1_FRM)
  20782. + {
  20783. + case LCD_WINCTRL1_FRM_1BPP: return 1; break;
  20784. + case LCD_WINCTRL1_FRM_2BPP: return 2; break;
  20785. + case LCD_WINCTRL1_FRM_4BPP: return 4; break;
  20786. + case LCD_WINCTRL1_FRM_8BPP: return 8; break;
  20787. + case LCD_WINCTRL1_FRM_12BPP: return 16; break;
  20788. + case LCD_WINCTRL1_FRM_16BPP655: return 16; break;
  20789. + case LCD_WINCTRL1_FRM_16BPP565: return 16; break;
  20790. + case LCD_WINCTRL1_FRM_16BPP556: return 16; break;
  20791. + case LCD_WINCTRL1_FRM_16BPPI1555: return 16; break;
  20792. + case LCD_WINCTRL1_FRM_16BPPI5551: return 16; break;
  20793. + case LCD_WINCTRL1_FRM_16BPPA1555: return 16; break;
  20794. + case LCD_WINCTRL1_FRM_16BPPA5551: return 16; break;
  20795. + case LCD_WINCTRL1_FRM_24BPP: return 32; break;
  20796. + case LCD_WINCTRL1_FRM_32BPP: return 32; break;
  20797. + default: return 0; break;
  20798. + }
  20799. +}
  20800. +
  20801. +static int
  20802. +fbinfo2index (struct fb_info *fb_info)
  20803. +{
  20804. + int i;
  20805. + for (i = 0; i < CONFIG_FB_AU1200_DEVS; ++i)
  20806. + {
  20807. + if (fb_info == (struct fb_info *)(&fb_infos[i]))
  20808. + return i;
  20809. + }
  20810. + printk("au1200fb: ERROR: fbinfo2index failed!\n");
  20811. + return -1;
  20812. +}
  20813. +
  20814. +static void au1200_detect(void)
  20815. +{
  20816. + /*
  20817. + * This function should detect the current video mode settings
  20818. + * and store it as the default video mode
  20819. + * Yeh, well, we're not going to change any settings so we're
  20820. + * always stuck with the default ...
  20821. + */
  20822. +}
  20823. +
  20824. +static int au1200_encode_fix(struct fb_fix_screeninfo *fix,
  20825. + const void *_par, struct fb_info_gen *_info)
  20826. +{
  20827. + struct au1200fb_info *info = (struct au1200fb_info *) _info;
  20828. + struct au1200fb_par *par = (struct au1200fb_par *) _par;
  20829. + int plane;
  20830. +
  20831. + plane = fbinfo2index(info);
  20832. +
  20833. + memset(fix, 0, sizeof(struct fb_fix_screeninfo));
  20834. +
  20835. + fix->smem_start = info->fb_phys;
  20836. + fix->smem_len = info->fb_size;
  20837. + fix->type = FB_TYPE_PACKED_PIXELS;
  20838. + fix->type_aux = 0;
  20839. + fix->visual = (par->var.bits_per_pixel == 8) ?
  20840. + FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
  20841. + fix->ywrapstep = 0;
  20842. + fix->xpanstep = 1;
  20843. + fix->ypanstep = 1;
  20844. + /* FIX!!!! why doesn't par->line_length work???? it does for au1100 */
  20845. + fix->line_length = fb_pars[plane].line_length; /*par->line_length;*/
  20846. + return 0;
  20847. +}
  20848. +
  20849. +static void set_color_bitfields(struct fb_var_screeninfo *var, int plane)
  20850. +{
  20851. + if (var->bits_per_pixel == 8)
  20852. + {
  20853. + var->red.offset = 0;
  20854. + var->red.length = 8;
  20855. + var->green.offset = 0;
  20856. + var->green.length = 8;
  20857. + var->blue.offset = 0;
  20858. + var->blue.length = 8;
  20859. + var->transp.offset = 0;
  20860. + var->transp.length = 0;
  20861. + }
  20862. + else
  20863. +
  20864. + if (var->bits_per_pixel == 16)
  20865. + {
  20866. + /* FIX!!! How does CCO affect this ? */
  20867. + /* FIX!!! Not exactly sure how many of these work with FB */
  20868. + switch (win->w[plane].mode_winctrl1 & LCD_WINCTRL1_FRM)
  20869. + {
  20870. + case LCD_WINCTRL1_FRM_16BPP655:
  20871. + var->red.offset = 10;
  20872. + var->red.length = 6;
  20873. + var->green.offset = 5;
  20874. + var->green.length = 5;
  20875. + var->blue.offset = 0;
  20876. + var->blue.length = 5;
  20877. + var->transp.offset = 0;
  20878. + var->transp.length = 0;
  20879. + break;
  20880. +
  20881. + case LCD_WINCTRL1_FRM_16BPP565:
  20882. + var->red.offset = 11;
  20883. + var->red.length = 5;
  20884. + var->green.offset = 5;
  20885. + var->green.length = 6;
  20886. + var->blue.offset = 0;
  20887. + var->blue.length = 5;
  20888. + var->transp.offset = 0;
  20889. + var->transp.length = 0;
  20890. + break;
  20891. +
  20892. + case LCD_WINCTRL1_FRM_16BPP556:
  20893. + var->red.offset = 11;
  20894. + var->red.length = 5;
  20895. + var->green.offset = 6;
  20896. + var->green.length = 5;
  20897. + var->blue.offset = 0;
  20898. + var->blue.length = 6;
  20899. + var->transp.offset = 0;
  20900. + var->transp.length = 0;
  20901. + break;
  20902. +
  20903. + case LCD_WINCTRL1_FRM_16BPPI1555:
  20904. + var->red.offset = 10;
  20905. + var->red.length = 5;
  20906. + var->green.offset = 5;
  20907. + var->green.length = 5;
  20908. + var->blue.offset = 0;
  20909. + var->blue.length = 5;
  20910. + var->transp.offset = 0;
  20911. + var->transp.length = 0;
  20912. + break;
  20913. +
  20914. + case LCD_WINCTRL1_FRM_16BPPI5551:
  20915. + var->red.offset = 11;
  20916. + var->red.length = 5;
  20917. + var->green.offset = 6;
  20918. + var->green.length = 5;
  20919. + var->blue.offset = 1;
  20920. + var->blue.length = 5;
  20921. + var->transp.offset = 0;
  20922. + var->transp.length = 0;
  20923. + break;
  20924. +
  20925. + case LCD_WINCTRL1_FRM_16BPPA1555:
  20926. + var->red.offset = 10;
  20927. + var->red.length = 5;
  20928. + var->green.offset = 5;
  20929. + var->green.length = 5;
  20930. + var->blue.offset = 0;
  20931. + var->blue.length = 5;
  20932. + var->transp.offset = 15;
  20933. + var->transp.length = 1;
  20934. + break;
  20935. +
  20936. + case LCD_WINCTRL1_FRM_16BPPA5551:
  20937. + var->red.offset = 11;
  20938. + var->red.length = 5;
  20939. + var->green.offset = 6;
  20940. + var->green.length = 5;
  20941. + var->blue.offset = 1;
  20942. + var->blue.length = 5;
  20943. + var->transp.offset = 0;
  20944. + var->transp.length = 1;
  20945. + break;
  20946. +
  20947. + default:
  20948. + printk("ERROR: Invalid PIXEL FORMAT!!!\n"); break;
  20949. + }
  20950. + }
  20951. + else
  20952. +
  20953. + if (var->bits_per_pixel == 32)
  20954. + {
  20955. + switch (win->w[plane].mode_winctrl1 & LCD_WINCTRL1_FRM)
  20956. + {
  20957. + case LCD_WINCTRL1_FRM_24BPP:
  20958. + var->red.offset = 16;
  20959. + var->red.length = 8;
  20960. + var->green.offset = 8;
  20961. + var->green.length = 8;
  20962. + var->blue.offset = 0;
  20963. + var->blue.length = 8;
  20964. + var->transp.offset = 0;
  20965. + var->transp.length = 0;
  20966. + break;
  20967. +
  20968. + case LCD_WINCTRL1_FRM_32BPP:
  20969. + var->red.offset = 16;
  20970. + var->red.length = 8;
  20971. + var->green.offset = 8;
  20972. + var->green.length = 8;
  20973. + var->blue.offset = 0;
  20974. + var->blue.length = 8;
  20975. + var->transp.offset = 24;
  20976. + var->transp.length = 8;
  20977. + break;
  20978. + }
  20979. + }
  20980. + var->red.msb_right = 0;
  20981. + var->green.msb_right = 0;
  20982. + var->blue.msb_right = 0;
  20983. + var->transp.msb_right = 0;
  20984. +#if 0
  20985. +printk("set_color_bitfields(a=%d, r=%d..%d, g=%d..%d, b=%d..%d)\n",
  20986. + var->transp.offset,
  20987. + var->red.offset+var->red.length-1, var->red.offset,
  20988. + var->green.offset+var->green.length-1, var->green.offset,
  20989. + var->blue.offset+var->blue.length-1, var->blue.offset);
  20990. +#endif
  20991. +}
  20992. +
  20993. +static int au1200_decode_var(const struct fb_var_screeninfo *var,
  20994. + void *_par, struct fb_info_gen *_info)
  20995. +{
  20996. + struct au1200fb_par *par = (struct au1200fb_par *)_par;
  20997. + int plane, bpp;
  20998. +
  20999. + plane = fbinfo2index((struct fb_info *)_info);
  21000. +
  21001. + /*
  21002. + * Don't allow setting any of these yet: xres and yres don't
  21003. + * make sense for LCD panels.
  21004. + */
  21005. + if (var->xres != win->w[plane].xres ||
  21006. + var->yres != win->w[plane].yres ||
  21007. + var->xres != win->w[plane].xres ||
  21008. + var->yres != win->w[plane].yres) {
  21009. + return -EINVAL;
  21010. + }
  21011. +
  21012. + bpp = winbpp(win->w[plane].mode_winctrl1);
  21013. + if(var->bits_per_pixel != bpp) {
  21014. + /* on au1200, window pixel format is independent of panel pixel */
  21015. + printk("WARNING: bits_per_pizel != panel->bpp\n");
  21016. + }
  21017. +
  21018. + memset(par, 0, sizeof(struct au1200fb_par));
  21019. + par->var = *var;
  21020. +
  21021. + /* FIX!!! */
  21022. + switch (var->bits_per_pixel) {
  21023. + case 8:
  21024. + par->var.bits_per_pixel = 8;
  21025. + break;
  21026. + case 16:
  21027. + par->var.bits_per_pixel = 16;
  21028. + break;
  21029. + case 24:
  21030. + case 32:
  21031. + par->var.bits_per_pixel = 32;
  21032. + break;
  21033. + default:
  21034. + printk("color depth %d bpp not supported\n",
  21035. + var->bits_per_pixel);
  21036. + return -EINVAL;
  21037. +
  21038. + }
  21039. + set_color_bitfields(&par->var, plane);
  21040. + /* FIX!!! what is this for 24/32bpp? */
  21041. + par->cmap_len = (par->var.bits_per_pixel == 8) ? 256 : 16;
  21042. + return 0;
  21043. +}
  21044. +
  21045. +static int au1200_encode_var(struct fb_var_screeninfo *var,
  21046. + const void *par, struct fb_info_gen *_info)
  21047. +{
  21048. + *var = ((struct au1200fb_par *)par)->var;
  21049. + return 0;
  21050. +}
  21051. +
  21052. +static void
  21053. +au1200_get_par(void *_par, struct fb_info_gen *_info)
  21054. +{
  21055. + int index;
  21056. +
  21057. + index = fbinfo2index((struct fb_info *)_info);
  21058. + *(struct au1200fb_par *)_par = fb_pars[index];
  21059. +}
  21060. +
  21061. +static void au1200_set_par(const void *par, struct fb_info_gen *info)
  21062. +{
  21063. + /* nothing to do: we don't change any settings */
  21064. +}
  21065. +
  21066. +static int au1200_getcolreg(unsigned regno, unsigned *red, unsigned *green,
  21067. + unsigned *blue, unsigned *transp,
  21068. + struct fb_info *info)
  21069. +{
  21070. + struct au1200fb_info* i = (struct au1200fb_info*)info;
  21071. +
  21072. + if (regno > 255)
  21073. + return 1;
  21074. +
  21075. + *red = i->palette[regno].red;
  21076. + *green = i->palette[regno].green;
  21077. + *blue = i->palette[regno].blue;
  21078. + *transp = 0;
  21079. +
  21080. + return 0;
  21081. +}
  21082. +
  21083. +static int au1200_setcolreg(unsigned regno, unsigned red, unsigned green,
  21084. + unsigned blue, unsigned transp,
  21085. + struct fb_info *info)
  21086. +{
  21087. + struct au1200fb_info* i = (struct au1200fb_info *)info;
  21088. + u32 rgbcol;
  21089. + int plane, bpp;
  21090. +
  21091. + plane = fbinfo2index((struct fb_info *)info);
  21092. + bpp = winbpp(win->w[plane].mode_winctrl1);
  21093. +
  21094. + if (regno > 255)
  21095. + return 1;
  21096. +
  21097. + i->palette[regno].red = red;
  21098. + i->palette[regno].green = green;
  21099. + i->palette[regno].blue = blue;
  21100. +
  21101. + switch(bpp) {
  21102. +#ifdef FBCON_HAS_CFB8
  21103. + case 8:
  21104. + red >>= 10;
  21105. + green >>= 10;
  21106. + blue >>= 10;
  21107. + panel_reg->lcd_pallettebase[regno] = (blue&0x1f) |
  21108. + ((green&0x3f)<<5) | ((red&0x1f)<<11);
  21109. + break;
  21110. +#endif
  21111. +#ifdef FBCON_HAS_CFB16
  21112. +/* FIX!!!! depends upon pixel format */
  21113. + case 16:
  21114. + i->fbcon_cmap16[regno] =
  21115. + ((red & 0xf800) >> 0) |
  21116. + ((green & 0xfc00) >> 5) |
  21117. + ((blue & 0xf800) >> 11);
  21118. + break;
  21119. +#endif
  21120. +#ifdef FBCON_HAS_CFB32
  21121. + case 32:
  21122. + i->fbcon_cmap32[regno] =
  21123. + (((u32 )transp & 0xff00) << 16) |
  21124. + (((u32 )red & 0xff00) << 8) |
  21125. + (((u32 )green & 0xff00)) |
  21126. + (((u32 )blue & 0xff00) >> 8);
  21127. + break;
  21128. +#endif
  21129. + default:
  21130. + printk("unsupported au1200_setcolreg(%d)\n", bpp);
  21131. + break;
  21132. + }
  21133. +
  21134. + return 0;
  21135. +}
  21136. +
  21137. +
  21138. +static int au1200_blank(int blank_mode, struct fb_info_gen *_info)
  21139. +{
  21140. + struct au1200fb_info *fb_info = (struct au1200fb_info *)_info;
  21141. + int plane;
  21142. +
  21143. + /* Short-circuit screen blanking */
  21144. + if (fb_info->noblanking)
  21145. + return 0;
  21146. +
  21147. + plane = fbinfo2index((struct fb_info *)_info);
  21148. +
  21149. + switch (blank_mode) {
  21150. + case VESA_NO_BLANKING:
  21151. + /* printk("turn on panel\n"); */
  21152. + au1200_setpanel(panel);
  21153. + break;
  21154. +
  21155. + case VESA_VSYNC_SUSPEND:
  21156. + case VESA_HSYNC_SUSPEND:
  21157. + case VESA_POWERDOWN:
  21158. + /* printk("turn off panel\n"); */
  21159. + au1200_setpanel(NULL);
  21160. + break;
  21161. + default:
  21162. + break;
  21163. +
  21164. + }
  21165. + return 0;
  21166. +}
  21167. +
  21168. +static void au1200_set_disp(const void *unused, struct display *disp,
  21169. + struct fb_info_gen *info)
  21170. +{
  21171. + struct au1200fb_info *fb_info;
  21172. + int plane;
  21173. +
  21174. + fb_info = (struct au1200fb_info *)info;
  21175. +
  21176. + disp->screen_base = (char *)fb_info->fb_virt_start;
  21177. +
  21178. + switch (disp->var.bits_per_pixel) {
  21179. +#ifdef FBCON_HAS_CFB8
  21180. + case 8:
  21181. + disp->dispsw = &fbcon_cfb8;
  21182. + if (fb_info->nohwcursor)
  21183. + fbcon_cfb8.cursor = au1200_nocursor;
  21184. + break;
  21185. +#endif
  21186. +#ifdef FBCON_HAS_CFB16
  21187. + case 16:
  21188. + disp->dispsw = &fbcon_cfb16;
  21189. + disp->dispsw_data = fb_info->fbcon_cmap16;
  21190. + if (fb_info->nohwcursor)
  21191. + fbcon_cfb16.cursor = au1200_nocursor;
  21192. + break;
  21193. +#endif
  21194. +#ifdef FBCON_HAS_CFB32
  21195. + case 32:
  21196. + disp->dispsw = &fbcon_cfb32;
  21197. + disp->dispsw_data = fb_info->fbcon_cmap32;
  21198. + if (fb_info->nohwcursor)
  21199. + fbcon_cfb32.cursor = au1200_nocursor;
  21200. + break;
  21201. +#endif
  21202. + default:
  21203. + disp->dispsw = &fbcon_dummy;
  21204. + disp->dispsw_data = NULL;
  21205. + break;
  21206. + }
  21207. +}
  21208. +
  21209. +static int
  21210. +au1200fb_mmap(struct fb_info *_fb,
  21211. + struct file *file,
  21212. + struct vm_area_struct *vma)
  21213. +{
  21214. + unsigned int len;
  21215. + unsigned long start=0, off;
  21216. +
  21217. + struct au1200fb_info *fb_info = (struct au1200fb_info *)_fb;
  21218. +
  21219. + if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) {
  21220. + return -EINVAL;
  21221. + }
  21222. +
  21223. + start = fb_info->fb_phys & PAGE_MASK;
  21224. + len = PAGE_ALIGN((start & ~PAGE_MASK) + fb_info->fb_size);
  21225. +
  21226. + off = vma->vm_pgoff << PAGE_SHIFT;
  21227. +
  21228. + if ((vma->vm_end - vma->vm_start + off) > len) {
  21229. + return -EINVAL;
  21230. + }
  21231. +
  21232. + off += start;
  21233. + vma->vm_pgoff = off >> PAGE_SHIFT;
  21234. +
  21235. + pgprot_val(vma->vm_page_prot) &= ~_CACHE_MASK;
  21236. + pgprot_val(vma->vm_page_prot) |= _CACHE_UNCACHED;
  21237. +
  21238. + /* This is an IO map - tell maydump to skip this VMA */
  21239. + vma->vm_flags |= VM_IO;
  21240. +
  21241. + if (io_remap_page_range(vma->vm_start, off,
  21242. + vma->vm_end - vma->vm_start,
  21243. + vma->vm_page_prot)) {
  21244. + return -EAGAIN;
  21245. + }
  21246. +
  21247. + fb_info->mmaped = 1;
  21248. + return 0;
  21249. +}
  21250. +
  21251. +int au1200_pan_display(const struct fb_var_screeninfo *var,
  21252. + struct fb_info_gen *info)
  21253. +{
  21254. + return 0;
  21255. +}
  21256. +
  21257. +
  21258. +static int au1200fb_ioctl(struct inode *inode, struct file *file, u_int cmd,
  21259. + u_long arg, int con, struct fb_info *info)
  21260. +{
  21261. + int plane;
  21262. +
  21263. + plane = fbinfo2index(info);
  21264. +
  21265. + /* printk("au1200fb: ioctl %d on plane %d\n", cmd, plane); */
  21266. +
  21267. + if (cmd == 0x46FF)
  21268. + {
  21269. + au1200_lcd_getset_t iodata;
  21270. +
  21271. + if (copy_from_user(&iodata, (void *) arg, sizeof(au1200_lcd_getset_t)))
  21272. + return -EFAULT;
  21273. +
  21274. + switch (iodata.subcmd)
  21275. + {
  21276. + case AU1200_LCD_GET_WINENABLE:
  21277. + iodata.winenable.enable = (lcd->winenable & (1<<plane)) ? 1 : 0;
  21278. + break;
  21279. + case AU1200_LCD_SET_WINENABLE:
  21280. + {
  21281. + u32 winenable;
  21282. + winenable = lcd->winenable;
  21283. + winenable &= ~(1<<plane);
  21284. + winenable |= (iodata.winenable.enable) ? (1<<plane) : 0;
  21285. + lcd->winenable = winenable;
  21286. + }
  21287. + break;
  21288. + case AU1200_LCD_GET_WINLOCATION:
  21289. + iodata.winlocation.x =
  21290. + (lcd->window[plane].winctrl0 & LCD_WINCTRL0_OX) >> 21;
  21291. + iodata.winlocation.y =
  21292. + (lcd->window[plane].winctrl0 & LCD_WINCTRL0_OY) >> 10;
  21293. + break;
  21294. + case AU1200_LCD_SET_WINLOCATION:
  21295. + au1200_setlocation(plane, iodata.winlocation.x, iodata.winlocation.y);
  21296. + break;
  21297. + case AU1200_LCD_GET_WINSIZE:
  21298. + iodata.winsize.hsz =
  21299. + (lcd->window[plane].winctrl1 & LCD_WINCTRL1_SZX) >> 11;
  21300. + iodata.winsize.vsz =
  21301. + (lcd->window[plane].winctrl0 & LCD_WINCTRL1_SZY) >> 0;
  21302. + break;
  21303. + case AU1200_LCD_SET_WINSIZE:
  21304. + au1200_setsize(plane, iodata.winsize.hsz, iodata.winsize.vsz);
  21305. + break;
  21306. + case AU1200_LCD_GET_BACKCOLOR:
  21307. + iodata.backcolor.color = lcd->backcolor;
  21308. + break;
  21309. + case AU1200_LCD_SET_BACKCOLOR:
  21310. + lcd->backcolor = iodata.backcolor.color;
  21311. + break;
  21312. + case AU1200_LCD_GET_COLORKEY:
  21313. + iodata.colorkey.key = lcd->colorkey;
  21314. + iodata.colorkey.mask = lcd->colorkeymsk;
  21315. + break;
  21316. + case AU1200_LCD_SET_COLORKEY:
  21317. + lcd->colorkey = iodata.colorkey.key;
  21318. + lcd->colorkeymsk = iodata.colorkey.mask;
  21319. + break;
  21320. + case AU1200_LCD_GET_PANEL:
  21321. + iodata.panel.panel = panel_index;
  21322. + break;
  21323. + case AU1200_LCD_SET_PANEL:
  21324. + if ((iodata.panel.panel >= 0) && (iodata.panel.panel < NUM_PANELS))
  21325. + {
  21326. + struct panel_settings *newpanel;
  21327. + panel_index = iodata.panel.panel;
  21328. + newpanel = &panels[panel_index];
  21329. + au1200_setpanel(newpanel);
  21330. + }
  21331. + break;
  21332. + }
  21333. +
  21334. + return copy_to_user((void *) arg, &iodata, sizeof(au1200_lcd_getset_t)) ? -EFAULT : 0;
  21335. + }
  21336. +
  21337. + return -EINVAL;
  21338. +}
  21339. +
  21340. +static struct fbgen_hwswitch au1200_switch = {
  21341. + au1200_detect,
  21342. + au1200_encode_fix,
  21343. + au1200_decode_var,
  21344. + au1200_encode_var,
  21345. + au1200_get_par,
  21346. + au1200_set_par,
  21347. + au1200_getcolreg,
  21348. + au1200_setcolreg,
  21349. + au1200_pan_display,
  21350. + au1200_blank,
  21351. + au1200_set_disp
  21352. +};
  21353. +
  21354. +static void au1200_setpanel (struct panel_settings *newpanel)
  21355. +{
  21356. + /*
  21357. + * Perform global setup/init of LCD controller
  21358. + */
  21359. + uint32 winenable;
  21360. +
  21361. + /* Make sure all windows disabled */
  21362. + winenable = lcd->winenable;
  21363. + lcd->winenable = 0;
  21364. +
  21365. + /*
  21366. + * Ensure everything is disabled before reconfiguring
  21367. + */
  21368. + if (lcd->screen & LCD_SCREEN_SEN)
  21369. + {
  21370. + /* Wait for vertical sync period */
  21371. + lcd->intstatus = LCD_INT_SS;
  21372. + while ((lcd->intstatus & LCD_INT_SS) == 0)
  21373. + ;
  21374. +
  21375. + lcd->screen &= ~LCD_SCREEN_SEN; /*disable the controller*/
  21376. +
  21377. + do
  21378. + {
  21379. + lcd->intstatus = lcd->intstatus; /*clear interrupts*/
  21380. + }
  21381. + /*wait for controller to shut down*/
  21382. + while ((lcd->intstatus & LCD_INT_SD) == 0);
  21383. +
  21384. + /* Call shutdown of current panel (if up) */
  21385. + /* this must occur last, because if an external clock is driving
  21386. + the controller, the clock cannot be turned off before first
  21387. + shutting down the controller.
  21388. + */
  21389. + if (panel->device_shutdown != NULL) panel->device_shutdown();
  21390. + }
  21391. +
  21392. + /* Check if only needing to turn off panel */
  21393. + if (panel == NULL) return;
  21394. +
  21395. + panel = newpanel;
  21396. +
  21397. + printk("Panel(%s), %dx%d\n", panel->name, panel->Xres, panel->Yres);
  21398. +
  21399. + /*
  21400. + * Setup clocking if internal LCD clock source (assumes sys_auxpll valid)
  21401. + */
  21402. + if (!(panel->mode_clkcontrol & LCD_CLKCONTROL_EXT))
  21403. + {
  21404. + uint32 sys_clksrc;
  21405. + /* WARNING! This should really be a check since other peripherals can
  21406. + be affected by changins sys_auxpll */
  21407. + au_writel(panel->mode_auxpll, SYS_AUXPLL);
  21408. + sys_clksrc = au_readl(SYS_CLKSRC) & ~0x0000001f;
  21409. + sys_clksrc |= panel->mode_toyclksrc;
  21410. + au_writel(sys_clksrc, SYS_CLKSRC);
  21411. + }
  21412. +
  21413. + /*
  21414. + * Configure panel timings
  21415. + */
  21416. + lcd->screen = panel->mode_screen;
  21417. + lcd->horztiming = panel->mode_horztiming;
  21418. + lcd->verttiming = panel->mode_verttiming;
  21419. + lcd->clkcontrol = panel->mode_clkcontrol;
  21420. + lcd->pwmdiv = panel->mode_pwmdiv;
  21421. + lcd->pwmhi = panel->mode_pwmhi;
  21422. + lcd->outmask = panel->mode_outmask;
  21423. + lcd->fifoctrl = panel->mode_fifoctrl;
  21424. + au_sync();
  21425. +
  21426. + /* FIX!!! Check window settings to make sure still valid for new geometry */
  21427. + au1200_setlocation(0, win->w[0].xpos, win->w[0].ypos);
  21428. + au1200_setlocation(1, win->w[1].xpos, win->w[1].ypos);
  21429. + au1200_setlocation(2, win->w[2].xpos, win->w[2].ypos);
  21430. + au1200_setlocation(3, win->w[3].xpos, win->w[3].ypos);
  21431. + lcd->winenable = winenable;
  21432. +
  21433. + /*
  21434. + * Re-enable screen now that it is configured
  21435. + */
  21436. + lcd->screen |= LCD_SCREEN_SEN;
  21437. + au_sync();
  21438. +
  21439. + /* Call init of panel */
  21440. + if (panel->device_init != NULL) panel->device_init();
  21441. +
  21442. +#if 0
  21443. +#define D(X) printk("%25s: %08X\n", #X, X)
  21444. + D(lcd->screen);
  21445. + D(lcd->horztiming);
  21446. + D(lcd->verttiming);
  21447. + D(lcd->clkcontrol);
  21448. + D(lcd->pwmdiv);
  21449. + D(lcd->pwmhi);
  21450. + D(lcd->outmask);
  21451. + D(lcd->fifoctrl);
  21452. + D(lcd->window[0].winctrl0);
  21453. + D(lcd->window[0].winctrl1);
  21454. + D(lcd->window[0].winctrl2);
  21455. + D(lcd->window[0].winbuf0);
  21456. + D(lcd->window[0].winbuf1);
  21457. + D(lcd->window[0].winbufctrl);
  21458. + D(lcd->window[1].winctrl0);
  21459. + D(lcd->window[1].winctrl1);
  21460. + D(lcd->window[1].winctrl2);
  21461. + D(lcd->window[1].winbuf0);
  21462. + D(lcd->window[1].winbuf1);
  21463. + D(lcd->window[1].winbufctrl);
  21464. + D(lcd->window[2].winctrl0);
  21465. + D(lcd->window[2].winctrl1);
  21466. + D(lcd->window[2].winctrl2);
  21467. + D(lcd->window[2].winbuf0);
  21468. + D(lcd->window[2].winbuf1);
  21469. + D(lcd->window[2].winbufctrl);
  21470. + D(lcd->window[3].winctrl0);
  21471. + D(lcd->window[3].winctrl1);
  21472. + D(lcd->window[3].winctrl2);
  21473. + D(lcd->window[3].winbuf0);
  21474. + D(lcd->window[3].winbuf1);
  21475. + D(lcd->window[3].winbufctrl);
  21476. + D(lcd->winenable);
  21477. + D(lcd->intenable);
  21478. + D(lcd->intstatus);
  21479. + D(lcd->backcolor);
  21480. + D(lcd->winenable);
  21481. + D(lcd->colorkey);
  21482. + D(lcd->colorkeymsk);
  21483. + D(lcd->hwc.cursorctrl);
  21484. + D(lcd->hwc.cursorpos);
  21485. + D(lcd->hwc.cursorcolor0);
  21486. + D(lcd->hwc.cursorcolor1);
  21487. + D(lcd->hwc.cursorcolor2);
  21488. + D(lcd->hwc.cursorcolor3);
  21489. +#endif
  21490. +}
  21491. +
  21492. +static int au1200_setsize (int plane, int xres, int yres)
  21493. +{
  21494. +#if 0
  21495. + uint32 winctrl0, winctrl1, winenable;
  21496. + int xsz, ysz;
  21497. +
  21498. + /* FIX!!! X*Y can not surpass allocated memory */
  21499. +
  21500. + printk("setsize: x %d y %d\n", xres, yres);
  21501. + winctrl1 = lcd->window[plane].winctrl1;
  21502. + printk("org winctrl1 %08X\n", winctrl1);
  21503. + winctrl1 &= ~(LCD_WINCTRL1_SZX | LCD_WINCTRL1_SZY);
  21504. +
  21505. + xres -= 1;
  21506. + yres -= 1;
  21507. + winctrl1 |= (xres << 11);
  21508. + winctrl1 |= (yres << 0);
  21509. +
  21510. + printk("new winctrl1 %08X\n", winctrl1);
  21511. +
  21512. + /*winenable = lcd->winenable & (1 << plane); */
  21513. + /*lcd->winenable &= ~(1 << plane); */
  21514. + lcd->window[plane].winctrl1 = winctrl1;
  21515. + /*lcd->winenable |= winenable; */
  21516. +#endif
  21517. + return 0;
  21518. +}
  21519. +
  21520. +static int au1200_setlocation (int plane, int xpos, int ypos)
  21521. +{
  21522. + uint32 winctrl0, winctrl1, winenable, fb_offset = 0;
  21523. + int xsz, ysz;
  21524. +
  21525. + /* FIX!!! NOT CHECKING FOR COMPLETE OFFSCREEN YET */
  21526. +
  21527. + winctrl0 = lcd->window[plane].winctrl0;
  21528. + winctrl1 = lcd->window[plane].winctrl1;
  21529. + winctrl0 &= (LCD_WINCTRL0_A | LCD_WINCTRL0_AEN);
  21530. + winctrl1 &= ~(LCD_WINCTRL1_SZX | LCD_WINCTRL1_SZY);
  21531. +
  21532. + /* Check for off-screen adjustments */
  21533. + xsz = win->w[plane].xres;
  21534. + ysz = win->w[plane].yres;
  21535. + if ((xpos + win->w[plane].xres) > panel->Xres)
  21536. + {
  21537. + /* Off-screen to the right */
  21538. + xsz = panel->Xres - xpos; /* off by 1 ??? */
  21539. + /*printk("off screen right\n");*/
  21540. + }
  21541. +
  21542. + if ((ypos + win->w[plane].yres) > panel->Yres)
  21543. + {
  21544. + /* Off-screen to the bottom */
  21545. + ysz = panel->Yres - ypos; /* off by 1 ??? */
  21546. + /*printk("off screen bottom\n");*/
  21547. + }
  21548. +
  21549. + if (xpos < 0)
  21550. + {
  21551. + /* Off-screen to the left */
  21552. + xsz = win->w[plane].xres + xpos;
  21553. + fb_offset += (((0 - xpos) * winbpp(lcd->window[plane].winctrl1))/8);
  21554. + xpos = 0;
  21555. + /*printk("off screen left\n");*/
  21556. + }
  21557. +
  21558. + if (ypos < 0)
  21559. + {
  21560. + /* Off-screen to the top */
  21561. + ysz = win->w[plane].yres + ypos;
  21562. + fb_offset += ((0 - ypos) * fb_pars[plane].line_length);
  21563. + ypos = 0;
  21564. + /*printk("off screen top\n");*/
  21565. + }
  21566. +
  21567. + /* record settings */
  21568. + win->w[plane].xpos = xpos;
  21569. + win->w[plane].ypos = ypos;
  21570. +
  21571. + xsz -= 1;
  21572. + ysz -= 1;
  21573. + winctrl0 |= (xpos << 21);
  21574. + winctrl0 |= (ypos << 10);
  21575. + winctrl1 |= (xsz << 11);
  21576. + winctrl1 |= (ysz << 0);
  21577. +
  21578. + /* Disable the window while making changes, then restore WINEN */
  21579. + winenable = lcd->winenable & (1 << plane);
  21580. + lcd->winenable &= ~(1 << plane);
  21581. + lcd->window[plane].winctrl0 = winctrl0;
  21582. + lcd->window[plane].winctrl1 = winctrl1;
  21583. + lcd->window[plane].winbuf0 =
  21584. + lcd->window[plane].winbuf1 = fb_infos[plane].fb_phys + fb_offset;
  21585. + lcd->window[plane].winbufctrl = 0; /* select winbuf0 */
  21586. + lcd->winenable |= winenable;
  21587. +
  21588. + return 0;
  21589. +}
  21590. +
  21591. +static void au1200_setmode(int plane)
  21592. +{
  21593. + /* Window/plane setup */
  21594. + lcd->window[plane].winctrl1 = ( 0
  21595. + | LCD_WINCTRL1_PRI_N(plane)
  21596. + | win->w[plane].mode_winctrl1 /* FRM,CCO,PO,PIPE */
  21597. + ) ;
  21598. +
  21599. + au1200_setlocation(plane, win->w[plane].xpos, win->w[plane].ypos);
  21600. +
  21601. + lcd->window[plane].winctrl2 = ( 0
  21602. + | LCD_WINCTRL2_CKMODE_00
  21603. + | LCD_WINCTRL2_DBM
  21604. +/* | LCD_WINCTRL2_RAM */
  21605. + | LCD_WINCTRL2_BX_N(fb_pars[plane].line_length)
  21606. + | LCD_WINCTRL2_SCX_1
  21607. + | LCD_WINCTRL2_SCY_1
  21608. + ) ;
  21609. + lcd->winenable |= win->w[plane].mode_winenable;
  21610. + au_sync();
  21611. +
  21612. +}
  21613. +
  21614. +static unsigned long
  21615. +au1200fb_alloc_fbmem (unsigned long size)
  21616. +{
  21617. + /* __get_free_pages() fulfills a max request of 2MB */
  21618. + /* do multiple requests to obtain large contigous mem */
  21619. +#define MAX_GFP 0x00200000
  21620. +
  21621. + unsigned long mem, amem, alloced = 0, allocsize;
  21622. +
  21623. + size += 0x1000;
  21624. + allocsize = (size < MAX_GFP) ? size : MAX_GFP;
  21625. +
  21626. + /* Get first chunk */
  21627. + mem = (unsigned long )
  21628. + __get_free_pages(GFP_ATOMIC | GFP_DMA, get_order(allocsize));
  21629. + if (mem != 0) alloced = allocsize;
  21630. +
  21631. + /* Get remaining, contiguous chunks */
  21632. + while (alloced < size)
  21633. + {
  21634. + amem = (unsigned long )
  21635. + __get_free_pages(GFP_ATOMIC | GFP_DMA, get_order(allocsize));
  21636. + if (amem != 0)
  21637. + alloced += allocsize;
  21638. +
  21639. + /* check for contiguous mem alloced */
  21640. + if ((amem == 0) || (amem + allocsize) != mem)
  21641. + break;
  21642. + else
  21643. + mem = amem;
  21644. + }
  21645. + return mem;
  21646. +}
  21647. +
  21648. +int __init au1200fb_init(void)
  21649. +{
  21650. + int num_panels = sizeof(panels)/sizeof(struct panel_settings);
  21651. + struct au1200fb_info *fb_info;
  21652. + struct display *disp;
  21653. + struct au1200fb_par *par;
  21654. + unsigned long page;
  21655. + int plane, bpp;
  21656. +
  21657. + /*
  21658. + * Get the panel information/display mode
  21659. + */
  21660. + if (panel_index < 0)
  21661. + panel_index = board_au1200fb_panel();
  21662. + if ((panel_index < 0) || (panel_index >= num_panels)) {
  21663. + printk("ERROR: INVALID PANEL %d\n", panel_index);
  21664. + return -EINVAL;
  21665. + }
  21666. + panel = &panels[panel_index];
  21667. + win = &windows[window_index];
  21668. +
  21669. + printk("au1200fb: Panel %d %s\n", panel_index, panel->name);
  21670. + printk("au1200fb: Win %d %s\n", window_index, win->name);
  21671. +
  21672. + /* Global setup/init */
  21673. + au1200_setpanel(panel);
  21674. + lcd->intenable = 0;
  21675. + lcd->intstatus = ~0;
  21676. + lcd->backcolor = win->mode_backcolor;
  21677. + lcd->winenable = 0;
  21678. +
  21679. + /* Setup Color Key - FIX!!! */
  21680. + lcd->colorkey = win->mode_colorkey;
  21681. + lcd->colorkeymsk = win->mode_colorkeymsk;
  21682. +
  21683. + /* Setup HWCursor - FIX!!! Need to support this eventually */
  21684. + lcd->hwc.cursorctrl = 0;
  21685. + lcd->hwc.cursorpos = 0;
  21686. + lcd->hwc.cursorcolor0 = 0;
  21687. + lcd->hwc.cursorcolor1 = 0;
  21688. + lcd->hwc.cursorcolor2 = 0;
  21689. + lcd->hwc.cursorcolor3 = 0;
  21690. +
  21691. + /* Register each plane as a frame buffer device */
  21692. + for (plane = 0; plane < CONFIG_FB_AU1200_DEVS; ++plane)
  21693. + {
  21694. + fb_info = &fb_infos[plane];
  21695. + disp = &disps[plane];
  21696. + par = &fb_pars[plane];
  21697. +
  21698. + bpp = winbpp(win->w[plane].mode_winctrl1);
  21699. + if (win->w[plane].xres == 0)
  21700. + win->w[plane].xres = panel->Xres;
  21701. + if (win->w[plane].yres == 0)
  21702. + win->w[plane].yres = panel->Yres;
  21703. +
  21704. + par->var.xres =
  21705. + par->var.xres_virtual = win->w[plane].xres;
  21706. + par->var.yres =
  21707. + par->var.yres_virtual = win->w[plane].yres;
  21708. + par->var.bits_per_pixel = bpp;
  21709. + par->line_length = win->w[plane].xres * bpp / 8; /* in bytes */
  21710. + /*
  21711. + * Allocate LCD framebuffer from system memory
  21712. + * Set page reserved so that mmap will work. This is necessary
  21713. + * since we'll be remapping normal memory.
  21714. + */
  21715. + fb_info->fb_size = (win->w[plane].xres * win->w[plane].yres * bpp) / 8;
  21716. + fb_info->fb_virt_start = au1200fb_alloc_fbmem(fb_info->fb_size);
  21717. + if (!fb_info->fb_virt_start) {
  21718. + printk("Unable to allocate fb memory\n");
  21719. + return -ENOMEM;
  21720. + }
  21721. + fb_info->fb_phys = virt_to_bus((void *)fb_info->fb_virt_start);
  21722. + for (page = fb_info->fb_virt_start;
  21723. + page < PAGE_ALIGN(fb_info->fb_virt_start + fb_info->fb_size);
  21724. + page += PAGE_SIZE) {
  21725. + SetPageReserved(virt_to_page(page));
  21726. + }
  21727. + /* Convert to kseg1 */
  21728. + fb_info->fb_virt_start =
  21729. + (void *)((u32)fb_info->fb_virt_start | 0xA0000000);
  21730. + /* FIX!!! may wish to avoid this to save startup time??? */
  21731. + memset((void *)fb_info->fb_virt_start, 0, fb_info->fb_size);
  21732. +
  21733. + fb_info->gen.parsize = sizeof(struct au1200fb_par);
  21734. + fb_info->gen.fbhw = &au1200_switch;
  21735. + strcpy(fb_info->gen.info.modename, "Au1200 LCD");
  21736. + fb_info->gen.info.changevar = NULL;
  21737. + fb_info->gen.info.node = -1;
  21738. +
  21739. + fb_info->gen.info.fbops = &au1200fb_ops;
  21740. + fb_info->gen.info.disp = disp;
  21741. + fb_info->gen.info.switch_con = &fbgen_switch;
  21742. + fb_info->gen.info.updatevar = &fbgen_update_var;
  21743. + fb_info->gen.info.blank = &fbgen_blank;
  21744. + fb_info->gen.info.flags = FBINFO_FLAG_DEFAULT;
  21745. +
  21746. + fb_info->nohwcursor = 1;
  21747. + fb_info->noblanking = 1;
  21748. +
  21749. + /* This should give a reasonable default video mode */
  21750. + fbgen_get_var(&disp->var, -1, &fb_info->gen.info);
  21751. + fbgen_do_set_var(&disp->var, 1, &fb_info->gen);
  21752. + fbgen_set_disp(-1, &fb_info->gen);
  21753. + fbgen_install_cmap(0, &fb_info->gen);
  21754. +
  21755. + /* Turn on plane */
  21756. + au1200_setmode(plane);
  21757. +
  21758. + if (register_framebuffer(&fb_info->gen.info) < 0)
  21759. + return -EINVAL;
  21760. +
  21761. + printk(KERN_INFO "fb%d: %s plane %d @ %08X (%d x %d x %d)\n",
  21762. + GET_FB_IDX(fb_info->gen.info.node),
  21763. + fb_info->gen.info.modename, plane, fb_info->fb_phys,
  21764. + win->w[plane].xres, win->w[plane].yres, bpp);
  21765. + }
  21766. + /* uncomment this if your driver cannot be unloaded */
  21767. + /* MOD_INC_USE_COUNT; */
  21768. + return 0;
  21769. +}
  21770. +
  21771. +void au1200fb_setup(char *options, int *ints)
  21772. +{
  21773. + char* this_opt;
  21774. + int i;
  21775. + int num_panels = sizeof(panels)/sizeof(struct panel_settings);
  21776. +
  21777. + if (!options || !*options)
  21778. + return;
  21779. +
  21780. + for(this_opt=strtok(options, ","); this_opt;
  21781. + this_opt=strtok(NULL, ",")) {
  21782. + if (!strncmp(this_opt, "panel:", 6)) {
  21783. + int i;
  21784. + long int li;
  21785. + char *endptr;
  21786. + this_opt += 6;
  21787. +
  21788. + /* Panel name can be name, "bs" for board-switch, or number/index */
  21789. + li = simple_strtol(this_opt, &endptr, 0);
  21790. + if (*endptr == '\0') {
  21791. + panel_index = (int)li;
  21792. + }
  21793. + else if (strcmp(this_opt, "bs") == 0) {
  21794. + panel_index = board_au1200fb_panel();
  21795. + }
  21796. + else
  21797. + for (i=0; i<num_panels; i++) {
  21798. + if (!strcmp(this_opt, panels[i].name)) {
  21799. + panel_index = i;
  21800. + break;
  21801. + }
  21802. + }
  21803. + }
  21804. + else if (!strncmp(this_opt, "nohwcursor", 10)) {
  21805. + printk("nohwcursor\n");
  21806. + fb_infos[0].nohwcursor = 1;
  21807. + }
  21808. + }
  21809. +
  21810. + printk("au1200fb: Panel %d %s\n", panel_index,
  21811. + panels[panel_index].name);
  21812. +}
  21813. +
  21814. +
  21815. +
  21816. +#ifdef MODULE
  21817. +MODULE_LICENSE("GPL");
  21818. +MODULE_DESCRIPTION("Au1200 LCD framebuffer driver");
  21819. +
  21820. +void au1200fb_cleanup(struct fb_info *info)
  21821. +{
  21822. + unregister_framebuffer(info);
  21823. +}
  21824. +
  21825. +module_init(au1200fb_init);
  21826. +module_exit(au1200fb_cleanup);
  21827. +#endif /* MODULE */
  21828. +
  21829. +
  21830. --- /dev/null
  21831. +++ b/drivers/video/au1200fb.h
  21832. @@ -0,0 +1,288 @@
  21833. +/*
  21834. + * BRIEF MODULE DESCRIPTION
  21835. + * Hardware definitions for the Au1200 LCD controller
  21836. + *
  21837. + * Copyright 2004 AMD
  21838. + * Author: AMD
  21839. + *
  21840. + * This program is free software; you can redistribute it and/or modify it
  21841. + * under the terms of the GNU General Public License as published by the
  21842. + * Free Software Foundation; either version 2 of the License, or (at your
  21843. + * option) any later version.
  21844. + *
  21845. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  21846. + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  21847. + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  21848. + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  21849. + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  21850. + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  21851. + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  21852. + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  21853. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  21854. + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  21855. + *
  21856. + * You should have received a copy of the GNU General Public License along
  21857. + * with this program; if not, write to the Free Software Foundation, Inc.,
  21858. + * 675 Mass Ave, Cambridge, MA 02139, USA.
  21859. + */
  21860. +
  21861. +#ifndef _AU1200LCD_H
  21862. +#define _AU1200LCD_H
  21863. +
  21864. +/********************************************************************/
  21865. +#define AU1200_LCD_ADDR 0xB5000000
  21866. +
  21867. +#define uint8 unsigned char
  21868. +#define uint32 unsigned int
  21869. +
  21870. +typedef volatile struct
  21871. +{
  21872. + uint32 reserved0;
  21873. + uint32 screen;
  21874. + uint32 backcolor;
  21875. + uint32 horztiming;
  21876. + uint32 verttiming;
  21877. + uint32 clkcontrol;
  21878. + uint32 pwmdiv;
  21879. + uint32 pwmhi;
  21880. + uint32 reserved1;
  21881. + uint32 winenable;
  21882. + uint32 colorkey;
  21883. + uint32 colorkeymsk;
  21884. + struct
  21885. + {
  21886. + uint32 cursorctrl;
  21887. + uint32 cursorpos;
  21888. + uint32 cursorcolor0;
  21889. + uint32 cursorcolor1;
  21890. + uint32 cursorcolor2;
  21891. + uint32 cursorcolor3;
  21892. + } hwc;
  21893. + uint32 intstatus;
  21894. + uint32 intenable;
  21895. + uint32 outmask;
  21896. + uint32 fifoctrl;
  21897. + uint32 reserved2[(0x0100-0x0058)/4];
  21898. + struct
  21899. + {
  21900. + uint32 winctrl0;
  21901. + uint32 winctrl1;
  21902. + uint32 winctrl2;
  21903. + uint32 winbuf0;
  21904. + uint32 winbuf1;
  21905. + uint32 winbufctrl;
  21906. + uint32 winreserved0;
  21907. + uint32 winreserved1;
  21908. + } window[4];
  21909. +
  21910. + uint32 reserved3[(0x0400-0x0180)/4];
  21911. +
  21912. + uint32 palette[(0x0800-0x0400)/4];
  21913. +
  21914. + uint8 cursorpattern[256];
  21915. +
  21916. +} AU1200_LCD;
  21917. +
  21918. +/* lcd_screen */
  21919. +#define LCD_SCREEN_SEN (1<<31)
  21920. +#define LCD_SCREEN_SX (0x07FF<<19)
  21921. +#define LCD_SCREEN_SY (0x07FF<< 8)
  21922. +#define LCD_SCREEN_SWP (1<<7)
  21923. +#define LCD_SCREEN_SWD (1<<6)
  21924. +#define LCD_SCREEN_ST (7<<0)
  21925. +#define LCD_SCREEN_ST_TFT (0<<0)
  21926. +#define LCD_SCREEN_SX_N(WIDTH) ((WIDTH-1)<<19)
  21927. +#define LCD_SCREEN_SY_N(HEIGHT) ((HEIGHT-1)<<8)
  21928. +#define LCD_SCREEN_ST_CSTN (1<<0)
  21929. +#define LCD_SCREEN_ST_CDSTN (2<<0)
  21930. +#define LCD_SCREEN_ST_M8STN (3<<0)
  21931. +#define LCD_SCREEN_ST_M4STN (4<<0)
  21932. +
  21933. +/* lcd_backcolor */
  21934. +#define LCD_BACKCOLOR_SBGR (0xFF<<16)
  21935. +#define LCD_BACKCOLOR_SBGG (0xFF<<8)
  21936. +#define LCD_BACKCOLOR_SBGB (0xFF<<0)
  21937. +#define LCD_BACKCOLOR_SBGR_N(N) ((N)<<16)
  21938. +#define LCD_BACKCOLOR_SBGG_N(N) ((N)<<8)
  21939. +#define LCD_BACKCOLOR_SBGB_N(N) ((N)<<0)
  21940. +
  21941. +/* lcd_winenable */
  21942. +#define LCD_WINENABLE_WEN3 (1<<3)
  21943. +#define LCD_WINENABLE_WEN2 (1<<2)
  21944. +#define LCD_WINENABLE_WEN1 (1<<1)
  21945. +#define LCD_WINENABLE_WEN0 (1<<0)
  21946. +
  21947. +/* lcd_colorkey */
  21948. +#define LCD_COLORKEY_CKR (0xFF<<16)
  21949. +#define LCD_COLORKEY_CKG (0xFF<<8)
  21950. +#define LCD_COLORKEY_CKB (0xFF<<0)
  21951. +#define LCD_COLORKEY_CKR_N(N) ((N)<<16)
  21952. +#define LCD_COLORKEY_CKG_N(N) ((N)<<8)
  21953. +#define LCD_COLORKEY_CKB_N(N) ((N)<<0)
  21954. +
  21955. +/* lcd_colorkeymsk */
  21956. +#define LCD_COLORKEYMSK_CKMR (0xFF<<16)
  21957. +#define LCD_COLORKEYMSK_CKMG (0xFF<<8)
  21958. +#define LCD_COLORKEYMSK_CKMB (0xFF<<0)
  21959. +#define LCD_COLORKEYMSK_CKMR_N(N) ((N)<<16)
  21960. +#define LCD_COLORKEYMSK_CKMG_N(N) ((N)<<8)
  21961. +#define LCD_COLORKEYMSK_CKMB_N(N) ((N)<<0)
  21962. +
  21963. +/* lcd windows control 0 */
  21964. +#define LCD_WINCTRL0_OX (0x07FF<<21)
  21965. +#define LCD_WINCTRL0_OY (0x07FF<<10)
  21966. +#define LCD_WINCTRL0_A (0x00FF<<2)
  21967. +#define LCD_WINCTRL0_AEN (1<<1)
  21968. +#define LCD_WINCTRL0_OX_N(N) ((N)<<21)
  21969. +#define LCD_WINCTRL0_OY_N(N) ((N)<<10)
  21970. +#define LCD_WINCTRL0_A_N(N) ((N)<<2)
  21971. +
  21972. +/* lcd windows control 1 */
  21973. +#define LCD_WINCTRL1_PRI (3<<30)
  21974. +#define LCD_WINCTRL1_PIPE (1<<29)
  21975. +#define LCD_WINCTRL1_FRM (0xF<<25)
  21976. +#define LCD_WINCTRL1_CCO (1<<24)
  21977. +#define LCD_WINCTRL1_PO (3<<22)
  21978. +#define LCD_WINCTRL1_SZX (0x07FF<<11)
  21979. +#define LCD_WINCTRL1_SZY (0x07FF<<0)
  21980. +#define LCD_WINCTRL1_FRM_1BPP (0<<25)
  21981. +#define LCD_WINCTRL1_FRM_2BPP (1<<25)
  21982. +#define LCD_WINCTRL1_FRM_4BPP (2<<25)
  21983. +#define LCD_WINCTRL1_FRM_8BPP (3<<25)
  21984. +#define LCD_WINCTRL1_FRM_12BPP (4<<25)
  21985. +#define LCD_WINCTRL1_FRM_16BPP655 (5<<25)
  21986. +#define LCD_WINCTRL1_FRM_16BPP565 (6<<25)
  21987. +#define LCD_WINCTRL1_FRM_16BPP556 (7<<25)
  21988. +#define LCD_WINCTRL1_FRM_16BPPI1555 (8<<25)
  21989. +#define LCD_WINCTRL1_FRM_16BPPI5551 (9<<25)
  21990. +#define LCD_WINCTRL1_FRM_16BPPA1555 (10<<25)
  21991. +#define LCD_WINCTRL1_FRM_16BPPA5551 (11<<25)
  21992. +#define LCD_WINCTRL1_FRM_24BPP (12<<25)
  21993. +#define LCD_WINCTRL1_FRM_32BPP (13<<25)
  21994. +#define LCD_WINCTRL1_PRI_N(N) ((N)<<30)
  21995. +#define LCD_WINCTRL1_PO_00 (0<<22)
  21996. +#define LCD_WINCTRL1_PO_01 (1<<22)
  21997. +#define LCD_WINCTRL1_PO_10 (2<<22)
  21998. +#define LCD_WINCTRL1_PO_11 (3<<22)
  21999. +#define LCD_WINCTRL1_SZX_N(N) ((N-1)<<11)
  22000. +#define LCD_WINCTRL1_SZY_N(N) ((N-1)<<0)
  22001. +
  22002. +/* lcd windows control 2 */
  22003. +#define LCD_WINCTRL2_CKMODE (3<<24)
  22004. +#define LCD_WINCTRL2_DBM (1<<23)
  22005. +#define LCD_WINCTRL2_RAM (3<<21)
  22006. +#define LCD_WINCTRL2_BX (0x1FFF<<8)
  22007. +#define LCD_WINCTRL2_SCX (0xF<<4)
  22008. +#define LCD_WINCTRL2_SCY (0xF<<0)
  22009. +#define LCD_WINCTRL2_CKMODE_00 (0<<24)
  22010. +#define LCD_WINCTRL2_CKMODE_01 (1<<24)
  22011. +#define LCD_WINCTRL2_CKMODE_10 (2<<24)
  22012. +#define LCD_WINCTRL2_CKMODE_11 (3<<24)
  22013. +#define LCD_WINCTRL2_RAM_NONE (0<<21)
  22014. +#define LCD_WINCTRL2_RAM_PALETTE (1<<21)
  22015. +#define LCD_WINCTRL2_RAM_GAMMA (2<<21)
  22016. +#define LCD_WINCTRL2_RAM_BUFFER (3<<21)
  22017. +#define LCD_WINCTRL2_BX_N(N) ((N)<<8)
  22018. +#define LCD_WINCTRL2_SCX_1 (0<<4)
  22019. +#define LCD_WINCTRL2_SCX_2 (1<<4)
  22020. +#define LCD_WINCTRL2_SCX_4 (2<<4)
  22021. +#define LCD_WINCTRL2_SCY_1 (0<<0)
  22022. +#define LCD_WINCTRL2_SCY_2 (1<<0)
  22023. +#define LCD_WINCTRL2_SCY_4 (2<<0)
  22024. +
  22025. +/* lcd windows buffer control */
  22026. +#define LCD_WINBUFCTRL_DB (1<<1)
  22027. +#define LCD_WINBUFCTRL_DBN (1<<0)
  22028. +
  22029. +/* lcd_intstatus, lcd_intenable */
  22030. +#define LCD_INT_IFO (0xF<<14)
  22031. +#define LCD_INT_IFU (0xF<<10)
  22032. +#define LCD_INT_OFO (1<<9)
  22033. +#define LCD_INT_OFU (1<<8)
  22034. +#define LCD_INT_WAIT (1<<3)
  22035. +#define LCD_INT_SD (1<<2)
  22036. +#define LCD_INT_SA (1<<1)
  22037. +#define LCD_INT_SS (1<<0)
  22038. +
  22039. +/* lcd_horztiming */
  22040. +#define LCD_HORZTIMING_HND2 (0x1FF<<18)
  22041. +#define LCD_HORZTIMING_HND1 (0x1FF<<9)
  22042. +#define LCD_HORZTIMING_HPW (0x1FF<<0)
  22043. +#define LCD_HORZTIMING_HND2_N(N)(((N)-1)<<18)
  22044. +#define LCD_HORZTIMING_HND1_N(N)(((N)-1)<<9)
  22045. +#define LCD_HORZTIMING_HPW_N(N) (((N)-1)<<0)
  22046. +
  22047. +/* lcd_verttiming */
  22048. +#define LCD_VERTTIMING_VND2 (0x1FF<<18)
  22049. +#define LCD_VERTTIMING_VND1 (0x1FF<<9)
  22050. +#define LCD_VERTTIMING_VPW (0x1FF<<0)
  22051. +#define LCD_VERTTIMING_VND2_N(N)(((N)-1)<<18)
  22052. +#define LCD_VERTTIMING_VND1_N(N)(((N)-1)<<9)
  22053. +#define LCD_VERTTIMING_VPW_N(N) (((N)-1)<<0)
  22054. +
  22055. +/* lcd_clkcontrol */
  22056. +#define LCD_CLKCONTROL_EXT (1<<22)
  22057. +#define LCD_CLKCONTROL_DELAY (3<<20)
  22058. +#define LCD_CLKCONTROL_CDD (1<<19)
  22059. +#define LCD_CLKCONTROL_IB (1<<18)
  22060. +#define LCD_CLKCONTROL_IC (1<<17)
  22061. +#define LCD_CLKCONTROL_IH (1<<16)
  22062. +#define LCD_CLKCONTROL_IV (1<<15)
  22063. +#define LCD_CLKCONTROL_BF (0x1F<<10)
  22064. +#define LCD_CLKCONTROL_PCD (0x3FF<<0)
  22065. +#define LCD_CLKCONTROL_BF_N(N) (((N)-1)<<10)
  22066. +#define LCD_CLKCONTROL_PCD_N(N) ((N)<<0)
  22067. +
  22068. +/* lcd_pwmdiv */
  22069. +#define LCD_PWMDIV_EN (1<<31)
  22070. +#define LCD_PWMDIV_PWMDIV (0x1FFFF<<0)
  22071. +#define LCD_PWMDIV_PWMDIV_N(N) ((N)<<0)
  22072. +
  22073. +/* lcd_pwmhi */
  22074. +#define LCD_PWMHI_PWMHI1 (0xFFFF<<16)
  22075. +#define LCD_PWMHI_PWMHI0 (0xFFFF<<0)
  22076. +#define LCD_PWMHI_PWMHI1_N(N) ((N)<<16)
  22077. +#define LCD_PWMHI_PWMHI0_N(N) ((N)<<0)
  22078. +
  22079. +/* lcd_hwccon */
  22080. +#define LCD_HWCCON_EN (1<<0)
  22081. +
  22082. +/* lcd_cursorpos */
  22083. +#define LCD_CURSORPOS_HWCXOFF (0x1F<<27)
  22084. +#define LCD_CURSORPOS_HWCXPOS (0x07FF<<16)
  22085. +#define LCD_CURSORPOS_HWCYOFF (0x1F<<11)
  22086. +#define LCD_CURSORPOS_HWCYPOS (0x07FF<<0)
  22087. +#define LCD_CURSORPOS_HWCXOFF_N(N) ((N)<<27)
  22088. +#define LCD_CURSORPOS_HWCXPOS_N(N) ((N)<<16)
  22089. +#define LCD_CURSORPOS_HWCYOFF_N(N) ((N)<<11)
  22090. +#define LCD_CURSORPOS_HWCYPOS_N(N) ((N)<<0)
  22091. +
  22092. +/* lcd_cursorcolor */
  22093. +#define LCD_CURSORCOLOR_HWCA (0xFF<<24)
  22094. +#define LCD_CURSORCOLOR_HWCR (0xFF<<16)
  22095. +#define LCD_CURSORCOLOR_HWCG (0xFF<<8)
  22096. +#define LCD_CURSORCOLOR_HWCB (0xFF<<0)
  22097. +#define LCD_CURSORCOLOR_HWCA_N(N) ((N)<<24)
  22098. +#define LCD_CURSORCOLOR_HWCR_N(N) ((N)<<16)
  22099. +#define LCD_CURSORCOLOR_HWCG_N(N) ((N)<<8)
  22100. +#define LCD_CURSORCOLOR_HWCB_N(N) ((N)<<0)
  22101. +
  22102. +/* lcd_fifoctrl */
  22103. +#define LCD_FIFOCTRL_F3IF (1<<29)
  22104. +#define LCD_FIFOCTRL_F3REQ (0x1F<<24)
  22105. +#define LCD_FIFOCTRL_F2IF (1<<29)
  22106. +#define LCD_FIFOCTRL_F2REQ (0x1F<<16)
  22107. +#define LCD_FIFOCTRL_F1IF (1<<29)
  22108. +#define LCD_FIFOCTRL_F1REQ (0x1F<<8)
  22109. +#define LCD_FIFOCTRL_F0IF (1<<29)
  22110. +#define LCD_FIFOCTRL_F0REQ (0x1F<<0)
  22111. +#define LCD_FIFOCTRL_F3REQ_N(N) ((N-1)<<24)
  22112. +#define LCD_FIFOCTRL_F2REQ_N(N) ((N-1)<<16)
  22113. +#define LCD_FIFOCTRL_F1REQ_N(N) ((N-1)<<8)
  22114. +#define LCD_FIFOCTRL_F0REQ_N(N) ((N-1)<<0)
  22115. +
  22116. +/* lcd_outmask */
  22117. +#define LCD_OUTMASK_MASK (0x00FFFFFF)
  22118. +
  22119. +/********************************************************************/
  22120. +#endif /* _AU1200LCD_H */
  22121. --- a/drivers/video/Config.in
  22122. +++ b/drivers/video/Config.in
  22123. @@ -87,8 +87,8 @@ if [ "$CONFIG_FB" = "y" ]; then
  22124. if [ "$CONFIG_HP300" = "y" ]; then
  22125. define_bool CONFIG_FB_HP300 y
  22126. fi
  22127. - if [ "$ARCH" = "alpha" ]; then
  22128. - tristate ' TGA framebuffer support' CONFIG_FB_TGA
  22129. + if [ "$ARCH" = "alpha" -o "$CONFIG_TC" = "y" ]; then
  22130. + tristate ' TGA/SFB+ framebuffer support' CONFIG_FB_TGA
  22131. fi
  22132. if [ "$CONFIG_X86" = "y" ]; then
  22133. bool ' VESA VGA graphics console' CONFIG_FB_VESA
  22134. @@ -121,6 +121,17 @@ if [ "$CONFIG_FB" = "y" ]; then
  22135. hex ' Framebuffer Base Address' CONFIG_E1355_FB_BASE a8200000
  22136. fi
  22137. fi
  22138. + if [ "$CONFIG_SOC_AU1100" = "y" ]; then
  22139. + bool ' Au1100 LCD Driver' CONFIG_FB_AU1100
  22140. + fi
  22141. +
  22142. + if [ "$CONFIG_SOC_AU1200" = "y" ]; then
  22143. + bool ' Au1200 LCD Driver' CONFIG_FB_AU1200
  22144. + if [ "$CONFIG_FB_AU1200" = "y" ]; then
  22145. + int ' Number of planes (1 to 4)' CONFIG_FB_AU1200_DEVS 1
  22146. + fi
  22147. + fi
  22148. +
  22149. if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
  22150. if [ "$CONFIG_PCI" != "n" ]; then
  22151. tristate ' Matrox acceleration (EXPERIMENTAL)' CONFIG_FB_MATROX
  22152. @@ -178,9 +189,6 @@ if [ "$CONFIG_FB" = "y" ]; then
  22153. bool ' Use CRT on Pb1100 ' CONFIG_PB1500_CRT
  22154. bool ' Use TFT Panel on Pb1100 ' CONFIG_PB1500_TFT
  22155. fi
  22156. - if [ "$CONFIG_SOC_AU1100" = "y" ]; then
  22157. - bool ' Au1100 LCD Driver' CONFIG_FB_AU1100
  22158. - fi
  22159. fi
  22160. fi
  22161. fi
  22162. --- a/drivers/video/fbmem.c
  22163. +++ b/drivers/video/fbmem.c
  22164. @@ -139,6 +139,8 @@ extern int e1356fb_init(void);
  22165. extern int e1356fb_setup(char*);
  22166. extern int au1100fb_init(void);
  22167. extern int au1100fb_setup(char*);
  22168. +extern int au1200fb_init(void);
  22169. +extern int au1200fb_setup(char*);
  22170. extern int pvr2fb_init(void);
  22171. extern int pvr2fb_setup(char*);
  22172. extern int sstfb_init(void);
  22173. @@ -331,6 +333,9 @@ static struct {
  22174. #ifdef CONFIG_FB_AU1100
  22175. { "au1100fb", au1100fb_init, au1100fb_setup },
  22176. #endif
  22177. +#ifdef CONFIG_FB_AU1200
  22178. + { "au1200fb", au1200fb_init, au1200fb_setup },
  22179. +#endif
  22180. #ifdef CONFIG_FB_IT8181
  22181. { "it8181fb", it8181fb_init, it8181fb_setup },
  22182. #endif
  22183. --- /dev/null
  22184. +++ b/drivers/video/ims332.h
  22185. @@ -0,0 +1,275 @@
  22186. +/*
  22187. + * linux/drivers/video/ims332.h
  22188. + *
  22189. + * Copyright 2003 Thiemo Seufer <[email protected]>
  22190. + *
  22191. + * This file is subject to the terms and conditions of the GNU General
  22192. + * Public License. See the file COPYING in the main directory of this
  22193. + * archive for more details.
  22194. + */
  22195. +#include <linux/types.h>
  22196. +
  22197. +/*
  22198. + * IMS332 16-bit wide, 128-bit aligned registers.
  22199. + */
  22200. +struct _ims332_reg {
  22201. + volatile u16 r;
  22202. + u16 pad[7];
  22203. +};
  22204. +
  22205. +struct _ims332_regs {
  22206. +#define IMS332_BOOT_PLL_MUTLIPLIER 0x00001f
  22207. +#define IMS332_BOOT_CLOCK_SOURCE_SEL 0x000020
  22208. +#define IMS332_BOOT_ADDRESS_ALIGNMENT 0x000040
  22209. +#define IMS332_BOOT_WRITE_ZERO 0xffff80
  22210. + struct _ims332_reg boot;
  22211. + struct _ims332_reg pad0[0x020 - 0x000];
  22212. + struct _ims332_reg half_sync;
  22213. + struct _ims332_reg back_porch;
  22214. + struct _ims332_reg display;
  22215. + struct _ims332_reg short_display;
  22216. + struct _ims332_reg broad_pulse;
  22217. + struct _ims332_reg vsync;
  22218. + struct _ims332_reg vpre_equalise;
  22219. + struct _ims332_reg vpost_equalise;
  22220. + struct _ims332_reg vblank;
  22221. + struct _ims332_reg vdisplay;
  22222. + struct _ims332_reg line_time;
  22223. + struct _ims332_reg line_start;
  22224. + struct _ims332_reg mem_init;
  22225. + struct _ims332_reg transfer_delay;
  22226. + struct _ims332_reg pad1[0x03f - 0x02e];
  22227. + struct _ims332_reg pixel_address_mask;
  22228. + struct _ims332_reg pad2[0x05f - 0x040];
  22229. +
  22230. +#define IMS332_CTRL_A_BOOT_ENABLE_VTG 0x000001
  22231. +#define IMS332_CTRL_A_SCREEN_FORMAT 0x000002
  22232. +#define IMS332_CTRL_A_INTERLACED_STANDARD 0x000004
  22233. +#define IMS332_CTRL_A_OPERATING_MODE 0x000008
  22234. +#define IMS332_CTRL_A_FRAME_FLYBACK_PATTERN 0x000010
  22235. +#define IMS332_CTRL_A_DIGITAL_SYNC_FORMAT 0x000020
  22236. +#define IMS332_CTRL_A_ANALOGUE_VIDEO_FORMAT 0x000040
  22237. +#define IMS332_CTRL_A_BLANK_LEVEL 0x000080
  22238. +#define IMS332_CTRL_A_BLANK_IO 0x000100
  22239. +#define IMS332_CTRL_A_BLANK_FUNCTION_SWITCH 0x000200
  22240. +#define IMS332_CTRL_A_FORCE_BLANKING 0x000400
  22241. +#define IMS332_CTRL_A_TURN_OFF_BLANKING 0x000800
  22242. +#define IMS332_CTRL_A_VRAM_ADDRESS_INCREMENT 0x003000
  22243. +#define IMS332_CTRL_A_TURN_OFF_DMA 0x004000
  22244. +#define IMS332_CTRL_A_SYNC_DELAY 0x038000
  22245. +#define IMS332_CTRL_A_PIXEL_PORT_INTERLEAVING 0x040000
  22246. +#define IMS332_CTRL_A_DELAYED_SAMPLING 0x080000
  22247. +#define IMS332_CTRL_A_BITS_PER_PIXEL 0x700000
  22248. +#define IMS332_CTRL_A_CURSOR_DISABLE 0x800000
  22249. + struct _ims332_reg config_control_a;
  22250. + struct _ims332_reg pad3[0x06f - 0x060];
  22251. +
  22252. +#define IMS332_CTRL_B_WRITE_ZERO 0xffffff
  22253. + struct _ims332_reg config_control_b;
  22254. + struct _ims332_reg pad4[0x07f - 0x070];
  22255. + struct _ims332_reg screen_top;
  22256. + struct _ims332_reg pad5[0x0a0 - 0x080];
  22257. + /* cursor color palette, 3 entries, reg no. 0xa1 - 0xa3 */
  22258. + struct _ims332_reg cursor_color_palette0;
  22259. + struct _ims332_reg cursor_color_palette1;
  22260. + struct _ims332_reg cursor_color_palette2;
  22261. + struct _ims332_reg pad6[0x0bf - 0x0a3];
  22262. + struct _ims332_reg rgb_frame_checksum0;
  22263. + struct _ims332_reg rgb_frame_checksum1;
  22264. + struct _ims332_reg rgb_frame_checksum2;
  22265. + struct _ims332_reg pad7[0x0c6 - 0x0c2];
  22266. + struct _ims332_reg cursor_start;
  22267. + struct _ims332_reg pad8[0x0ff - 0x0c7];
  22268. + /* color palette, 256 entries of form 0x00BBGGRR, reg no. 0x100 - 0x1ff */
  22269. + struct _ims332_reg color_palette[0x1ff - 0x0ff];
  22270. + /* hardware cursor bitmap, reg no. 0x200 - 0x3ff */
  22271. + struct _ims332_reg cursor_ram[0x3ff - 0x1ff];
  22272. +};
  22273. +
  22274. +/*
  22275. + * In the functions below we use some weird looking helper variables to
  22276. + * access most members of this struct, otherwise the compiler splits
  22277. + * the read/write in two byte accesses.
  22278. + */
  22279. +struct ims332_regs {
  22280. + struct _ims332_regs rw;
  22281. + char pad0[0x80000 - sizeof (struct _ims332_regs)];
  22282. + struct _ims332_regs r;
  22283. + char pad1[0xa0000 - (sizeof (struct _ims332_regs) + 0x80000)];
  22284. + struct _ims332_regs w;
  22285. +} __attribute__((packed));
  22286. +
  22287. +static inline void ims332_control_reg_bits(struct ims332_regs *regs, u32 mask,
  22288. + u32 val)
  22289. +{
  22290. + volatile u16 *ctr = &(regs->r.config_control_a.r);
  22291. + volatile u16 *ctw = &(regs->w.config_control_a.r);
  22292. + u32 ctrl;
  22293. +
  22294. + mb();
  22295. + ctrl = *ctr;
  22296. + rmb();
  22297. + ctrl |= ((regs->rw.boot.r << 8) & 0x00ff0000);
  22298. + ctrl |= val & mask;
  22299. + ctrl &= ~(~val & mask);
  22300. + wmb();
  22301. + regs->rw.boot.r = (ctrl >> 8) & 0xff00;
  22302. + wmb();
  22303. + *ctw = ctrl & 0xffff;
  22304. +}
  22305. +
  22306. +/* FIXME: This is maxinefb specific. */
  22307. +static inline void ims332_bootstrap(struct ims332_regs *regs)
  22308. +{
  22309. + volatile u16 *ctw = &(regs->w.config_control_a.r);
  22310. + u32 ctrl = IMS332_CTRL_A_BOOT_ENABLE_VTG | IMS332_CTRL_A_TURN_OFF_DMA;
  22311. +
  22312. + /* bootstrap sequence */
  22313. + mb();
  22314. + regs->rw.boot.r = 0;
  22315. + wmb();
  22316. + *ctw = 0;
  22317. +
  22318. + /* init control A register */
  22319. + wmb();
  22320. + regs->rw.boot.r = (ctrl >> 8) & 0xff00;
  22321. + wmb();
  22322. + *ctw = ctrl & 0xffff;
  22323. +}
  22324. +
  22325. +static inline void ims332_blank_screen(struct ims332_regs *regs, int blank)
  22326. +{
  22327. + ims332_control_reg_bits(regs, IMS332_CTRL_A_FORCE_BLANKING,
  22328. + blank ? IMS332_CTRL_A_FORCE_BLANKING : 0);
  22329. +}
  22330. +
  22331. +static inline void ims332_set_color_depth(struct ims332_regs *regs, u32 depth)
  22332. +{
  22333. + u32 dp;
  22334. + u32 mask = (IMS332_CTRL_A_PIXEL_PORT_INTERLEAVING
  22335. + | IMS332_CTRL_A_DELAYED_SAMPLING
  22336. + | IMS332_CTRL_A_BITS_PER_PIXEL);
  22337. +
  22338. + switch (depth) {
  22339. + case 1: dp = 0 << 20; break;
  22340. + case 2: dp = 1 << 20; break;
  22341. + case 4: dp = 2 << 20; break;
  22342. + case 8: dp = 3 << 20; break;
  22343. + case 15: dp = (4 << 20) | IMS332_CTRL_A_PIXEL_PORT_INTERLEAVING; break;
  22344. + case 16: dp = (5 << 20) | IMS332_CTRL_A_PIXEL_PORT_INTERLEAVING; break;
  22345. + default: return;
  22346. + }
  22347. + ims332_control_reg_bits(regs, mask, dp);
  22348. +
  22349. + if (depth <= 8) {
  22350. + volatile u16 *pmask = &(regs->w.pixel_address_mask.r);
  22351. + u32 dm = (1 << depth) - 1;
  22352. +
  22353. + wmb();
  22354. + regs->rw.boot.r = dm << 8;
  22355. + wmb();
  22356. + *pmask = dm << 8 | dm;
  22357. + }
  22358. +}
  22359. +
  22360. +static inline void ims332_set_screen_top(struct ims332_regs *regs, u16 top)
  22361. +{
  22362. + volatile u16 *st = &(regs->w.screen_top.r);
  22363. +
  22364. + mb();
  22365. + *st = top & 0xffff;
  22366. +}
  22367. +
  22368. +static inline void ims332_enable_cursor(struct ims332_regs *regs, int on)
  22369. +{
  22370. + ims332_control_reg_bits(regs, IMS332_CTRL_A_CURSOR_DISABLE,
  22371. + on ? 0 : IMS332_CTRL_A_CURSOR_DISABLE);
  22372. +}
  22373. +
  22374. +static inline void ims332_position_cursor(struct ims332_regs *regs,
  22375. + u16 x, u16 y)
  22376. +{
  22377. + volatile u16 *cp = &(regs->w.cursor_start.r);
  22378. + u32 val = ((x & 0xfff) << 12) | (y & 0xfff);
  22379. +
  22380. + if (x > 2303 || y > 2303)
  22381. + return;
  22382. +
  22383. + mb();
  22384. + regs->rw.boot.r = (val >> 8) & 0xff00;
  22385. + wmb();
  22386. + *cp = val & 0xffff;
  22387. +}
  22388. +
  22389. +static inline void ims332_set_font(struct ims332_regs *regs, u8 fgc,
  22390. + u16 width, u16 height)
  22391. +{
  22392. + volatile u16 *cp0 = &(regs->w.cursor_color_palette0.r);
  22393. + int i;
  22394. +
  22395. + mb();
  22396. + for (i = 0; i < 0x200; i++) {
  22397. + volatile u16 *cram = &(regs->w.cursor_ram[i].r);
  22398. +
  22399. + if (height << 6 <= i << 3)
  22400. + *cram = 0x0000;
  22401. + else if (width <= i % 8 << 3)
  22402. + *cram = 0x0000;
  22403. + else if (((width >> 3) & 0xffff) > i % 8)
  22404. + *cram = 0x5555;
  22405. + else
  22406. + *cram = 0x5555 & ~(0xffff << (width % 8 << 1));
  22407. + wmb();
  22408. + }
  22409. + regs->rw.boot.r = fgc << 8;
  22410. + wmb();
  22411. + *cp0 = fgc << 8 | fgc;
  22412. +}
  22413. +
  22414. +static inline void ims332_read_cmap(struct ims332_regs *regs, u8 reg,
  22415. + u8* red, u8* green, u8* blue)
  22416. +{
  22417. + volatile u16 *rptr = &(regs->r.color_palette[reg].r);
  22418. + u16 val;
  22419. +
  22420. + mb();
  22421. + val = *rptr;
  22422. + *red = val & 0xff;
  22423. + *green = (val >> 8) & 0xff;
  22424. + rmb();
  22425. + *blue = (regs->rw.boot.r >> 8) & 0xff;
  22426. +}
  22427. +
  22428. +static inline void ims332_write_cmap(struct ims332_regs *regs, u8 reg,
  22429. + u8 red, u8 green, u8 blue)
  22430. +{
  22431. + volatile u16 *wptr = &(regs->w.color_palette[reg].r);
  22432. +
  22433. + mb();
  22434. + regs->rw.boot.r = blue << 8;
  22435. + wmb();
  22436. + *wptr = (green << 8) + red;
  22437. +}
  22438. +
  22439. +static inline void ims332_dump_regs(struct ims332_regs *regs)
  22440. +{
  22441. + int i;
  22442. +
  22443. + printk(__FUNCTION__);
  22444. + ims332_control_reg_bits(regs, IMS332_CTRL_A_BOOT_ENABLE_VTG, 0);
  22445. + for (i = 0; i < 0x100; i++) {
  22446. + volatile u16 *cpad = (u16 *)((char *)(&regs->r) + sizeof(struct _ims332_reg) * i);
  22447. + u32 val;
  22448. +
  22449. + val = *cpad;
  22450. + rmb();
  22451. + val |= regs->rw.boot.r << 8;
  22452. + rmb();
  22453. + if (! (i % 8))
  22454. + printk("\n%02x:", i);
  22455. + printk(" %06x", val);
  22456. + }
  22457. + ims332_control_reg_bits(regs, IMS332_CTRL_A_BOOT_ENABLE_VTG,
  22458. + IMS332_CTRL_A_BOOT_ENABLE_VTG);
  22459. + printk("\n");
  22460. +}
  22461. --- a/drivers/video/Makefile
  22462. +++ b/drivers/video/Makefile
  22463. @@ -87,6 +87,7 @@ obj-$(CONFIG_FB_PMAGB_B) += pma
  22464. obj-$(CONFIG_FB_MAXINE) += maxinefb.o
  22465. obj-$(CONFIG_FB_TX3912) += tx3912fb.o
  22466. obj-$(CONFIG_FB_AU1100) += au1100fb.o fbgen.o
  22467. +obj-$(CONFIG_FB_AU1200) += au1200fb.o fbgen.o
  22468. obj-$(CONFIG_FB_IT8181) += it8181fb.o fbgen.o
  22469. subdir-$(CONFIG_STI_CONSOLE) += sti
  22470. --- a/drivers/video/maxinefb.h
  22471. +++ /dev/null
  22472. @@ -1,38 +0,0 @@
  22473. -/*
  22474. - * linux/drivers/video/maxinefb.h
  22475. - *
  22476. - * DECstation 5000/xx onboard framebuffer support, Copyright (C) 1999 by
  22477. - * Michael Engel <[email protected]> and Karsten Merker <[email protected]>
  22478. - * This file is subject to the terms and conditions of the GNU General
  22479. - * Public License. See the file COPYING in the main directory of this
  22480. - * archive for more details.
  22481. - */
  22482. -
  22483. -#include <asm/addrspace.h>
  22484. -
  22485. -/*
  22486. - * IMS332 video controller register base address
  22487. - */
  22488. -#define MAXINEFB_IMS332_ADDRESS KSEG1ADDR(0x1c140000)
  22489. -
  22490. -/*
  22491. - * Begin of DECstation 5000/xx onboard framebuffer memory, default resolution
  22492. - * is 1024x768x8
  22493. - */
  22494. -#define DS5000_xx_ONBOARD_FBMEM_START KSEG1ADDR(0x0a000000)
  22495. -
  22496. -/*
  22497. - * The IMS 332 video controller used in the DECstation 5000/xx series
  22498. - * uses 32 bits wide registers; the following defines declare the
  22499. - * register numbers, to get the real offset, these have to be multiplied
  22500. - * by four.
  22501. - */
  22502. -
  22503. -#define IMS332_REG_CURSOR_RAM 0x200 /* hardware cursor bitmap */
  22504. -
  22505. -/*
  22506. - * The color palette entries have the form 0x00BBGGRR
  22507. - */
  22508. -#define IMS332_REG_COLOR_PALETTE 0x100 /* color palette, 256 entries */
  22509. -#define IMS332_REG_CURSOR_COLOR_PALETTE 0x0a1 /* cursor color palette, */
  22510. - /* 3 entries */
  22511. --- a/drivers/video/newport_con.c
  22512. +++ b/drivers/video/newport_con.c
  22513. @@ -22,6 +22,7 @@
  22514. #include <linux/module.h>
  22515. #include <linux/slab.h>
  22516. +#include <asm/io.h>
  22517. #include <asm/uaccess.h>
  22518. #include <asm/system.h>
  22519. #include <asm/page.h>
  22520. @@ -77,7 +78,7 @@ static int newport_set_def_font(int unit
  22521. static inline void newport_render_background(int xstart, int ystart,
  22522. int xend, int yend, int ci)
  22523. {
  22524. - newport_wait();
  22525. + newport_wait(npregs);
  22526. npregs->set.wrmask = 0xffffffff;
  22527. npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
  22528. NPORT_DMODE0_DOSETUP | NPORT_DMODE0_STOPX
  22529. @@ -94,7 +95,7 @@ static inline void newport_init_cmap(voi
  22530. unsigned short i;
  22531. for (i = 0; i < 16; i++) {
  22532. - newport_bfwait();
  22533. + newport_bfwait(npregs);
  22534. newport_cmap_setaddr(npregs, color_table[i]);
  22535. newport_cmap_setrgb(npregs,
  22536. default_red[i],
  22537. @@ -107,7 +108,7 @@ static inline void newport_show_logo(voi
  22538. unsigned long i;
  22539. for (i = 0; i < LINUX_LOGO_COLORS; i++) {
  22540. - newport_bfwait();
  22541. + newport_bfwait(npregs);
  22542. newport_cmap_setaddr(npregs, i + 0x20);
  22543. newport_cmap_setrgb(npregs,
  22544. linux_logo_red[i],
  22545. @@ -115,13 +116,13 @@ static inline void newport_show_logo(voi
  22546. linux_logo_blue[i]);
  22547. }
  22548. - newport_wait();
  22549. + newport_wait(npregs);
  22550. npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
  22551. NPORT_DMODE0_CHOST);
  22552. npregs->set.xystarti = ((newport_xsize - LOGO_W) << 16) | (0);
  22553. npregs->set.xyendi = ((newport_xsize - 1) << 16);
  22554. - newport_wait();
  22555. + newport_wait(npregs);
  22556. for (i = 0; i < LOGO_W * LOGO_H; i++)
  22557. npregs->go.hostrw0 = linux_logo[i] << 24;
  22558. @@ -133,7 +134,7 @@ static inline void newport_clear_screen(
  22559. if (logo_active)
  22560. return;
  22561. - newport_wait();
  22562. + newport_wait(npregs);
  22563. npregs->set.wrmask = 0xffffffff;
  22564. npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
  22565. NPORT_DMODE0_DOSETUP | NPORT_DMODE0_STOPX
  22566. @@ -155,7 +156,7 @@ void newport_reset(void)
  22567. unsigned short treg;
  22568. int i;
  22569. - newport_wait();
  22570. + newport_wait(npregs);
  22571. treg = newport_vc2_get(npregs, VC2_IREG_CONTROL);
  22572. newport_vc2_set(npregs, VC2_IREG_CONTROL,
  22573. (treg | VC2_CTRL_EVIDEO));
  22574. @@ -165,7 +166,7 @@ void newport_reset(void)
  22575. npregs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_RAM |
  22576. NPORT_DMODE_W2 | VC2_PROTOCOL);
  22577. for (i = 0; i < 128; i++) {
  22578. - newport_bfwait();
  22579. + newport_bfwait(npregs);
  22580. if (i == 92 || i == 94)
  22581. npregs->set.dcbdata0.byshort.s1 = 0xff00;
  22582. else
  22583. @@ -205,7 +206,7 @@ void newport_get_screensize(void)
  22584. npregs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_RAM |
  22585. NPORT_DMODE_W2 | VC2_PROTOCOL);
  22586. for (i = 0; i < 128; i++) {
  22587. - newport_bfwait();
  22588. + newport_bfwait(npregs);
  22589. linetable[i] = npregs->set.dcbdata0.byshort.s1;
  22590. }
  22591. @@ -216,12 +217,12 @@ void newport_get_screensize(void)
  22592. npregs->set.dcbmode = (NPORT_DMODE_AVC2 | VC2_REGADDR_RAM |
  22593. NPORT_DMODE_W2 | VC2_PROTOCOL);
  22594. do {
  22595. - newport_bfwait();
  22596. + newport_bfwait(npregs);
  22597. treg = npregs->set.dcbdata0.byshort.s1;
  22598. if ((treg & 1) == 0)
  22599. cols += (treg >> 7) & 0xfe;
  22600. if ((treg & 0x80) == 0) {
  22601. - newport_bfwait();
  22602. + newport_bfwait(npregs);
  22603. treg = npregs->set.dcbdata0.byshort.s1;
  22604. }
  22605. } while ((treg & 0x8000) == 0);
  22606. @@ -291,16 +292,16 @@ static const char *newport_startup(void)
  22607. if (!sgi_gfxaddr)
  22608. return NULL;
  22609. - npregs = (struct newport_regs *) (KSEG1 + sgi_gfxaddr);
  22610. + npregs = (struct newport_regs *) /* ioremap cannot fail */
  22611. + ioremap(sgi_gfxaddr, sizeof(struct newport_regs));
  22612. npregs->cset.config = NPORT_CFG_GD0;
  22613. - if (newport_wait()) {
  22614. - return NULL;
  22615. - }
  22616. + if (newport_wait(npregs))
  22617. + goto out_unmap;
  22618. npregs->set.xstarti = TESTVAL;
  22619. if (npregs->set._xstart.word != XSTI_TO_FXSTART(TESTVAL))
  22620. - return NULL;
  22621. + goto out_unmap;
  22622. for (i = 0; i < MAX_NR_CONSOLES; i++)
  22623. font_data[i] = FONT_DATA;
  22624. @@ -310,6 +311,10 @@ static const char *newport_startup(void)
  22625. newport_get_screensize();
  22626. return "SGI Newport";
  22627. +
  22628. +out_unmap:
  22629. + iounmap((void *)npregs);
  22630. + return NULL;
  22631. }
  22632. static void newport_init(struct vc_data *vc, int init)
  22633. @@ -363,7 +368,7 @@ static void newport_putc(struct vc_data
  22634. (charattr & 0xf0) >> 4);
  22635. /* Set the color and drawing mode. */
  22636. - newport_wait();
  22637. + newport_wait(npregs);
  22638. npregs->set.colori = charattr & 0xf;
  22639. npregs->set.drawmode0 = (NPORT_DMODE0_DRAW | NPORT_DMODE0_BLOCK |
  22640. NPORT_DMODE0_STOPX | NPORT_DMODE0_ZPENAB |
  22641. @@ -372,7 +377,7 @@ static void newport_putc(struct vc_data
  22642. /* Set coordinates for bitmap operation. */
  22643. npregs->set.xystarti = (xpos << 16) | ((ypos + topscan) & 0x3ff);
  22644. npregs->set.xyendi = ((xpos + 7) << 16);
  22645. - newport_wait();
  22646. + newport_wait(npregs);
  22647. /* Go, baby, go... */
  22648. RENDER(npregs, p);
  22649. @@ -396,7 +401,7 @@ static void newport_putcs(struct vc_data
  22650. xpos + ((count - 1) << 3), ypos,
  22651. (charattr & 0xf0) >> 4);
  22652. - newport_wait();
  22653. + newport_wait(npregs);
  22654. /* Set the color and drawing mode. */
  22655. npregs->set.colori = charattr & 0xf;
  22656. @@ -407,7 +412,7 @@ static void newport_putcs(struct vc_data
  22657. for (i = 0; i < count; i++, xpos += 8) {
  22658. p = &font_data[vc->vc_num][(scr_readw(s++) & 0xff) << 4];
  22659. - newport_wait();
  22660. + newport_wait(npregs);
  22661. /* Set coordinates for bitmap operation. */
  22662. npregs->set.xystarti =
  22663. @@ -689,7 +694,7 @@ static void newport_bmove(struct vc_data
  22664. xe = xs;
  22665. xs = tmp;
  22666. }
  22667. - newport_wait();
  22668. + newport_wait(npregs);
  22669. npregs->set.drawmode0 = (NPORT_DMODE0_S2S | NPORT_DMODE0_BLOCK |
  22670. NPORT_DMODE0_DOSETUP | NPORT_DMODE0_STOPX
  22671. | NPORT_DMODE0_STOPY);
  22672. @@ -706,35 +711,35 @@ static int newport_dummy(struct vc_data
  22673. #define DUMMY (void *) newport_dummy
  22674. const struct consw newport_con = {
  22675. - con_startup: newport_startup,
  22676. - con_init: newport_init,
  22677. - con_deinit: newport_deinit,
  22678. - con_clear: newport_clear,
  22679. - con_putc: newport_putc,
  22680. - con_putcs: newport_putcs,
  22681. - con_cursor: newport_cursor,
  22682. - con_scroll: newport_scroll,
  22683. - con_bmove: newport_bmove,
  22684. - con_switch: newport_switch,
  22685. - con_blank: newport_blank,
  22686. - con_font_op: newport_font_op,
  22687. - con_set_palette: newport_set_palette,
  22688. - con_scrolldelta: newport_scrolldelta,
  22689. - con_set_origin: DUMMY,
  22690. - con_save_screen: DUMMY
  22691. + .con_startup = newport_startup,
  22692. + .con_init = newport_init,
  22693. + .con_deinit = newport_deinit,
  22694. + .con_clear = newport_clear,
  22695. + .con_putc = newport_putc,
  22696. + .con_putcs = newport_putcs,
  22697. + .con_cursor = newport_cursor,
  22698. + .con_scroll = newport_scroll,
  22699. + .con_bmove = newport_bmove,
  22700. + .con_switch = newport_switch,
  22701. + .con_blank = newport_blank,
  22702. + .con_font_op = newport_font_op,
  22703. + .con_set_palette = newport_set_palette,
  22704. + .con_scrolldelta = newport_scrolldelta,
  22705. + .con_set_origin = DUMMY,
  22706. + .con_save_screen = DUMMY
  22707. };
  22708. #ifdef MODULE
  22709. static int __init newport_console_init(void)
  22710. {
  22711. take_over_console(&newport_con, 0, MAX_NR_CONSOLES - 1, 1);
  22712. -
  22713. return 0;
  22714. }
  22715. static void __exit newport_console_exit(void)
  22716. {
  22717. give_up_console(&newport_con);
  22718. + iounmap((void *)npregs);
  22719. }
  22720. module_init(newport_console_init);
  22721. --- a/drivers/video/tgafb.c
  22722. +++ b/drivers/video/tgafb.c
  22723. @@ -45,6 +45,15 @@
  22724. #include <linux/console.h>
  22725. #include <asm/io.h>
  22726. +#ifdef CONFIG_TC
  22727. +#include <asm/dec/tc.h>
  22728. +#else
  22729. +static int search_tc_card(const char *) { return -1; }
  22730. +static void claim_tc_card(int) { }
  22731. +static void release_tc_card(int) { }
  22732. +static unsigned long get_tc_base_addr(int) { return 0; }
  22733. +#endif
  22734. +
  22735. #include <video/fbcon.h>
  22736. #include <video/fbcon-cfb8.h>
  22737. #include <video/fbcon-cfb32.h>
  22738. @@ -84,10 +93,10 @@ static unsigned int fb_offset_presets[4]
  22739. };
  22740. static unsigned int deep_presets[4] = {
  22741. - 0x00014000,
  22742. - 0x0001440d,
  22743. + 0x00004000,
  22744. + 0x0000440d,
  22745. 0xffffffff,
  22746. - 0x0001441d
  22747. + 0x0000441d
  22748. };
  22749. static unsigned int rasterop_presets[4] = {
  22750. @@ -131,6 +140,13 @@ static struct {
  22751. 0,
  22752. FB_VMODE_NONINTERLACED
  22753. }},
  22754. + { "1280x1024-72", { /* mode #0 of PMAGD boards */
  22755. + 1280, 1024, 1280, 1024, 0, 0, 0, 0,
  22756. + {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0},
  22757. + 0, 0, -1, -1, FB_ACCELF_TEXT, 7692, 232, 32, 34, 3, 160, 3,
  22758. + FB_SYNC_ON_GREEN,
  22759. + FB_VMODE_NONINTERLACED
  22760. + }},
  22761. { "800x600-56", {
  22762. 800, 600, 800, 600, 0, 0, 0, 0,
  22763. {0, 8, 0}, {0, 8, 0}, {0, 8, 0}, {0, 0, 0},
  22764. @@ -488,7 +504,8 @@ static void tgafb_set_par(const void *fb
  22765. continue;
  22766. mb();
  22767. - TGA_WRITE_REG(deep_presets[fb_info.tga_type], TGA_DEEP_REG);
  22768. + TGA_WRITE_REG(deep_presets[fb_info.tga_type] |
  22769. + (par->sync_on_green ? 0x0 : 0x00010000), TGA_DEEP_REG);
  22770. while (TGA_READ_REG(TGA_CMD_STAT_REG) & 1) /* wait for not busy */
  22771. continue;
  22772. mb();
  22773. @@ -548,7 +565,7 @@ static void tgafb_set_par(const void *fb
  22774. BT463_WRITE(BT463_REG_ACC, BT463_CMD_REG_0, 0x40);
  22775. BT463_WRITE(BT463_REG_ACC, BT463_CMD_REG_1, 0x08);
  22776. BT463_WRITE(BT463_REG_ACC, BT463_CMD_REG_2,
  22777. - (par->sync_on_green ? 0x80 : 0x40));
  22778. + (par->sync_on_green ? 0xc0 : 0x40));
  22779. BT463_WRITE(BT463_REG_ACC, BT463_READ_MASK_0, 0xff);
  22780. BT463_WRITE(BT463_REG_ACC, BT463_READ_MASK_1, 0xff);
  22781. @@ -921,19 +938,34 @@ int __init tgafb_setup(char *options) {
  22782. int __init tgafb_init(void)
  22783. {
  22784. struct pci_dev *pdev;
  22785. + int slot;
  22786. pdev = pci_find_device(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TGA, NULL);
  22787. if (!pdev)
  22788. + slot = search_tc_card("PMAGD");
  22789. + if (!pdev && slot < 0)
  22790. return -ENXIO;
  22791. /* divine board type */
  22792. - fb_info.tga_mem_base = (unsigned long)ioremap(pdev->resource[0].start, 0);
  22793. - fb_info.tga_type = (readl(fb_info.tga_mem_base) >> 12) & 0x0f;
  22794. - fb_info.tga_regs_base = fb_info.tga_mem_base + TGA_REGS_OFFSET;
  22795. - fb_info.tga_fb_base = (fb_info.tga_mem_base
  22796. + if (pdev) {
  22797. + fb_info.tga_mem_base = (unsigned long)ioremap(pdev->resource[0].start,
  22798. + 0);
  22799. + fb_info.tga_type = (readl(fb_info.tga_mem_base) >> 12) & 0x0f;
  22800. + fb_info.tga_regs_base = fb_info.tga_mem_base + TGA_REGS_OFFSET;
  22801. + fb_info.tga_fb_base = (fb_info.tga_mem_base
  22802. + fb_offset_presets[fb_info.tga_type]);
  22803. - pci_read_config_byte(pdev, PCI_REVISION_ID, &fb_info.tga_chip_rev);
  22804. + pci_read_config_byte(pdev, PCI_REVISION_ID, &fb_info.tga_chip_rev);
  22805. +
  22806. + } else {
  22807. + claim_tc_card(slot);
  22808. + fb_info.tga_mem_base = get_tc_base_addr(slot);
  22809. + fb_info.tga_type = (readl(fb_info.tga_mem_base) >> 12) & 0x0f; /* ? */
  22810. + fb_info.tga_regs_base = fb_info.tga_mem_base + TGA_REGS_OFFSET;
  22811. + fb_info.tga_fb_base = (fb_info.tga_mem_base
  22812. + + fb_offset_presets[fb_info.tga_type]);
  22813. + fb_info.tga_chip_rev = TGA_READ_REG(TGA_START_REG) & 0xff;
  22814. + }
  22815. /* setup framebuffer */
  22816. @@ -950,40 +982,62 @@ int __init tgafb_init(void)
  22817. fb_info.gen.fbhw = &tgafb_hwswitch;
  22818. fb_info.gen.fbhw->detect();
  22819. - printk (KERN_INFO "tgafb: DC21030 [TGA] detected, rev=0x%02x\n", fb_info.tga_chip_rev);
  22820. - printk (KERN_INFO "tgafb: at PCI bus %d, device %d, function %d\n",
  22821. - pdev->bus->number, PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
  22822. + if (pdev) {
  22823. + printk (KERN_INFO "tgafb: DC21030 [TGA] detected, rev=0x%02x\n",
  22824. + fb_info.tga_chip_rev);
  22825. + printk (KERN_INFO "tgafb: at PCI bus %d, device %d, function %d\n",
  22826. + pdev->bus->number,
  22827. + PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
  22828. + } else {
  22829. + printk (KERN_INFO "tgafb: SFB+ detected, rev=0x%02x\n",
  22830. + fb_info.tga_chip_rev);
  22831. + }
  22832. switch (fb_info.tga_type)
  22833. {
  22834. case TGA_TYPE_8PLANE:
  22835. - strcpy (fb_info.gen.info.modename,"Digital ZLXp-E1");
  22836. + if (pdev)
  22837. + strcpy (fb_info.gen.info.modename,"Digital ZLXp-E1");
  22838. + else
  22839. + strcpy (fb_info.gen.info.modename,"Digital ZLX-E1");
  22840. break;
  22841. case TGA_TYPE_24PLANE:
  22842. - strcpy (fb_info.gen.info.modename,"Digital ZLXp-E2");
  22843. + if (pdev)
  22844. + strcpy (fb_info.gen.info.modename,"Digital ZLXp-E2");
  22845. + else
  22846. + strcpy (fb_info.gen.info.modename,"Digital ZLX-E2");
  22847. break;
  22848. case TGA_TYPE_24PLUSZ:
  22849. - strcpy (fb_info.gen.info.modename,"Digital ZLXp-E3");
  22850. + if (pdev)
  22851. + strcpy (fb_info.gen.info.modename,"Digital ZLXp-E3");
  22852. + else
  22853. + strcpy (fb_info.gen.info.modename,"Digital ZLX-E3");
  22854. break;
  22855. }
  22856. /* This should give a reasonable default video mode */
  22857. if (!default_var_valid) {
  22858. - default_var = tgafb_predefined[0].var;
  22859. + if (pdev)
  22860. + default_var = tgafb_predefined[0].var;
  22861. + else
  22862. + default_var = tgafb_predefined[1].var;
  22863. }
  22864. fbgen_get_var(&disp.var, -1, &fb_info.gen.info);
  22865. disp.var.activate = FB_ACTIVATE_NOW;
  22866. fbgen_do_set_var(&disp.var, 1, &fb_info.gen);
  22867. fbgen_set_disp(-1, &fb_info.gen);
  22868. fbgen_install_cmap(0, &fb_info.gen);
  22869. - if (register_framebuffer(&fb_info.gen.info) < 0)
  22870. + if (register_framebuffer(&fb_info.gen.info) < 0) {
  22871. + if (slot >= 0)
  22872. + release_tc_card(slot);
  22873. return -EINVAL;
  22874. - printk(KERN_INFO "fb%d: %s frame buffer device at 0x%lx\n",
  22875. + }
  22876. + printk(KERN_INFO "fb%d: %s frame buffer device at 0x%llx\n",
  22877. GET_FB_IDX(fb_info.gen.info.node), fb_info.gen.info.modename,
  22878. - pdev->resource[0].start);
  22879. + fb_info.tga_mem_base);
  22880. return 0;
  22881. }
  22882. --- a/drivers/video/tgafb.h
  22883. +++ b/drivers/video/tgafb.h
  22884. @@ -36,6 +36,7 @@
  22885. #define TGA_RASTEROP_REG 0x0034
  22886. #define TGA_PIXELSHIFT_REG 0x0038
  22887. #define TGA_DEEP_REG 0x0050
  22888. +#define TGA_START_REG 0x0054
  22889. #define TGA_PIXELMASK_REG 0x005c
  22890. #define TGA_CURSOR_BASE_REG 0x0060
  22891. #define TGA_HORIZ_REG 0x0064
  22892. --- a/fs/binfmt_elf.c
  22893. +++ b/fs/binfmt_elf.c
  22894. @@ -665,6 +665,9 @@ static int load_elf_binary(struct linux_
  22895. bprm->argc++;
  22896. }
  22897. }
  22898. + } else {
  22899. + /* Executables without an interpreter also need a personality */
  22900. + SET_PERSONALITY(elf_ex, ibcs2_interpreter);
  22901. }
  22902. /* Flush all traces of the currently running executable */
  22903. @@ -1225,7 +1228,11 @@ static int elf_core_dump(long signr, str
  22904. elf.e_entry = 0;
  22905. elf.e_phoff = sizeof(elf);
  22906. elf.e_shoff = 0;
  22907. +#ifdef ELF_CORE_EFLAGS
  22908. + elf.e_flags = ELF_CORE_EFLAGS;
  22909. +#else
  22910. elf.e_flags = 0;
  22911. +#endif
  22912. elf.e_ehsize = sizeof(elf);
  22913. elf.e_phentsize = sizeof(struct elf_phdr);
  22914. elf.e_phnum = segs+1; /* Include notes */
  22915. --- a/fs/partitions/sgi.c
  22916. +++ b/fs/partitions/sgi.c
  22917. @@ -17,6 +17,11 @@
  22918. #include "check.h"
  22919. #include "sgi.h"
  22920. +#if CONFIG_BLK_DEV_MD
  22921. +extern void md_autodetect_dev(kdev_t dev);
  22922. +#endif
  22923. +
  22924. +
  22925. int sgi_partition(struct gendisk *hd, struct block_device *bdev, unsigned long first_sector, int current_minor)
  22926. {
  22927. int i, csum, magic;
  22928. @@ -77,6 +82,10 @@ int sgi_partition(struct gendisk *hd, st
  22929. if(!blocks)
  22930. continue;
  22931. add_gd_partition(hd, current_minor, start, blocks);
  22932. +#ifdef CONFIG_BLK_DEV_MD
  22933. + if (be32_to_cpu(p->type) == LINUX_RAID_PARTITION)
  22934. + md_autodetect_dev(MKDEV(hd->major, current_minor));
  22935. +#endif
  22936. current_minor++;
  22937. }
  22938. printk("\n");
  22939. --- a/fs/proc/array.c
  22940. +++ b/fs/proc/array.c
  22941. @@ -368,15 +368,15 @@ int proc_pid_stat(struct task_struct *ta
  22942. task->cmin_flt,
  22943. task->maj_flt,
  22944. task->cmaj_flt,
  22945. - task->times.tms_utime,
  22946. - task->times.tms_stime,
  22947. - task->times.tms_cutime,
  22948. - task->times.tms_cstime,
  22949. + hz_to_std(task->times.tms_utime),
  22950. + hz_to_std(task->times.tms_stime),
  22951. + hz_to_std(task->times.tms_cutime),
  22952. + hz_to_std(task->times.tms_cstime),
  22953. priority,
  22954. nice,
  22955. 0UL /* removed */,
  22956. task->it_real_value,
  22957. - task->start_time,
  22958. + hz_to_std(task->start_time),
  22959. vsize,
  22960. mm ? mm->rss : 0, /* you might want to shift this left 3 */
  22961. task->rlim[RLIMIT_RSS].rlim_cur,
  22962. @@ -615,14 +615,14 @@ int proc_pid_cpu(struct task_struct *tas
  22963. len = sprintf(buffer,
  22964. "cpu %lu %lu\n",
  22965. - task->times.tms_utime,
  22966. - task->times.tms_stime);
  22967. + hz_to_std(task->times.tms_utime),
  22968. + hz_to_std(task->times.tms_stime));
  22969. for (i = 0 ; i < smp_num_cpus; i++)
  22970. len += sprintf(buffer + len, "cpu%d %lu %lu\n",
  22971. i,
  22972. - task->per_cpu_utime[cpu_logical_map(i)],
  22973. - task->per_cpu_stime[cpu_logical_map(i)]);
  22974. + hz_to_std(task->per_cpu_utime[cpu_logical_map(i)]),
  22975. + hz_to_std(task->per_cpu_stime[cpu_logical_map(i)]));
  22976. return len;
  22977. }
  22978. --- a/fs/proc/proc_misc.c
  22979. +++ b/fs/proc/proc_misc.c
  22980. @@ -308,16 +308,16 @@ static int kstat_read_proc(char *page, c
  22981. {
  22982. int i, len = 0;
  22983. extern unsigned long total_forks;
  22984. - unsigned long jif = jiffies;
  22985. + unsigned long jif = hz_to_std(jiffies);
  22986. unsigned int sum = 0, user = 0, nice = 0, system = 0;
  22987. int major, disk;
  22988. for (i = 0 ; i < smp_num_cpus; i++) {
  22989. int cpu = cpu_logical_map(i), j;
  22990. - user += kstat.per_cpu_user[cpu];
  22991. - nice += kstat.per_cpu_nice[cpu];
  22992. - system += kstat.per_cpu_system[cpu];
  22993. + user += hz_to_std(kstat.per_cpu_user[cpu]);
  22994. + nice += hz_to_std(kstat.per_cpu_nice[cpu]);
  22995. + system += hz_to_std(kstat.per_cpu_system[cpu]);
  22996. #if !defined(CONFIG_ARCH_S390)
  22997. for (j = 0 ; j < NR_IRQS ; j++)
  22998. sum += kstat.irqs[cpu][j];
  22999. @@ -331,10 +331,10 @@ static int kstat_read_proc(char *page, c
  23000. proc_sprintf(page, &off, &len,
  23001. "cpu%d %u %u %u %lu\n",
  23002. i,
  23003. - kstat.per_cpu_user[cpu_logical_map(i)],
  23004. - kstat.per_cpu_nice[cpu_logical_map(i)],
  23005. - kstat.per_cpu_system[cpu_logical_map(i)],
  23006. - jif - ( kstat.per_cpu_user[cpu_logical_map(i)] \
  23007. + hz_to_std(kstat.per_cpu_user[cpu_logical_map(i)]),
  23008. + hz_to_std(kstat.per_cpu_nice[cpu_logical_map(i)]),
  23009. + hz_to_std(kstat.per_cpu_system[cpu_logical_map(i)]),
  23010. + jif - hz_to_std( kstat.per_cpu_user[cpu_logical_map(i)] \
  23011. + kstat.per_cpu_nice[cpu_logical_map(i)] \
  23012. + kstat.per_cpu_system[cpu_logical_map(i)]));
  23013. proc_sprintf(page, &off, &len,
  23014. --- a/include/asm-alpha/param.h
  23015. +++ b/include/asm-alpha/param.h
  23016. @@ -13,6 +13,9 @@
  23017. # else
  23018. # define HZ 1200
  23019. # endif
  23020. +#ifdef __KERNEL__
  23021. +# define hz_to_std(a) (a)
  23022. +#endif
  23023. #endif
  23024. #define EXEC_PAGESIZE 8192
  23025. --- a/include/asm-i386/param.h
  23026. +++ b/include/asm-i386/param.h
  23027. @@ -3,6 +3,9 @@
  23028. #ifndef HZ
  23029. #define HZ 100
  23030. +#ifdef __KERNEL__
  23031. +#define hz_to_std(a) (a)
  23032. +#endif
  23033. #endif
  23034. #define EXEC_PAGESIZE 4096
  23035. --- a/include/asm-ia64/param.h
  23036. +++ b/include/asm-ia64/param.h
  23037. @@ -7,9 +7,15 @@
  23038. * Based on <asm-i386/param.h>.
  23039. *
  23040. * Modified 1998, 1999, 2002-2003
  23041. - * David Mosberger-Tang <[email protected]>, Hewlett-Packard Co
  23042. + * David Mosberger-Tang <[email protected]>, Hewlett-Packard Co
  23043. */
  23044. +#include <linux/config.h>
  23045. +
  23046. +#ifdef __KERNEL__
  23047. +#define hz_to_std(a) (a)
  23048. +#endif
  23049. +
  23050. #define EXEC_PAGESIZE 65536
  23051. #ifndef NGROUPS
  23052. --- a/include/asm-m68k/param.h
  23053. +++ b/include/asm-m68k/param.h
  23054. @@ -3,6 +3,9 @@
  23055. #ifndef HZ
  23056. #define HZ 100
  23057. +#ifdef __KERNEL__
  23058. +#define hz_to_std(a) (a)
  23059. +#endif
  23060. #endif
  23061. #define EXEC_PAGESIZE 8192
  23062. --- a/include/asm-mips/au1000_gpio.h
  23063. +++ b/include/asm-mips/au1000_gpio.h
  23064. @@ -30,6 +30,13 @@
  23065. * 675 Mass Ave, Cambridge, MA 02139, USA.
  23066. */
  23067. +/*
  23068. + * Revision history
  23069. + * 01/31/02 0.01 Initial release. Steve Longerbeam, MontaVista
  23070. + * 10/12/03 0.1 Added Au1100/Au1500, GPIO2, and bit operations. K.C. Nishio, AMD
  23071. + * 08/05/04 0.11 Added Au1550 and Au1200. K.C. Nishio
  23072. + */
  23073. +
  23074. #ifndef __AU1000_GPIO_H
  23075. #define __AU1000_GPIO_H
  23076. @@ -44,13 +51,94 @@
  23077. #define AU1000GPIO_TRISTATE _IOW (AU1000GPIO_IOC_MAGIC, 4, int)
  23078. #define AU1000GPIO_AVAIL_MASK _IOR (AU1000GPIO_IOC_MAGIC, 5, int)
  23079. +// bit operations
  23080. +#define AU1000GPIO_BIT_READ _IOW (AU1000GPIO_IOC_MAGIC, 6, int)
  23081. +#define AU1000GPIO_BIT_SET _IOW (AU1000GPIO_IOC_MAGIC, 7, int)
  23082. +#define AU1000GPIO_BIT_CLEAR _IOW (AU1000GPIO_IOC_MAGIC, 8, int)
  23083. +#define AU1000GPIO_BIT_TRISTATE _IOW (AU1000GPIO_IOC_MAGIC, 9, int)
  23084. +#define AU1000GPIO_BIT_INIT _IOW (AU1000GPIO_IOC_MAGIC, 10, int)
  23085. +#define AU1000GPIO_BIT_TERM _IOW (AU1000GPIO_IOC_MAGIC, 11, int)
  23086. +
  23087. +/* set this major numer same as the CRIS GPIO driver */
  23088. +#define AU1X00_GPIO_MAJOR (120)
  23089. +
  23090. +#define ENABLED_ZERO (0)
  23091. +#define ENABLED_ONE (1)
  23092. +#define ENABLED_10 (0x2)
  23093. +#define ENABLED_11 (0x3)
  23094. +#define ENABLED_111 (0x7)
  23095. +#define NOT_AVAIL (-1)
  23096. +#define AU1X00_MAX_PRIMARY_GPIO (32)
  23097. +
  23098. +#define AU1000_GPIO_MINOR_MAX AU1X00_MAX_PRIMARY_GPIO
  23099. +/* Au1100, 1500, 1550 and 1200 have the secondary GPIO block */
  23100. +#define AU1XX0_GPIO_MINOR_MAX (48)
  23101. +
  23102. +#define AU1X00_GPIO_NAME "gpio"
  23103. +
  23104. +/* GPIO pins which are not multiplexed */
  23105. +#if defined(CONFIG_SOC_AU1000)
  23106. + #define NATIVE_GPIOPIN ((1 << 15) | (1 << 8) | (1 << 7) | (1 << 1) | (1 << 0))
  23107. + #define NATIVE_GPIO2PIN (0)
  23108. +#elif defined(CONFIG_SOC_AU1100)
  23109. + #define NATIVE_GPIOPIN ((1 << 23) | (1 << 22) | (1 << 21) | (1 << 20) | (1 << 19) | (1 << 18) | \
  23110. + (1 << 17) | (1 << 16) | (1 << 7) | (1 << 1) | (1 << 0))
  23111. + #define NATIVE_GPIO2PIN (0)
  23112. +#elif defined(CONFIG_SOC_AU1500)
  23113. + #define NATIVE_GPIOPIN ((1 << 15) | (1 << 8) | (1 << 7) | (1 << 1) | (1 << 0))
  23114. + /* exclude the PCI reset output signal: GPIO[200], DMA_REQ2 and DMA_REQ3 */
  23115. + #define NATIVE_GPIO2PIN (0xfffe & ~((1 << 9) | (1 << 8)))
  23116. +#elif defined(CONFIG_SOC_AU1550)
  23117. + #define NATIVE_GPIOPIN ((1 << 15) | (1 << 8) | (1 << 7) | (1 << 6) | (1 << 1) | (1 << 0))
  23118. + /* please refere Au1550 Data Book, chapter 15 */
  23119. + #define NATIVE_GPIO2PIN (1 << 5)
  23120. +#elif defined(CONFIG_SOC_AU1200)
  23121. + #define NATIVE_GPIOPIN ((1 << 7) | (1 << 5))
  23122. + #define NATIVE_GPIO2PIN (0)
  23123. +#endif
  23124. +
  23125. +/* minor as u32 */
  23126. +#define MINOR_TO_GPIOPIN(minor) ((minor < AU1X00_MAX_PRIMARY_GPIO) ? minor : (minor - AU1X00_MAX_PRIMARY_GPIO))
  23127. +#define IS_PRIMARY_GPIOPIN(minor) ((minor < AU1X00_MAX_PRIMARY_GPIO) ? 1 : 0)
  23128. +
  23129. +/*
  23130. + * pin to minor mapping.
  23131. + * GPIO0-GPIO31, minor=0-31.
  23132. + * GPIO200-GPIO215, minor=32-47.
  23133. + */
  23134. +typedef struct _au1x00_gpio_bit_ctl {
  23135. + int direction; // The direction of this GPIO pin. 0: IN, 1: OUT.
  23136. + int data; // Pin output when itized (0/1), or at the term. 0/1/-1 (tristate).
  23137. +} au1x00_gpio_bit_ctl;
  23138. +
  23139. +typedef struct _au1x00_gpio_driver {
  23140. + const char *driver_name;
  23141. + const char *name;
  23142. + int name_base; /* offset of printed name */
  23143. + short major; /* major device number */
  23144. + short minor_start; /* start of minor device number*/
  23145. + short num; /* number of devices */
  23146. +} au1x00_gpio_driver;
  23147. +
  23148. #ifdef __KERNEL__
  23149. -extern u32 get_au1000_avail_gpio_mask(void);
  23150. -extern int au1000gpio_tristate(u32 data);
  23151. -extern int au1000gpio_in(u32 *data);
  23152. -extern int au1000gpio_set(u32 data);
  23153. -extern int au1000gpio_clear(u32 data);
  23154. -extern int au1000gpio_out(u32 data);
  23155. +extern u32 get_au1000_avail_gpio_mask(u32 *avail_gpio2);
  23156. +extern int au1000gpio_tristate(u32 minor, u32 data);
  23157. +extern int au1000gpio_in(u32 minor, u32 *data);
  23158. +extern int au1000gpio_set(u32 minor, u32 data);
  23159. +extern int au1000gpio_clear(u32 minor, u32 data);
  23160. +extern int au1000gpio_out(u32 minor, u32 data);
  23161. +extern int au1000gpio_bit_read(u32 minor, u32 *read_data);
  23162. +extern int au1000gpio_bit_set(u32 minor);
  23163. +extern int au1000gpio_bit_clear(u32 minor);
  23164. +extern int au1000gpio_bit_tristate(u32 minor);
  23165. +extern int check_minor_to_gpio(u32 minor);
  23166. +extern int au1000gpio_bit_init(u32 minor, au1x00_gpio_bit_ctl *bit_opt);
  23167. +extern int au1000gpio_bit_term(u32 minor, au1x00_gpio_bit_ctl *bit_opt);
  23168. +
  23169. +extern void gpio_register_devfs (au1x00_gpio_driver *driver, unsigned int flags, unsigned minor);
  23170. +extern void gpio_unregister_devfs (au1x00_gpio_driver *driver, unsigned minor);
  23171. +extern int gpio_register_driver(au1x00_gpio_driver *driver);
  23172. +extern int gpio_unregister_driver(au1x00_gpio_driver *driver);
  23173. #endif
  23174. #endif
  23175. --- a/include/asm-mips/au1000.h
  23176. +++ b/include/asm-mips/au1000.h
  23177. @@ -160,28 +160,356 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  23178. #define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)
  23179. #endif
  23180. -/* SDRAM Controller */
  23181. +/*
  23182. + * SDRAM Register Offsets
  23183. + */
  23184. #if defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1100)
  23185. -#define MEM_SDMODE0 0xB4000000
  23186. -#define MEM_SDMODE1 0xB4000004
  23187. -#define MEM_SDMODE2 0xB4000008
  23188. -
  23189. -#define MEM_SDADDR0 0xB400000C
  23190. -#define MEM_SDADDR1 0xB4000010
  23191. -#define MEM_SDADDR2 0xB4000014
  23192. -
  23193. -#define MEM_SDREFCFG 0xB4000018
  23194. -#define MEM_SDPRECMD 0xB400001C
  23195. -#define MEM_SDAUTOREF 0xB4000020
  23196. -
  23197. -#define MEM_SDWRMD0 0xB4000024
  23198. -#define MEM_SDWRMD1 0xB4000028
  23199. -#define MEM_SDWRMD2 0xB400002C
  23200. +#define MEM_SDMODE0 (0x0000)
  23201. +#define MEM_SDMODE1 (0x0004)
  23202. +#define MEM_SDMODE2 (0x0008)
  23203. +#define MEM_SDADDR0 (0x000C)
  23204. +#define MEM_SDADDR1 (0x0010)
  23205. +#define MEM_SDADDR2 (0x0014)
  23206. +#define MEM_SDREFCFG (0x0018)
  23207. +#define MEM_SDPRECMD (0x001C)
  23208. +#define MEM_SDAUTOREF (0x0020)
  23209. +#define MEM_SDWRMD0 (0x0024)
  23210. +#define MEM_SDWRMD1 (0x0028)
  23211. +#define MEM_SDWRMD2 (0x002C)
  23212. +#define MEM_SDSLEEP (0x0030)
  23213. +#define MEM_SDSMCKE (0x0034)
  23214. +
  23215. +#ifndef ASSEMBLER
  23216. +/*typedef volatile struct
  23217. +{
  23218. + uint32 sdmode0;
  23219. + uint32 sdmode1;
  23220. + uint32 sdmode2;
  23221. + uint32 sdaddr0;
  23222. + uint32 sdaddr1;
  23223. + uint32 sdaddr2;
  23224. + uint32 sdrefcfg;
  23225. + uint32 sdautoref;
  23226. + uint32 sdwrmd0;
  23227. + uint32 sdwrmd1;
  23228. + uint32 sdwrmd2;
  23229. + uint32 sdsleep;
  23230. + uint32 sdsmcke;
  23231. +
  23232. +} AU1X00_SDRAM;*/
  23233. +#endif
  23234. +
  23235. +/*
  23236. + * MEM_SDMODE register content definitions
  23237. + */
  23238. +#define MEM_SDMODE_F (1<<22)
  23239. +#define MEM_SDMODE_SR (1<<21)
  23240. +#define MEM_SDMODE_BS (1<<20)
  23241. +#define MEM_SDMODE_RS (3<<18)
  23242. +#define MEM_SDMODE_CS (7<<15)
  23243. +#define MEM_SDMODE_TRAS (15<<11)
  23244. +#define MEM_SDMODE_TMRD (3<<9)
  23245. +#define MEM_SDMODE_TWR (3<<7)
  23246. +#define MEM_SDMODE_TRP (3<<5)
  23247. +#define MEM_SDMODE_TRCD (3<<3)
  23248. +#define MEM_SDMODE_TCL (7<<0)
  23249. +
  23250. +#define MEM_SDMODE_BS_2Bank (0<<20)
  23251. +#define MEM_SDMODE_BS_4Bank (1<<20)
  23252. +#define MEM_SDMODE_RS_11Row (0<<18)
  23253. +#define MEM_SDMODE_RS_12Row (1<<18)
  23254. +#define MEM_SDMODE_RS_13Row (2<<18)
  23255. +#define MEM_SDMODE_RS_N(N) ((N)<<18)
  23256. +#define MEM_SDMODE_CS_7Col (0<<15)
  23257. +#define MEM_SDMODE_CS_8Col (1<<15)
  23258. +#define MEM_SDMODE_CS_9Col (2<<15)
  23259. +#define MEM_SDMODE_CS_10Col (3<<15)
  23260. +#define MEM_SDMODE_CS_11Col (4<<15)
  23261. +#define MEM_SDMODE_CS_N(N) ((N)<<15)
  23262. +#define MEM_SDMODE_TRAS_N(N) ((N)<<11)
  23263. +#define MEM_SDMODE_TMRD_N(N) ((N)<<9)
  23264. +#define MEM_SDMODE_TWR_N(N) ((N)<<7)
  23265. +#define MEM_SDMODE_TRP_N(N) ((N)<<5)
  23266. +#define MEM_SDMODE_TRCD_N(N) ((N)<<3)
  23267. +#define MEM_SDMODE_TCL_N(N) ((N)<<0)
  23268. +
  23269. +/*
  23270. + * MEM_SDADDR register contents definitions
  23271. + */
  23272. +#define MEM_SDADDR_E (1<<20)
  23273. +#define MEM_SDADDR_CSBA (0x03FF<<10)
  23274. +#define MEM_SDADDR_CSMASK (0x03FF<<0)
  23275. +#define MEM_SDADDR_CSBA_N(N) ((N)&(0x03FF<<22)>>12)
  23276. +#define MEM_SDADDR_CSMASK_N(N) ((N)&(0x03FF<<22)>>22)
  23277. +
  23278. +/*
  23279. + * MEM_SDREFCFG register content definitions
  23280. + */
  23281. +#define MEM_SDREFCFG_TRC (15<<28)
  23282. +#define MEM_SDREFCFG_TRPM (3<<26)
  23283. +#define MEM_SDREFCFG_E (1<<25)
  23284. +#define MEM_SDREFCFG_RE (0x1ffffff<<0)
  23285. +#define MEM_SDREFCFG_TRC_N(N) ((N)<<MEM_SDREFCFG_TRC)
  23286. +#define MEM_SDREFCFG_TRPM_N(N) ((N)<<MEM_SDREFCFG_TRPM)
  23287. +#define MEM_SDREFCFG_REF_N(N) (N)
  23288. +#endif
  23289. +
  23290. +/***********************************************************************/
  23291. +
  23292. +/*
  23293. + * Au1550 SDRAM Register Offsets
  23294. + */
  23295. +
  23296. +/***********************************************************************/
  23297. +
  23298. +#if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
  23299. +#define MEM_SDMODE0 (0x0800)
  23300. +#define MEM_SDMODE1 (0x0808)
  23301. +#define MEM_SDMODE2 (0x0810)
  23302. +#define MEM_SDADDR0 (0x0820)
  23303. +#define MEM_SDADDR1 (0x0828)
  23304. +#define MEM_SDADDR2 (0x0830)
  23305. +#define MEM_SDCONFIGA (0x0840)
  23306. +#define MEM_SDCONFIGB (0x0848)
  23307. +#define MEM_SDSTAT (0x0850)
  23308. +#define MEM_SDERRADDR (0x0858)
  23309. +#define MEM_SDSTRIDE0 (0x0860)
  23310. +#define MEM_SDSTRIDE1 (0x0868)
  23311. +#define MEM_SDSTRIDE2 (0x0870)
  23312. +#define MEM_SDWRMD0 (0x0880)
  23313. +#define MEM_SDWRMD1 (0x0888)
  23314. +#define MEM_SDWRMD2 (0x0890)
  23315. +#define MEM_SDPRECMD (0x08C0)
  23316. +#define MEM_SDAUTOREF (0x08C8)
  23317. +#define MEM_SDSREF (0x08D0)
  23318. +#define MEM_SDSLEEP MEM_SDSREF
  23319. +
  23320. +#ifndef ASSEMBLER
  23321. +/*typedef volatile struct
  23322. +{
  23323. + uint32 sdmode0;
  23324. + uint32 reserved0;
  23325. + uint32 sdmode1;
  23326. + uint32 reserved1;
  23327. + uint32 sdmode2;
  23328. + uint32 reserved2[3];
  23329. + uint32 sdaddr0;
  23330. + uint32 reserved3;
  23331. + uint32 sdaddr1;
  23332. + uint32 reserved4;
  23333. + uint32 sdaddr2;
  23334. + uint32 reserved5[3];
  23335. + uint32 sdconfiga;
  23336. + uint32 reserved6;
  23337. + uint32 sdconfigb;
  23338. + uint32 reserved7;
  23339. + uint32 sdstat;
  23340. + uint32 reserved8;
  23341. + uint32 sderraddr;
  23342. + uint32 reserved9;
  23343. + uint32 sdstride0;
  23344. + uint32 reserved10;
  23345. + uint32 sdstride1;
  23346. + uint32 reserved11;
  23347. + uint32 sdstride2;
  23348. + uint32 reserved12[3];
  23349. + uint32 sdwrmd0;
  23350. + uint32 reserved13;
  23351. + uint32 sdwrmd1;
  23352. + uint32 reserved14;
  23353. + uint32 sdwrmd2;
  23354. + uint32 reserved15[11];
  23355. + uint32 sdprecmd;
  23356. + uint32 reserved16;
  23357. + uint32 sdautoref;
  23358. + uint32 reserved17;
  23359. + uint32 sdsref;
  23360. +
  23361. +} AU1550_SDRAM;*/
  23362. +#endif
  23363. +#endif
  23364. +
  23365. +/*
  23366. + * Physical base addresses for integrated peripherals
  23367. + */
  23368. +
  23369. +#ifdef CONFIG_SOC_AU1000
  23370. +#define MEM_PHYS_ADDR 0x14000000
  23371. +#define STATIC_MEM_PHYS_ADDR 0x14001000
  23372. +#define DMA0_PHYS_ADDR 0x14002000
  23373. +#define DMA1_PHYS_ADDR 0x14002100
  23374. +#define DMA2_PHYS_ADDR 0x14002200
  23375. +#define DMA3_PHYS_ADDR 0x14002300
  23376. +#define DMA4_PHYS_ADDR 0x14002400
  23377. +#define DMA5_PHYS_ADDR 0x14002500
  23378. +#define DMA6_PHYS_ADDR 0x14002600
  23379. +#define DMA7_PHYS_ADDR 0x14002700
  23380. +#define IC0_PHYS_ADDR 0x10400000
  23381. +#define IC1_PHYS_ADDR 0x11800000
  23382. +#define AC97_PHYS_ADDR 0x10000000
  23383. +#define USBH_PHYS_ADDR 0x10100000
  23384. +#define USBD_PHYS_ADDR 0x10200000
  23385. +#define IRDA_PHYS_ADDR 0x10300000
  23386. +#define MAC0_PHYS_ADDR 0x10500000
  23387. +#define MAC1_PHYS_ADDR 0x10510000
  23388. +#define MACEN_PHYS_ADDR 0x10520000
  23389. +#define MACDMA0_PHYS_ADDR 0x14004000
  23390. +#define MACDMA1_PHYS_ADDR 0x14004200
  23391. +#define I2S_PHYS_ADDR 0x11000000
  23392. +#define UART0_PHYS_ADDR 0x11100000
  23393. +#define UART1_PHYS_ADDR 0x11200000
  23394. +#define UART2_PHYS_ADDR 0x11300000
  23395. +#define UART3_PHYS_ADDR 0x11400000
  23396. +#define SSI0_PHYS_ADDR 0x11600000
  23397. +#define SSI1_PHYS_ADDR 0x11680000
  23398. +#define SYS_PHYS_ADDR 0x11900000
  23399. +#define PCMCIA_IO_PHYS_ADDR 0xF00000000
  23400. +#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000
  23401. +#define PCMCIA_MEM_PHYS_ADDR 0xF80000000
  23402. +#endif
  23403. +
  23404. +/********************************************************************/
  23405. -#define MEM_SDSLEEP 0xB4000030
  23406. -#define MEM_SDSMCKE 0xB4000034
  23407. +#ifdef CONFIG_SOC_AU1500
  23408. +#define MEM_PHYS_ADDR 0x14000000
  23409. +#define STATIC_MEM_PHYS_ADDR 0x14001000
  23410. +#define DMA0_PHYS_ADDR 0x14002000
  23411. +#define DMA1_PHYS_ADDR 0x14002100
  23412. +#define DMA2_PHYS_ADDR 0x14002200
  23413. +#define DMA3_PHYS_ADDR 0x14002300
  23414. +#define DMA4_PHYS_ADDR 0x14002400
  23415. +#define DMA5_PHYS_ADDR 0x14002500
  23416. +#define DMA6_PHYS_ADDR 0x14002600
  23417. +#define DMA7_PHYS_ADDR 0x14002700
  23418. +#define IC0_PHYS_ADDR 0x10400000
  23419. +#define IC1_PHYS_ADDR 0x11800000
  23420. +#define AC97_PHYS_ADDR 0x10000000
  23421. +#define USBH_PHYS_ADDR 0x10100000
  23422. +#define USBD_PHYS_ADDR 0x10200000
  23423. +#define PCI_PHYS_ADDR 0x14005000
  23424. +#define MAC0_PHYS_ADDR 0x11500000
  23425. +#define MAC1_PHYS_ADDR 0x11510000
  23426. +#define MACEN_PHYS_ADDR 0x11520000
  23427. +#define MACDMA0_PHYS_ADDR 0x14004000
  23428. +#define MACDMA1_PHYS_ADDR 0x14004200
  23429. +#define I2S_PHYS_ADDR 0x11000000
  23430. +#define UART0_PHYS_ADDR 0x11100000
  23431. +#define UART3_PHYS_ADDR 0x11400000
  23432. +#define GPIO2_PHYS_ADDR 0x11700000
  23433. +#define SYS_PHYS_ADDR 0x11900000
  23434. +#define PCI_MEM_PHYS_ADDR 0x400000000
  23435. +#define PCI_IO_PHYS_ADDR 0x500000000
  23436. +#define PCI_CONFIG0_PHYS_ADDR 0x600000000
  23437. +#define PCI_CONFIG1_PHYS_ADDR 0x680000000
  23438. +#define PCMCIA_IO_PHYS_ADDR 0xF00000000
  23439. +#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000
  23440. +#define PCMCIA_MEM_PHYS_ADDR 0xF80000000
  23441. #endif
  23442. +/********************************************************************/
  23443. +
  23444. +#ifdef CONFIG_SOC_AU1100
  23445. +#define MEM_PHYS_ADDR 0x14000000
  23446. +#define STATIC_MEM_PHYS_ADDR 0x14001000
  23447. +#define DMA0_PHYS_ADDR 0x14002000
  23448. +#define DMA1_PHYS_ADDR 0x14002100
  23449. +#define DMA2_PHYS_ADDR 0x14002200
  23450. +#define DMA3_PHYS_ADDR 0x14002300
  23451. +#define DMA4_PHYS_ADDR 0x14002400
  23452. +#define DMA5_PHYS_ADDR 0x14002500
  23453. +#define DMA6_PHYS_ADDR 0x14002600
  23454. +#define DMA7_PHYS_ADDR 0x14002700
  23455. +#define IC0_PHYS_ADDR 0x10400000
  23456. +#define SD0_PHYS_ADDR 0x10600000
  23457. +#define SD1_PHYS_ADDR 0x10680000
  23458. +#define IC1_PHYS_ADDR 0x11800000
  23459. +#define AC97_PHYS_ADDR 0x10000000
  23460. +#define USBH_PHYS_ADDR 0x10100000
  23461. +#define USBD_PHYS_ADDR 0x10200000
  23462. +#define IRDA_PHYS_ADDR 0x10300000
  23463. +#define MAC0_PHYS_ADDR 0x10500000
  23464. +#define MACEN_PHYS_ADDR 0x10520000
  23465. +#define MACDMA0_PHYS_ADDR 0x14004000
  23466. +#define MACDMA1_PHYS_ADDR 0x14004200
  23467. +#define I2S_PHYS_ADDR 0x11000000
  23468. +#define UART0_PHYS_ADDR 0x11100000
  23469. +#define UART1_PHYS_ADDR 0x11200000
  23470. +#define UART3_PHYS_ADDR 0x11400000
  23471. +#define SSI0_PHYS_ADDR 0x11600000
  23472. +#define SSI1_PHYS_ADDR 0x11680000
  23473. +#define GPIO2_PHYS_ADDR 0x11700000
  23474. +#define SYS_PHYS_ADDR 0x11900000
  23475. +#define LCD_PHYS_ADDR 0x15000000
  23476. +#define PCMCIA_IO_PHYS_ADDR 0xF00000000
  23477. +#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000
  23478. +#define PCMCIA_MEM_PHYS_ADDR 0xF80000000
  23479. +#endif
  23480. +
  23481. +/***********************************************************************/
  23482. +
  23483. +#ifdef CONFIG_SOC_AU1550
  23484. +#define MEM_PHYS_ADDR 0x14000000
  23485. +#define STATIC_MEM_PHYS_ADDR 0x14001000
  23486. +#define IC0_PHYS_ADDR 0x10400000
  23487. +#define IC1_PHYS_ADDR 0x11800000
  23488. +#define USBH_PHYS_ADDR 0x14020000
  23489. +#define USBD_PHYS_ADDR 0x10200000
  23490. +#define PCI_PHYS_ADDR 0x14005000
  23491. +#define MAC0_PHYS_ADDR 0x10500000
  23492. +#define MAC1_PHYS_ADDR 0x10510000
  23493. +#define MACEN_PHYS_ADDR 0x10520000
  23494. +#define MACDMA0_PHYS_ADDR 0x14004000
  23495. +#define MACDMA1_PHYS_ADDR 0x14004200
  23496. +#define UART0_PHYS_ADDR 0x11100000
  23497. +#define UART1_PHYS_ADDR 0x11200000
  23498. +#define UART3_PHYS_ADDR 0x11400000
  23499. +#define GPIO2_PHYS_ADDR 0x11700000
  23500. +#define SYS_PHYS_ADDR 0x11900000
  23501. +#define DDMA_PHYS_ADDR 0x14002000
  23502. +#define PE_PHYS_ADDR 0x14008000
  23503. +#define PSC0_PHYS_ADDR 0x11A00000
  23504. +#define PSC1_PHYS_ADDR 0x11B00000
  23505. +#define PSC2_PHYS_ADDR 0x10A00000
  23506. +#define PSC3_PHYS_ADDR 0x10B00000
  23507. +#define PCI_MEM_PHYS_ADDR 0x400000000
  23508. +#define PCI_IO_PHYS_ADDR 0x500000000
  23509. +#define PCI_CONFIG0_PHYS_ADDR 0x600000000
  23510. +#define PCI_CONFIG1_PHYS_ADDR 0x680000000
  23511. +#define PCMCIA_IO_PHYS_ADDR 0xF00000000
  23512. +#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000
  23513. +#define PCMCIA_MEM_PHYS_ADDR 0xF80000000
  23514. +#endif
  23515. +
  23516. +/***********************************************************************/
  23517. +
  23518. +#ifdef CONFIG_SOC_AU1200
  23519. +#define MEM_PHYS_ADDR 0x14000000
  23520. +#define STATIC_MEM_PHYS_ADDR 0x14001000
  23521. +#define AES_PHYS_ADDR 0x10300000
  23522. +#define CIM_PHYS_ADDR 0x14004000
  23523. +#define IC0_PHYS_ADDR 0x10400000
  23524. +#define IC1_PHYS_ADDR 0x11800000
  23525. +#define USBM_PHYS_ADDR 0x14020000
  23526. +#define USBH_PHYS_ADDR 0x14020100
  23527. +#define UART0_PHYS_ADDR 0x11100000
  23528. +#define UART1_PHYS_ADDR 0x11200000
  23529. +#define GPIO2_PHYS_ADDR 0x11700000
  23530. +#define SYS_PHYS_ADDR 0x11900000
  23531. +#define DDMA_PHYS_ADDR 0x14002000
  23532. +#define PSC0_PHYS_ADDR 0x11A00000
  23533. +#define PSC1_PHYS_ADDR 0x11B00000
  23534. +#define PCMCIA_IO_PHYS_ADDR 0xF00000000
  23535. +#define PCMCIA_ATTR_PHYS_ADDR 0xF40000000
  23536. +#define PCMCIA_MEM_PHYS_ADDR 0xF80000000
  23537. +#define SD0_PHYS_ADDR 0x10600000
  23538. +#define SD1_PHYS_ADDR 0x10680000
  23539. +#define LCD_PHYS_ADDR 0x15000000
  23540. +#define SWCNT_PHYS_ADDR 0x1110010C
  23541. +#define MAEFE_PHYS_ADDR 0x14012000
  23542. +#define MAEBE_PHYS_ADDR 0x14010000
  23543. +#endif
  23544. +
  23545. +
  23546. /* Static Bus Controller */
  23547. #define MEM_STCFG0 0xB4001000
  23548. #define MEM_STTIME0 0xB4001004
  23549. @@ -367,7 +695,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  23550. #define AU1000_MAC0_ENABLE 0xB0520000
  23551. #define AU1000_MAC1_ENABLE 0xB0520004
  23552. #define NUM_ETH_INTERFACES 2
  23553. -#endif // CONFIG_SOC_AU1000
  23554. +#endif /* CONFIG_SOC_AU1000 */
  23555. /* Au1500 */
  23556. #ifdef CONFIG_SOC_AU1500
  23557. @@ -438,7 +766,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  23558. #define AU1500_MAC0_ENABLE 0xB1520000
  23559. #define AU1500_MAC1_ENABLE 0xB1520004
  23560. #define NUM_ETH_INTERFACES 2
  23561. -#endif // CONFIG_SOC_AU1500
  23562. +#endif /* CONFIG_SOC_AU1500 */
  23563. /* Au1100 */
  23564. #ifdef CONFIG_SOC_AU1100
  23565. @@ -483,6 +811,22 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  23566. #define AU1000_GPIO_13 45
  23567. #define AU1000_GPIO_14 46
  23568. #define AU1000_GPIO_15 47
  23569. +#define AU1000_GPIO_16 48
  23570. +#define AU1000_GPIO_17 49
  23571. +#define AU1000_GPIO_18 50
  23572. +#define AU1000_GPIO_19 51
  23573. +#define AU1000_GPIO_20 52
  23574. +#define AU1000_GPIO_21 53
  23575. +#define AU1000_GPIO_22 54
  23576. +#define AU1000_GPIO_23 55
  23577. +#define AU1000_GPIO_24 56
  23578. +#define AU1000_GPIO_25 57
  23579. +#define AU1000_GPIO_26 58
  23580. +#define AU1000_GPIO_27 59
  23581. +#define AU1000_GPIO_28 60
  23582. +#define AU1000_GPIO_29 61
  23583. +#define AU1000_GPIO_30 62
  23584. +#define AU1000_GPIO_31 63
  23585. #define UART0_ADDR 0xB1100000
  23586. #define UART1_ADDR 0xB1200000
  23587. @@ -494,7 +838,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  23588. #define AU1100_ETH0_BASE 0xB0500000
  23589. #define AU1100_MAC0_ENABLE 0xB0520000
  23590. #define NUM_ETH_INTERFACES 1
  23591. -#endif // CONFIG_SOC_AU1100
  23592. +#endif /* CONFIG_SOC_AU1100 */
  23593. #ifdef CONFIG_SOC_AU1550
  23594. #define AU1550_UART0_INT 0
  23595. @@ -511,14 +855,14 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  23596. #define AU1550_PSC1_INT 11
  23597. #define AU1550_PSC2_INT 12
  23598. #define AU1550_PSC3_INT 13
  23599. -#define AU1550_TOY_INT 14
  23600. -#define AU1550_TOY_MATCH0_INT 15
  23601. -#define AU1550_TOY_MATCH1_INT 16
  23602. -#define AU1550_TOY_MATCH2_INT 17
  23603. -#define AU1550_RTC_INT 18
  23604. -#define AU1550_RTC_MATCH0_INT 19
  23605. -#define AU1550_RTC_MATCH1_INT 20
  23606. -#define AU1550_RTC_MATCH2_INT 21
  23607. +#define AU1000_TOY_INT 14
  23608. +#define AU1000_TOY_MATCH0_INT 15
  23609. +#define AU1000_TOY_MATCH1_INT 16
  23610. +#define AU1000_TOY_MATCH2_INT 17
  23611. +#define AU1000_RTC_INT 18
  23612. +#define AU1000_RTC_MATCH0_INT 19
  23613. +#define AU1000_RTC_MATCH1_INT 20
  23614. +#define AU1000_RTC_MATCH2_INT 21
  23615. #define AU1550_NAND_INT 23
  23616. #define AU1550_USB_DEV_REQ_INT 24
  23617. #define AU1550_USB_DEV_SUS_INT 25
  23618. @@ -573,7 +917,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  23619. #define AU1550_MAC0_ENABLE 0xB0520000
  23620. #define AU1550_MAC1_ENABLE 0xB0520004
  23621. #define NUM_ETH_INTERFACES 2
  23622. -#endif // CONFIG_SOC_AU1550
  23623. +#endif /* CONFIG_SOC_AU1550 */
  23624. #ifdef CONFIG_SOC_AU1200
  23625. #define AU1200_UART0_INT 0
  23626. @@ -590,14 +934,14 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  23627. #define AU1200_PSC1_INT 11
  23628. #define AU1200_AES_INT 12
  23629. #define AU1200_CAMERA_INT 13
  23630. -#define AU1200_TOY_INT 14
  23631. -#define AU1200_TOY_MATCH0_INT 15
  23632. -#define AU1200_TOY_MATCH1_INT 16
  23633. -#define AU1200_TOY_MATCH2_INT 17
  23634. -#define AU1200_RTC_INT 18
  23635. -#define AU1200_RTC_MATCH0_INT 19
  23636. -#define AU1200_RTC_MATCH1_INT 20
  23637. -#define AU1200_RTC_MATCH2_INT 21
  23638. +#define AU1000_TOY_INT 14
  23639. +#define AU1000_TOY_MATCH0_INT 15
  23640. +#define AU1000_TOY_MATCH1_INT 16
  23641. +#define AU1000_TOY_MATCH2_INT 17
  23642. +#define AU1000_RTC_INT 18
  23643. +#define AU1000_RTC_MATCH0_INT 19
  23644. +#define AU1000_RTC_MATCH1_INT 20
  23645. +#define AU1000_RTC_MATCH2_INT 21
  23646. #define AU1200_NAND_INT 23
  23647. #define AU1200_GPIO_204 24
  23648. #define AU1200_GPIO_205 25
  23649. @@ -605,6 +949,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  23650. #define AU1200_GPIO_207 27
  23651. #define AU1200_GPIO_208_215 28 // Logical OR of 208:215
  23652. #define AU1200_USB_INT 29
  23653. +#define AU1000_USB_HOST_INT AU1200_USB_INT
  23654. #define AU1200_LCD_INT 30
  23655. #define AU1200_MAE_BOTH_INT 31
  23656. #define AU1000_GPIO_0 32
  23657. @@ -643,21 +988,36 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  23658. #define UART0_ADDR 0xB1100000
  23659. #define UART1_ADDR 0xB1200000
  23660. -#define USB_OHCI_BASE 0x14020000 // phys addr for ioremap
  23661. -#define USB_HOST_CONFIG 0xB4027ffc
  23662. +#define USB_UOC_BASE 0x14020020
  23663. +#define USB_UOC_LEN 0x20
  23664. +#define USB_OHCI_BASE 0x14020100
  23665. +#define USB_OHCI_LEN 0x100
  23666. +#define USB_EHCI_BASE 0x14020200
  23667. +#define USB_EHCI_LEN 0x100
  23668. +#define USB_UDC_BASE 0x14022000
  23669. +#define USB_UDC_LEN 0x2000
  23670. +#define USB_MSR_BASE 0xB4020000
  23671. +#define USB_MSR_MCFG 4
  23672. +#define USBMSRMCFG_OMEMEN 0
  23673. +#define USBMSRMCFG_OBMEN 1
  23674. +#define USBMSRMCFG_EMEMEN 2
  23675. +#define USBMSRMCFG_EBMEN 3
  23676. +#define USBMSRMCFG_DMEMEN 4
  23677. +#define USBMSRMCFG_DBMEN 5
  23678. +#define USBMSRMCFG_GMEMEN 6
  23679. +#define USBMSRMCFG_OHCCLKEN 16
  23680. +#define USBMSRMCFG_EHCCLKEN 17
  23681. +#define USBMSRMCFG_UDCCLKEN 18
  23682. +#define USBMSRMCFG_PHYPLLEN 19
  23683. +#define USBMSRMCFG_RDCOMB 30
  23684. +#define USBMSRMCFG_PFEN 31
  23685. -// these are here for prototyping on au1550 (do not exist on au1200)
  23686. -#define AU1200_ETH0_BASE 0xB0500000
  23687. -#define AU1200_ETH1_BASE 0xB0510000
  23688. -#define AU1200_MAC0_ENABLE 0xB0520000
  23689. -#define AU1200_MAC1_ENABLE 0xB0520004
  23690. -#define NUM_ETH_INTERFACES 2
  23691. -#endif // CONFIG_SOC_AU1200
  23692. +#endif /* CONFIG_SOC_AU1200 */
  23693. #define AU1000_LAST_INTC0_INT 31
  23694. +#define AU1000_LAST_INTC1_INT 63
  23695. #define AU1000_MAX_INTR 63
  23696. -
  23697. /* Programmable Counters 0 and 1 */
  23698. #define SYS_BASE 0xB1900000
  23699. #define SYS_COUNTER_CNTRL (SYS_BASE + 0x14)
  23700. @@ -728,6 +1088,8 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  23701. #define I2S_CONTROL_D (1<<1)
  23702. #define I2S_CONTROL_CE (1<<0)
  23703. +#ifndef CONFIG_SOC_AU1200
  23704. +
  23705. /* USB Host Controller */
  23706. #define USB_OHCI_LEN 0x00100000
  23707. @@ -773,6 +1135,8 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  23708. #define USBDEV_ENABLE (1<<1)
  23709. #define USBDEV_CE (1<<0)
  23710. +#endif /* !CONFIG_SOC_AU1200 */
  23711. +
  23712. /* Ethernet Controllers */
  23713. /* 4 byte offsets from AU1000_ETH_BASE */
  23714. @@ -1171,6 +1535,37 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  23715. #define SYS_PF_PSC1_S1 (1 << 1)
  23716. #define SYS_PF_MUST_BE_SET ((1 << 5) | (1 << 2))
  23717. +/* Au1200 Only */
  23718. +#ifdef CONFIG_SOC_AU1200
  23719. +#define SYS_PINFUNC_DMA (1<<31)
  23720. +#define SYS_PINFUNC_S0A (1<<30)
  23721. +#define SYS_PINFUNC_S1A (1<<29)
  23722. +#define SYS_PINFUNC_LP0 (1<<28)
  23723. +#define SYS_PINFUNC_LP1 (1<<27)
  23724. +#define SYS_PINFUNC_LD16 (1<<26)
  23725. +#define SYS_PINFUNC_LD8 (1<<25)
  23726. +#define SYS_PINFUNC_LD1 (1<<24)
  23727. +#define SYS_PINFUNC_LD0 (1<<23)
  23728. +#define SYS_PINFUNC_P1A (3<<21)
  23729. +#define SYS_PINFUNC_P1B (1<<20)
  23730. +#define SYS_PINFUNC_FS3 (1<<19)
  23731. +#define SYS_PINFUNC_P0A (3<<17)
  23732. +#define SYS_PINFUNC_CS (1<<16)
  23733. +#define SYS_PINFUNC_CIM (1<<15)
  23734. +#define SYS_PINFUNC_P1C (1<<14)
  23735. +#define SYS_PINFUNC_U1T (1<<12)
  23736. +#define SYS_PINFUNC_U1R (1<<11)
  23737. +#define SYS_PINFUNC_EX1 (1<<10)
  23738. +#define SYS_PINFUNC_EX0 (1<<9)
  23739. +#define SYS_PINFUNC_U0R (1<<8)
  23740. +#define SYS_PINFUNC_MC (1<<7)
  23741. +#define SYS_PINFUNC_S0B (1<<6)
  23742. +#define SYS_PINFUNC_S0C (1<<5)
  23743. +#define SYS_PINFUNC_P0B (1<<4)
  23744. +#define SYS_PINFUNC_U0T (1<<3)
  23745. +#define SYS_PINFUNC_S1B (1<<2)
  23746. +#endif
  23747. +
  23748. #define SYS_TRIOUTRD 0xB1900100
  23749. #define SYS_TRIOUTCLR 0xB1900100
  23750. #define SYS_OUTPUTRD 0xB1900108
  23751. @@ -1298,7 +1693,6 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  23752. #define SD1_XMIT_FIFO 0xB0680000
  23753. #define SD1_RECV_FIFO 0xB0680004
  23754. -
  23755. #if defined (CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550)
  23756. /* Au1500 PCI Controller */
  23757. #define Au1500_CFG_BASE 0xB4005000 // virtual, kseg0 addr
  23758. @@ -1388,9 +1782,60 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]
  23759. #endif
  23760. +#ifndef _LANGUAGE_ASSEMBLY
  23761. +typedef volatile struct
  23762. +{
  23763. + /* 0x0000 */ u32 toytrim;
  23764. + /* 0x0004 */ u32 toywrite;
  23765. + /* 0x0008 */ u32 toymatch0;
  23766. + /* 0x000C */ u32 toymatch1;
  23767. + /* 0x0010 */ u32 toymatch2;
  23768. + /* 0x0014 */ u32 cntrctrl;
  23769. + /* 0x0018 */ u32 scratch0;
  23770. + /* 0x001C */ u32 scratch1;
  23771. + /* 0x0020 */ u32 freqctrl0;
  23772. + /* 0x0024 */ u32 freqctrl1;
  23773. + /* 0x0028 */ u32 clksrc;
  23774. + /* 0x002C */ u32 pinfunc;
  23775. + /* 0x0030 */ u32 reserved0;
  23776. + /* 0x0034 */ u32 wakemsk;
  23777. + /* 0x0038 */ u32 endian;
  23778. + /* 0x003C */ u32 powerctrl;
  23779. + /* 0x0040 */ u32 toyread;
  23780. + /* 0x0044 */ u32 rtctrim;
  23781. + /* 0x0048 */ u32 rtcwrite;
  23782. + /* 0x004C */ u32 rtcmatch0;
  23783. + /* 0x0050 */ u32 rtcmatch1;
  23784. + /* 0x0054 */ u32 rtcmatch2;
  23785. + /* 0x0058 */ u32 rtcread;
  23786. + /* 0x005C */ u32 wakesrc;
  23787. + /* 0x0060 */ u32 cpupll;
  23788. + /* 0x0064 */ u32 auxpll;
  23789. + /* 0x0068 */ u32 reserved1;
  23790. + /* 0x006C */ u32 reserved2;
  23791. + /* 0x0070 */ u32 reserved3;
  23792. + /* 0x0074 */ u32 reserved4;
  23793. + /* 0x0078 */ u32 slppwr;
  23794. + /* 0x007C */ u32 sleep;
  23795. + /* 0x0080 */ u32 reserved5[32];
  23796. + /* 0x0100 */ u32 trioutrd;
  23797. +#define trioutclr trioutrd
  23798. + /* 0x0104 */ u32 reserved6;
  23799. + /* 0x0108 */ u32 outputrd;
  23800. +#define outputset outputrd
  23801. + /* 0x010C */ u32 outputclr;
  23802. + /* 0x0110 */ u32 pinstaterd;
  23803. +#define pininputen pinstaterd
  23804. +
  23805. +} AU1X00_SYS;
  23806. +
  23807. +static AU1X00_SYS* const sys = (AU1X00_SYS *)SYS_BASE;
  23808. +
  23809. +#endif
  23810. /* Processor information base on prid.
  23811. * Copied from PowerPC.
  23812. */
  23813. +#ifndef _LANGUAGE_ASSEMBLY
  23814. struct cpu_spec {
  23815. /* CPU is matched via (PRID & prid_mask) == prid_value */
  23816. unsigned int prid_mask;
  23817. @@ -1404,3 +1849,6 @@ struct cpu_spec {
  23818. extern struct cpu_spec cpu_specs[];
  23819. extern struct cpu_spec *cur_cpu_spec[];
  23820. #endif
  23821. +
  23822. +#endif
  23823. +
  23824. --- a/include/asm-mips/au1000_pcmcia.h
  23825. +++ b/include/asm-mips/au1000_pcmcia.h
  23826. @@ -38,16 +38,41 @@
  23827. #define AU1X_SOCK0_PHYS_MEM 0xF80000000
  23828. /* pcmcia socket 1 needs external glue logic so the memory map
  23829. - * differs from board to board.
  23830. + * differs from board to board. the general rule is that
  23831. + * static bus address bit 26 should be used to decode socket 0
  23832. + * from socket 1. alas, some boards dont follow this...
  23833. + * These really belong in a board-specific header file...
  23834. */
  23835. -#if defined(CONFIG_MIPS_PB1000) || defined(CONFIG_MIPS_PB1100) || defined(CONFIG_MIPS_PB1500)
  23836. -#define AU1X_SOCK1_IO 0xF08000000
  23837. -#define AU1X_SOCK1_PHYS_ATTR 0xF48000000
  23838. -#define AU1X_SOCK1_PHYS_MEM 0xF88000000
  23839. -#elif defined(CONFIG_MIPS_DB1000) || defined(CONFIG_MIPS_DB1100) || defined(CONFIG_MIPS_DB1500) || defined(CONFIG_MIPS_PB1550) || defined(CONFIG_MIPS_DB1550)
  23840. -#define AU1X_SOCK1_IO 0xF04000000
  23841. -#define AU1X_SOCK1_PHYS_ATTR 0xF44000000
  23842. -#define AU1X_SOCK1_PHYS_MEM 0xF84000000
  23843. +#ifdef CONFIG_MIPS_PB1000
  23844. +#define SOCK1_DECODE (1<<27)
  23845. +#endif
  23846. +#ifdef CONFIG_MIPS_DB1000
  23847. +#define SOCK1_DECODE (1<<26)
  23848. +#endif
  23849. +#ifdef CONFIG_MIPS_DB1500
  23850. +#define SOCK1_DECODE (1<<26)
  23851. +#endif
  23852. +#ifdef CONFIG_MIPS_DB1100
  23853. +#define SOCK1_DECODE (1<<26)
  23854. +#endif
  23855. +#ifdef CONFIG_MIPS_DB1550
  23856. +#define SOCK1_DECODE (1<<26)
  23857. +#endif
  23858. +#ifdef CONFIG_MIPS_DB1200
  23859. +#define SOCK1_DECODE (1<<26)
  23860. +#endif
  23861. +#ifdef CONFIG_MIPS_PB1550
  23862. +#define SOCK1_DECODE (1<<26)
  23863. +#endif
  23864. +#ifdef CONFIG_MIPS_PB1200
  23865. +#define SOCK1_DECODE (1<<26)
  23866. +#endif
  23867. +
  23868. +/* The board has a second PCMCIA socket */
  23869. +#ifdef SOCK1_DECODE
  23870. +#define AU1X_SOCK1_IO (0xF00000000|SOCK1_DECODE)
  23871. +#define AU1X_SOCK1_PHYS_ATTR (0xF40000000|SOCK1_DECODE)
  23872. +#define AU1X_SOCK1_PHYS_MEM (0xF80000000|SOCK1_DECODE)
  23873. #endif
  23874. struct pcmcia_state {
  23875. --- a/include/asm-mips/au1100_mmc.h
  23876. +++ b/include/asm-mips/au1100_mmc.h
  23877. @@ -39,16 +39,22 @@
  23878. #define __ASM_AU1100_MMC_H
  23879. -#define NUM_AU1100_MMC_CONTROLLERS 2
  23880. -
  23881. -
  23882. -#define AU1100_SD_IRQ 2
  23883. -
  23884. +#if defined(CONFIG_SOC_AU1100)
  23885. +#define NUM_MMC_CONTROLLERS 2
  23886. +#define AU1X_MMC_INT AU1100_SD_INT
  23887. +#endif
  23888. +
  23889. +#if defined(CONFIG_SOC_AU1200)
  23890. +#define NUM_MMC_CONTROLLERS 2
  23891. +#define AU1X_MMC_INT AU1200_SD_INT
  23892. +#endif
  23893. #define SD0_BASE 0xB0600000
  23894. #define SD1_BASE 0xB0680000
  23895. +
  23896. +
  23897. /*
  23898. * Register offsets.
  23899. */
  23900. @@ -201,5 +207,12 @@
  23901. #define SD_CMD_RT_1B (0x00810000)
  23902. +/* support routines required on a platform-specific basis */
  23903. +extern void mmc_card_inserted(int _n_, int *_res_);
  23904. +extern void mmc_card_writable(int _n_, int *_res_);
  23905. +extern void mmc_power_on(int _n_);
  23906. +extern void mmc_power_off(int _n_);
  23907. +
  23908. +
  23909. #endif /* __ASM_AU1100_MMC_H */
  23910. --- a/include/asm-mips/au1xxx_dbdma.h
  23911. +++ b/include/asm-mips/au1xxx_dbdma.h
  23912. @@ -43,7 +43,7 @@
  23913. #define DDMA_GLOBAL_BASE 0xb4003000
  23914. #define DDMA_CHANNEL_BASE 0xb4002000
  23915. -typedef struct dbdma_global {
  23916. +typedef volatile struct dbdma_global {
  23917. u32 ddma_config;
  23918. u32 ddma_intstat;
  23919. u32 ddma_throttle;
  23920. @@ -60,7 +60,7 @@ typedef struct dbdma_global {
  23921. /* The structure of a DMA Channel.
  23922. */
  23923. -typedef struct au1xxx_dma_channel {
  23924. +typedef volatile struct au1xxx_dma_channel {
  23925. u32 ddma_cfg; /* See below */
  23926. u32 ddma_desptr; /* 32-byte aligned pointer to descriptor */
  23927. u32 ddma_statptr; /* word aligned pointer to status word */
  23928. @@ -96,7 +96,7 @@ typedef struct au1xxx_dma_channel {
  23929. /* "Standard" DDMA Descriptor.
  23930. * Must be 32-byte aligned.
  23931. */
  23932. -typedef struct au1xxx_ddma_desc {
  23933. +typedef volatile struct au1xxx_ddma_desc {
  23934. u32 dscr_cmd0; /* See below */
  23935. u32 dscr_cmd1; /* See below */
  23936. u32 dscr_source0; /* source phys address */
  23937. @@ -105,6 +105,12 @@ typedef struct au1xxx_ddma_desc {
  23938. u32 dscr_dest1; /* See below */
  23939. u32 dscr_stat; /* completion status */
  23940. u32 dscr_nxtptr; /* Next descriptor pointer (mostly) */
  23941. + /* First 32bytes are HW specific!!!
  23942. + Lets have some SW data following.. make sure its 32bytes
  23943. + */
  23944. + u32 sw_status;
  23945. + u32 sw_context;
  23946. + u32 sw_reserved[6];
  23947. } au1x_ddma_desc_t;
  23948. #define DSCR_CMD0_V (1 << 31) /* Descriptor valid */
  23949. @@ -123,6 +129,8 @@ typedef struct au1xxx_ddma_desc {
  23950. #define DSCR_CMD0_CV (0x1 << 2) /* Clear Valid when done */
  23951. #define DSCR_CMD0_ST_MASK (0x3 << 0) /* Status instruction */
  23952. +#define SW_STATUS_INUSE (1<<0)
  23953. +
  23954. /* Command 0 device IDs.
  23955. */
  23956. #ifdef CONFIG_SOC_AU1550
  23957. @@ -169,8 +177,8 @@ typedef struct au1xxx_ddma_desc {
  23958. #define DSCR_CMD0_SDMS_RX0 9
  23959. #define DSCR_CMD0_SDMS_TX1 10
  23960. #define DSCR_CMD0_SDMS_RX1 11
  23961. -#define DSCR_CMD0_AES_TX 12
  23962. -#define DSCR_CMD0_AES_RX 13
  23963. +#define DSCR_CMD0_AES_TX 13
  23964. +#define DSCR_CMD0_AES_RX 12
  23965. #define DSCR_CMD0_PSC0_TX 14
  23966. #define DSCR_CMD0_PSC0_RX 15
  23967. #define DSCR_CMD0_PSC1_TX 16
  23968. @@ -189,6 +197,10 @@ typedef struct au1xxx_ddma_desc {
  23969. #define DSCR_CMD0_THROTTLE 30
  23970. #define DSCR_CMD0_ALWAYS 31
  23971. #define DSCR_NDEV_IDS 32
  23972. +/* THis macro is used to find/create custom device types */
  23973. +#define DSCR_DEV2CUSTOM_ID(x,d) (((((x)&0xFFFF)<<8)|0x32000000)|((d)&0xFF))
  23974. +#define DSCR_CUSTOM2DEV_ID(x) ((x)&0xFF)
  23975. +
  23976. #define DSCR_CMD0_SID(x) (((x) & 0x1f) << 25)
  23977. #define DSCR_CMD0_DID(x) (((x) & 0x1f) << 20)
  23978. @@ -277,6 +289,43 @@ typedef struct au1xxx_ddma_desc {
  23979. */
  23980. #define NUM_DBDMA_CHANS 16
  23981. +/*
  23982. + * Ddma API definitions
  23983. + * FIXME: may not fit to this header file
  23984. + */
  23985. +typedef struct dbdma_device_table {
  23986. + u32 dev_id;
  23987. + u32 dev_flags;
  23988. + u32 dev_tsize;
  23989. + u32 dev_devwidth;
  23990. + u32 dev_physaddr; /* If FIFO */
  23991. + u32 dev_intlevel;
  23992. + u32 dev_intpolarity;
  23993. +} dbdev_tab_t;
  23994. +
  23995. +
  23996. +typedef struct dbdma_chan_config {
  23997. + spinlock_t lock;
  23998. +
  23999. + u32 chan_flags;
  24000. + u32 chan_index;
  24001. + dbdev_tab_t *chan_src;
  24002. + dbdev_tab_t *chan_dest;
  24003. + au1x_dma_chan_t *chan_ptr;
  24004. + au1x_ddma_desc_t *chan_desc_base;
  24005. + au1x_ddma_desc_t *get_ptr, *put_ptr, *cur_ptr;
  24006. + void *chan_callparam;
  24007. + void (*chan_callback)(int, void *, struct pt_regs *);
  24008. +} chan_tab_t;
  24009. +
  24010. +#define DEV_FLAGS_INUSE (1 << 0)
  24011. +#define DEV_FLAGS_ANYUSE (1 << 1)
  24012. +#define DEV_FLAGS_OUT (1 << 2)
  24013. +#define DEV_FLAGS_IN (1 << 3)
  24014. +#define DEV_FLAGS_BURSTABLE (1 << 4)
  24015. +#define DEV_FLAGS_SYNC (1 << 5)
  24016. +/* end Ddma API definitions */
  24017. +
  24018. /* External functions for drivers to use.
  24019. */
  24020. /* Use this to allocate a dbdma channel. The device ids are one of the
  24021. @@ -299,8 +348,8 @@ u32 au1xxx_dbdma_ring_alloc(u32 chanid,
  24022. /* Put buffers on source/destination descriptors.
  24023. */
  24024. -u32 au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes);
  24025. -u32 au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes);
  24026. +u32 _au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags);
  24027. +u32 _au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags);
  24028. /* Get a buffer from the destination descriptor.
  24029. */
  24030. @@ -314,5 +363,25 @@ u32 au1xxx_get_dma_residue(u32 chanid);
  24031. void au1xxx_dbdma_chan_free(u32 chanid);
  24032. void au1xxx_dbdma_dump(u32 chanid);
  24033. +u32 au1xxx_dbdma_put_dscr(u32 chanid, au1x_ddma_desc_t *dscr );
  24034. +
  24035. +u32 au1xxx_ddma_add_device( dbdev_tab_t *dev );
  24036. +
  24037. +/*
  24038. + Some compatibilty macros --
  24039. + Needed to make changes to API without breaking existing drivers
  24040. +*/
  24041. +#define au1xxx_dbdma_put_source(chanid,buf,nbytes)_au1xxx_dbdma_put_source(chanid, buf, nbytes, DDMA_FLAGS_IE)
  24042. +#define au1xxx_dbdma_put_source_flags(chanid,buf,nbytes,flags) _au1xxx_dbdma_put_source(chanid, buf, nbytes, flags)
  24043. +
  24044. +#define au1xxx_dbdma_put_dest(chanid,buf,nbytes) _au1xxx_dbdma_put_dest(chanid, buf, nbytes, DDMA_FLAGS_IE)
  24045. +#define au1xxx_dbdma_put_dest_flags(chanid,buf,nbytes,flags) _au1xxx_dbdma_put_dest(chanid, buf, nbytes, flags)
  24046. +
  24047. +/*
  24048. + * Flags for the put_source/put_dest functions.
  24049. + */
  24050. +#define DDMA_FLAGS_IE (1<<0)
  24051. +#define DDMA_FLAGS_NOIE (1<<1)
  24052. +
  24053. #endif /* _LANGUAGE_ASSEMBLY */
  24054. #endif /* _AU1000_DBDMA_H_ */
  24055. --- /dev/null
  24056. +++ b/include/asm-mips/au1xxx_gpio.h
  24057. @@ -0,0 +1,22 @@
  24058. +
  24059. +
  24060. +#ifndef __AU1XXX_GPIO_H
  24061. +#define __AU1XXX_GPIO_H
  24062. +
  24063. +void au1xxx_gpio1_set_inputs(void);
  24064. +void au1xxx_gpio_tristate(int signal);
  24065. +void au1xxx_gpio_write(int signal, int value);
  24066. +int au1xxx_gpio_read(int signal);
  24067. +
  24068. +typedef volatile struct
  24069. +{
  24070. + u32 dir;
  24071. + u32 reserved;
  24072. + u32 output;
  24073. + u32 pinstate;
  24074. + u32 inten;
  24075. + u32 enable;
  24076. +
  24077. +} AU1X00_GPIO2;
  24078. +
  24079. +#endif //__AU1XXX_GPIO_H
  24080. --- a/include/asm-mips/au1xxx_psc.h
  24081. +++ b/include/asm-mips/au1xxx_psc.h
  24082. @@ -41,6 +41,11 @@
  24083. #define PSC3_BASE_ADDR 0xb0d00000
  24084. #endif
  24085. +#ifdef CONFIG_SOC_AU1200
  24086. +#define PSC0_BASE_ADDR 0xb1a00000
  24087. +#define PSC1_BASE_ADDR 0xb1b00000
  24088. +#endif
  24089. +
  24090. /* The PSC select and control registers are common to
  24091. * all protocols.
  24092. */
  24093. @@ -226,6 +231,8 @@ typedef struct psc_i2s {
  24094. #define PSC_I2SCFG_DD_DISABLE (1 << 27)
  24095. #define PSC_I2SCFG_DE_ENABLE (1 << 26)
  24096. #define PSC_I2SCFG_SET_WS(x) (((((x) / 2) - 1) & 0x7f) << 16)
  24097. +#define PSC_I2SCFG_WS(n) ((n&0xFF)<<16)
  24098. +#define PSC_I2SCFG_WS_MASK (PSC_I2SCFG_WS(0x3F))
  24099. #define PSC_I2SCFG_WI (1 << 15)
  24100. #define PSC_I2SCFG_DIV_MASK (3 << 13)
  24101. --- a/include/asm-mips/bootinfo.h
  24102. +++ b/include/asm-mips/bootinfo.h
  24103. @@ -180,6 +180,9 @@
  24104. #define MACH_MTX1 7 /* 4G MTX-1 Au1500-based board */
  24105. #define MACH_CSB250 8 /* Cogent Au1500 */
  24106. #define MACH_PB1550 9 /* Au1550-based eval board */
  24107. +#define MACH_PB1200 10 /* Au1200-based eval board */
  24108. +#define MACH_DB1550 11 /* Au1550-based eval board */
  24109. +#define MACH_DB1200 12 /* Au1200-based eval board */
  24110. /*
  24111. * Valid machtype for group NEC_VR41XX
  24112. --- /dev/null
  24113. +++ b/include/asm-mips/db1200.h
  24114. @@ -0,0 +1,214 @@
  24115. +/*
  24116. + * AMD Alchemy DB1200 Referrence Board
  24117. + * Board Registers defines.
  24118. + *
  24119. + * ########################################################################
  24120. + *
  24121. + * This program is free software; you can distribute it and/or modify it
  24122. + * under the terms of the GNU General Public License (Version 2) as
  24123. + * published by the Free Software Foundation.
  24124. + *
  24125. + * This program is distributed in the hope it will be useful, but WITHOUT
  24126. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  24127. + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  24128. + * for more details.
  24129. + *
  24130. + * You should have received a copy of the GNU General Public License along
  24131. + * with this program; if not, write to the Free Software Foundation, Inc.,
  24132. + * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  24133. + *
  24134. + * ########################################################################
  24135. + *
  24136. + *
  24137. + */
  24138. +#ifndef __ASM_DB1200_H
  24139. +#define __ASM_DB1200_H
  24140. +
  24141. +#include <linux/types.h>
  24142. +
  24143. +// This is defined in au1000.h with bogus value
  24144. +#undef AU1X00_EXTERNAL_INT
  24145. +
  24146. +#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
  24147. +#define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX
  24148. +#define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC1_TX
  24149. +#define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC1_RX
  24150. +
  24151. +/* SPI and SMB are muxed on the Pb1200 board.
  24152. + Refer to board documentation.
  24153. + */
  24154. +#define SPI_PSC_BASE PSC0_BASE_ADDR
  24155. +#define SMBUS_PSC_BASE PSC0_BASE_ADDR
  24156. +/* AC97 and I2S are muxed on the Pb1200 board.
  24157. + Refer to board documentation.
  24158. + */
  24159. +#define AC97_PSC_BASE PSC1_BASE_ADDR
  24160. +#define I2S_PSC_BASE PSC1_BASE_ADDR
  24161. +
  24162. +#define BCSR_KSEG1_ADDR 0xB9800000
  24163. +
  24164. +typedef volatile struct
  24165. +{
  24166. + /*00*/ u16 whoami;
  24167. + u16 reserved0;
  24168. + /*04*/ u16 status;
  24169. + u16 reserved1;
  24170. + /*08*/ u16 switches;
  24171. + u16 reserved2;
  24172. + /*0C*/ u16 resets;
  24173. + u16 reserved3;
  24174. +
  24175. + /*10*/ u16 pcmcia;
  24176. + u16 reserved4;
  24177. + /*14*/ u16 board;
  24178. + u16 reserved5;
  24179. + /*18*/ u16 disk_leds;
  24180. + u16 reserved6;
  24181. + /*1C*/ u16 system;
  24182. + u16 reserved7;
  24183. +
  24184. + /*20*/ u16 intclr;
  24185. + u16 reserved8;
  24186. + /*24*/ u16 intset;
  24187. + u16 reserved9;
  24188. + /*28*/ u16 intclr_mask;
  24189. + u16 reserved10;
  24190. + /*2C*/ u16 intset_mask;
  24191. + u16 reserved11;
  24192. +
  24193. + /*30*/ u16 sig_status;
  24194. + u16 reserved12;
  24195. + /*34*/ u16 int_status;
  24196. + u16 reserved13;
  24197. + /*38*/ u16 reserved14;
  24198. + u16 reserved15;
  24199. + /*3C*/ u16 reserved16;
  24200. + u16 reserved17;
  24201. +
  24202. +} BCSR;
  24203. +
  24204. +static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  24205. +
  24206. +/*
  24207. + * Register bit definitions for the BCSRs
  24208. + */
  24209. +#define BCSR_WHOAMI_DCID 0x000F
  24210. +#define BCSR_WHOAMI_CPLD 0x00F0
  24211. +#define BCSR_WHOAMI_BOARD 0x0F00
  24212. +
  24213. +#define BCSR_STATUS_PCMCIA0VS 0x0003
  24214. +#define BCSR_STATUS_PCMCIA1VS 0x000C
  24215. +#define BCSR_STATUS_SWAPBOOT 0x0040
  24216. +#define BCSR_STATUS_FLASHBUSY 0x0100
  24217. +#define BCSR_STATUS_IDECBLID 0x0200
  24218. +#define BCSR_STATUS_SD0WP 0x0400
  24219. +#define BCSR_STATUS_U0RXD 0x1000
  24220. +#define BCSR_STATUS_U1RXD 0x2000
  24221. +
  24222. +#define BCSR_SWITCHES_OCTAL 0x00FF
  24223. +#define BCSR_SWITCHES_DIP_1 0x0080
  24224. +#define BCSR_SWITCHES_DIP_2 0x0040
  24225. +#define BCSR_SWITCHES_DIP_3 0x0020
  24226. +#define BCSR_SWITCHES_DIP_4 0x0010
  24227. +#define BCSR_SWITCHES_DIP_5 0x0008
  24228. +#define BCSR_SWITCHES_DIP_6 0x0004
  24229. +#define BCSR_SWITCHES_DIP_7 0x0002
  24230. +#define BCSR_SWITCHES_DIP_8 0x0001
  24231. +#define BCSR_SWITCHES_ROTARY 0x0F00
  24232. +
  24233. +#define BCSR_RESETS_ETH 0x0001
  24234. +#define BCSR_RESETS_CAMERA 0x0002
  24235. +#define BCSR_RESETS_DC 0x0004
  24236. +#define BCSR_RESETS_IDE 0x0008
  24237. +#define BCSR_RESETS_TV 0x0010
  24238. +/* not resets but in the same register */
  24239. +#define BCSR_RESETS_PWMR1mUX 0x0800
  24240. +#define BCSR_RESETS_PCS0MUX 0x1000
  24241. +#define BCSR_RESETS_PCS1MUX 0x2000
  24242. +#define BCSR_RESETS_SPISEL 0x4000
  24243. +
  24244. +#define BCSR_PCMCIA_PC0VPP 0x0003
  24245. +#define BCSR_PCMCIA_PC0VCC 0x000C
  24246. +#define BCSR_PCMCIA_PC0DRVEN 0x0010
  24247. +#define BCSR_PCMCIA_PC0RST 0x0080
  24248. +#define BCSR_PCMCIA_PC1VPP 0x0300
  24249. +#define BCSR_PCMCIA_PC1VCC 0x0C00
  24250. +#define BCSR_PCMCIA_PC1DRVEN 0x1000
  24251. +#define BCSR_PCMCIA_PC1RST 0x8000
  24252. +
  24253. +#define BCSR_BOARD_LCDVEE 0x0001
  24254. +#define BCSR_BOARD_LCDVDD 0x0002
  24255. +#define BCSR_BOARD_LCDBL 0x0004
  24256. +#define BCSR_BOARD_CAMSNAP 0x0010
  24257. +#define BCSR_BOARD_CAMPWR 0x0020
  24258. +#define BCSR_BOARD_SD0PWR 0x0040
  24259. +
  24260. +#define BCSR_LEDS_DECIMALS 0x0003
  24261. +#define BCSR_LEDS_LED0 0x0100
  24262. +#define BCSR_LEDS_LED1 0x0200
  24263. +#define BCSR_LEDS_LED2 0x0400
  24264. +#define BCSR_LEDS_LED3 0x0800
  24265. +
  24266. +#define BCSR_SYSTEM_POWEROFF 0x4000
  24267. +#define BCSR_SYSTEM_RESET 0x8000
  24268. +
  24269. +/* Bit positions for the different interrupt sources */
  24270. +#define BCSR_INT_IDE 0x0001
  24271. +#define BCSR_INT_ETH 0x0002
  24272. +#define BCSR_INT_PC0 0x0004
  24273. +#define BCSR_INT_PC0STSCHG 0x0008
  24274. +#define BCSR_INT_PC1 0x0010
  24275. +#define BCSR_INT_PC1STSCHG 0x0020
  24276. +#define BCSR_INT_DC 0x0040
  24277. +#define BCSR_INT_FLASHBUSY 0x0080
  24278. +#define BCSR_INT_PC0INSERT 0x0100
  24279. +#define BCSR_INT_PC0EJECT 0x0200
  24280. +#define BCSR_INT_PC1INSERT 0x0400
  24281. +#define BCSR_INT_PC1EJECT 0x0800
  24282. +#define BCSR_INT_SD0INSERT 0x1000
  24283. +#define BCSR_INT_SD0EJECT 0x2000
  24284. +
  24285. +#define AU1XXX_SMC91111_PHYS_ADDR (0x19000300)
  24286. +#define AU1XXX_SMC91111_IRQ DB1200_ETH_INT
  24287. +
  24288. +#define AU1XXX_ATA_PHYS_ADDR (0x18800000)
  24289. +#define AU1XXX_ATA_PHYS_LEN (0x100)
  24290. +#define AU1XXX_ATA_REG_OFFSET (5)
  24291. +#define AU1XXX_ATA_INT DB1200_IDE_INT
  24292. +#define AU1XXX_ATA_DDMA_REQ DSCR_CMD0_DMA_REQ1;
  24293. +#define AU1XXX_ATA_RQSIZE 128
  24294. +
  24295. +#define NAND_PHYS_ADDR 0x20000000
  24296. +
  24297. +/*
  24298. + * External Interrupts for Pb1200 as of 8/6/2004.
  24299. + * Bit positions in the CPLD registers can be calculated by taking
  24300. + * the interrupt define and subtracting the DB1200_INT_BEGIN value.
  24301. + * *example: IDE bis pos is = 64 - 64
  24302. + ETH bit pos is = 65 - 64
  24303. + */
  24304. +#define DB1200_INT_BEGIN (AU1000_LAST_INTC1_INT + 1)
  24305. +#define DB1200_IDE_INT (DB1200_INT_BEGIN + 0)
  24306. +#define DB1200_ETH_INT (DB1200_INT_BEGIN + 1)
  24307. +#define DB1200_PC0_INT (DB1200_INT_BEGIN + 2)
  24308. +#define DB1200_PC0_STSCHG_INT (DB1200_INT_BEGIN + 3)
  24309. +#define DB1200_PC1_INT (DB1200_INT_BEGIN + 4)
  24310. +#define DB1200_PC1_STSCHG_INT (DB1200_INT_BEGIN + 5)
  24311. +#define DB1200_DC_INT (DB1200_INT_BEGIN + 6)
  24312. +#define DB1200_FLASHBUSY_INT (DB1200_INT_BEGIN + 7)
  24313. +#define DB1200_PC0_INSERT_INT (DB1200_INT_BEGIN + 8)
  24314. +#define DB1200_PC0_EJECT_INT (DB1200_INT_BEGIN + 9)
  24315. +#define DB1200_PC1_INSERT_INT (DB1200_INT_BEGIN + 10)
  24316. +#define DB1200_PC1_EJECT_INT (DB1200_INT_BEGIN + 11)
  24317. +#define DB1200_SD0_INSERT_INT (DB1200_INT_BEGIN + 12)
  24318. +#define DB1200_SD0_EJECT_INT (DB1200_INT_BEGIN + 13)
  24319. +
  24320. +#define DB1200_INT_END (DB1200_INT_BEGIN + 15)
  24321. +
  24322. +/* For drivers/pcmcia/au1000_db1x00.c */
  24323. +#define BOARD_PC0_INT DB1200_PC0_INT
  24324. +#define BOARD_PC1_INT DB1200_PC1_INT
  24325. +#define BOARD_CARD_INSERTED(SOCKET) bcsr->sig_status & (1<<(8+(2*SOCKET)))
  24326. +
  24327. +#endif /* __ASM_DB1200_H */
  24328. +
  24329. --- a/include/asm-mips/db1x00.h
  24330. +++ b/include/asm-mips/db1x00.h
  24331. @@ -1,5 +1,5 @@
  24332. /*
  24333. - * AMD Alchemy DB1x00 Reference Boards
  24334. + * AMD Alchemy DB1x00 Reference Boards (BUT NOT DB1200)
  24335. *
  24336. * Copyright 2001 MontaVista Software Inc.
  24337. * Author: MontaVista Software, Inc.
  24338. @@ -36,9 +36,18 @@
  24339. #define AC97_PSC_BASE PSC1_BASE_ADDR
  24340. #define SMBUS_PSC_BASE PSC2_BASE_ADDR
  24341. #define I2S_PSC_BASE PSC3_BASE_ADDR
  24342. +#define NAND_CS 1
  24343. +/* for drivers/pcmcia/au1000_db1x00.c */
  24344. +#define BOARD_PC0_INT AU1000_GPIO_3
  24345. +#define BOARD_PC1_INT AU1000_GPIO_5
  24346. +#define BOARD_CARD_INSERTED(SOCKET) !(bcsr->status & (1<<(4+SOCKET)))
  24347. #else
  24348. #define BCSR_KSEG1_ADDR 0xAE000000
  24349. +/* for drivers/pcmcia/au1000_db1x00.c */
  24350. +#define BOARD_PC0_INT AU1000_GPIO_2
  24351. +#define BOARD_PC1_INT AU1000_GPIO_5
  24352. +#define BOARD_CARD_INSERTED(SOCKET) !(bcsr->status & (1<<(4+SOCKET)))
  24353. #endif
  24354. /*
  24355. @@ -66,6 +75,7 @@ typedef volatile struct
  24356. } BCSR;
  24357. +static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  24358. /*
  24359. * Register/mask bit definitions for the BCSRs
  24360. @@ -130,14 +140,6 @@ typedef volatile struct
  24361. #define BCSR_SWRESET_RESET 0x0080
  24362. -/* PCMCIA Db1x00 specific defines */
  24363. -#define PCMCIA_MAX_SOCK 1
  24364. -#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK+1)
  24365. -
  24366. -/* VPP/VCC */
  24367. -#define SET_VCC_VPP(VCC, VPP, SLOT)\
  24368. - ((((VCC)<<2) | ((VPP)<<0)) << ((SLOT)*8))
  24369. -
  24370. /* MTD CONFIG OPTIONS */
  24371. #if defined(CONFIG_MTD_DB1X00_BOOT) && defined(CONFIG_MTD_DB1X00_USER)
  24372. #define DB1X00_BOTH_BANKS
  24373. @@ -147,48 +149,15 @@ typedef volatile struct
  24374. #define DB1X00_USER_ONLY
  24375. #endif
  24376. -/* SD controller macros */
  24377. -/*
  24378. - * Detect card.
  24379. - */
  24380. -#define mmc_card_inserted(_n_, _res_) \
  24381. - do { \
  24382. - BCSR * const bcsr = (BCSR *)0xAE000000; \
  24383. - unsigned long mmc_wp, board_specific; \
  24384. - if ((_n_)) { \
  24385. - mmc_wp = BCSR_BOARD_SD1_WP; \
  24386. - } else { \
  24387. - mmc_wp = BCSR_BOARD_SD0_WP; \
  24388. - } \
  24389. - board_specific = au_readl((unsigned long)(&bcsr->specific)); \
  24390. - if (!(board_specific & mmc_wp)) {/* low means card present */ \
  24391. - *(int *)(_res_) = 1; \
  24392. - } else { \
  24393. - *(int *)(_res_) = 0; \
  24394. - } \
  24395. - } while (0)
  24396. -
  24397. +#if defined(CONFIG_BLK_DEV_IDE_AU1XXX) && defined(CONFIG_MIPS_DB1550)
  24398. /*
  24399. - * Apply power to card slot(s).
  24400. + * Daughter card information.
  24401. */
  24402. -#define mmc_power_on(_n_) \
  24403. - do { \
  24404. - BCSR * const bcsr = (BCSR *)0xAE000000; \
  24405. - unsigned long mmc_pwr, mmc_wp, board_specific; \
  24406. - if ((_n_)) { \
  24407. - mmc_pwr = BCSR_BOARD_SD1_PWR; \
  24408. - mmc_wp = BCSR_BOARD_SD1_WP; \
  24409. - } else { \
  24410. - mmc_pwr = BCSR_BOARD_SD0_PWR; \
  24411. - mmc_wp = BCSR_BOARD_SD0_WP; \
  24412. - } \
  24413. - board_specific = au_readl((unsigned long)(&bcsr->specific)); \
  24414. - if (!(board_specific & mmc_wp)) {/* low means card present */ \
  24415. - board_specific |= mmc_pwr; \
  24416. - au_writel(board_specific, (int)(&bcsr->specific)); \
  24417. - au_sync(); \
  24418. - } \
  24419. - } while (0)
  24420. +#define DAUGHTER_CARD_IRQ (AU1000_GPIO_8)
  24421. +/* DC_IDE */
  24422. +#define AU1XXX_ATA_PHYS_ADDR (0x0C000000)
  24423. +#define AU1XXX_ATA_REG_OFFSET (5)
  24424. +#endif /* CONFIG_MIPS_DB1550 */
  24425. #endif /* __ASM_DB1X00_H */
  24426. --- a/include/asm-mips/elf.h
  24427. +++ b/include/asm-mips/elf.h
  24428. @@ -66,9 +66,10 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_N
  24429. #define USE_ELF_CORE_DUMP
  24430. #define ELF_EXEC_PAGESIZE PAGE_SIZE
  24431. -#define ELF_CORE_COPY_REGS(_dest,_regs) \
  24432. - memcpy((char *) &_dest, (char *) _regs, \
  24433. - sizeof(struct pt_regs));
  24434. +extern void dump_regs(elf_greg_t *, struct pt_regs *regs);
  24435. +
  24436. +#define ELF_CORE_COPY_REGS(elf_regs, regs) \
  24437. + dump_regs((elf_greg_t *)&(elf_regs), regs);
  24438. /* This yields a mask that user programs can use to figure out what
  24439. instruction set this cpu supports. This could be done in userspace,
  24440. --- /dev/null
  24441. +++ b/include/asm-mips/ficmmp.h
  24442. @@ -0,0 +1,156 @@
  24443. +/*
  24444. + * FIC MMP
  24445. + *
  24446. + * ########################################################################
  24447. + *
  24448. + * This program is free software; you can distribute it and/or modify it
  24449. + * under the terms of the GNU General Public License (Version 2) as
  24450. + * published by the Free Software Foundation.
  24451. + *
  24452. + * This program is distributed in the hope it will be useful, but WITHOUT
  24453. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  24454. + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  24455. + * for more details.
  24456. + *
  24457. + * You should have received a copy of the GNU General Public License along
  24458. + * with this program; if not, write to the Free Software Foundation, Inc.,
  24459. + * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  24460. + *
  24461. + * ########################################################################
  24462. + *
  24463. + *
  24464. + */
  24465. +#ifndef __ASM_FICMMP_H
  24466. +#define __ASM_FICMMP_H
  24467. +
  24468. +#include <linux/types.h>
  24469. +#include <asm/au1000.h>
  24470. +#include <asm/au1xxx_gpio.h>
  24471. +
  24472. +// This is defined in au1000.h with bogus value
  24473. +#undef AU1X00_EXTERNAL_INT
  24474. +
  24475. +#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
  24476. +#define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX
  24477. +#define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC1_TX
  24478. +#define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC1_RX
  24479. +/* SPI and SMB are muxed on the Pb1200 board.
  24480. + Refer to board documentation.
  24481. + */
  24482. +#define SPI_PSC_BASE PSC0_BASE_ADDR
  24483. +#define SMBUS_PSC_BASE PSC0_BASE_ADDR
  24484. +/* AC97 and I2S are muxed on the Pb1200 board.
  24485. + Refer to board documentation.
  24486. + */
  24487. +#define AC97_PSC_BASE PSC1_BASE_ADDR
  24488. +#define I2S_PSC_BASE PSC1_BASE_ADDR
  24489. +
  24490. +
  24491. +/*
  24492. + * SMSC LAN91C111
  24493. + */
  24494. +#define AU1XXX_SMC91111_PHYS_ADDR (0xAC000300)
  24495. +#define AU1XXX_SMC91111_IRQ AU1000_GPIO_5
  24496. +
  24497. +/* DC_IDE and DC_ETHERNET */
  24498. +#define FICMMP_IDE_INT AU1000_GPIO_4
  24499. +
  24500. +#define AU1XXX_ATA_PHYS_ADDR (0x0C800000)
  24501. +#define AU1XXX_ATA_REG_OFFSET (5)
  24502. +/*
  24503. +#define AU1XXX_ATA_BASE (0x0C800000)
  24504. +#define AU1XXX_ATA_END (0x0CFFFFFF)
  24505. +#define AU1XXX_ATA_MEM_SIZE (AU1XXX_ATA_END - AU1XXX_ATA_BASE +1)
  24506. +
  24507. +#define AU1XXX_ATA_REG_OFFSET (5)
  24508. +*/
  24509. +/* VPP/VCC */
  24510. +#define SET_VCC_VPP(VCC, VPP, SLOT)\
  24511. + ((((VCC)<<2) | ((VPP)<<0)) << ((SLOT)*8))
  24512. +
  24513. +
  24514. +#define FICMMP_CONFIG_BASE 0xAD000000
  24515. +#define FICMMP_CONFIG_ENABLE 13
  24516. +
  24517. +#define FICMMP_CONFIG_I2SFREQ(N) (N<<0)
  24518. +#define FICMMP_CONFIG_I2SXTAL0 (1<<0)
  24519. +#define FICMMP_CONFIG_I2SXTAL1 (1<<1)
  24520. +#define FICMMP_CONFIG_I2SXTAL2 (1<<2)
  24521. +#define FICMMP_CONFIG_I2SXTAL3 (1<<3)
  24522. +#define FICMMP_CONFIG_ADV1 (1<<4)
  24523. +#define FICMMP_CONFIG_IDERST (1<<5)
  24524. +#define FICMMP_CONFIG_LCMEN (1<<6)
  24525. +#define FICMMP_CONFIG_CAMPWDN (1<<7)
  24526. +#define FICMMP_CONFIG_USBPWREN (1<<8)
  24527. +#define FICMMP_CONFIG_LCMPWREN (1<<9)
  24528. +#define FICMMP_CONFIG_TVOUTPWREN (1<<10)
  24529. +#define FICMMP_CONFIG_RS232PWREN (1<<11)
  24530. +#define FICMMP_CONFIG_LCMDATAOUT (1<<12)
  24531. +#define FICMMP_CONFIG_TVODATAOUT (1<<13)
  24532. +#define FICMMP_CONFIG_ADV3 (1<<14)
  24533. +#define FICMMP_CONFIG_ADV4 (1<<15)
  24534. +
  24535. +#define I2S_FREQ_8_192 (0x0)
  24536. +#define I2S_FREQ_11_2896 (0x1)
  24537. +#define I2S_FREQ_12_288 (0x2)
  24538. +#define I2S_FREQ_24_576 (0x3)
  24539. +//#define I2S_FREQ_12_288 (0x4)
  24540. +#define I2S_FREQ_16_9344 (0x5)
  24541. +#define I2S_FREQ_18_432 (0x6)
  24542. +#define I2S_FREQ_36_864 (0x7)
  24543. +#define I2S_FREQ_16_384 (0x8)
  24544. +#define I2S_FREQ_22_5792 (0x9)
  24545. +//#define I2S_FREQ_24_576 (0x10)
  24546. +#define I2S_FREQ_49_152 (0x11)
  24547. +//#define I2S_FREQ_24_576 (0x12)
  24548. +#define I2S_FREQ_33_8688 (0x13)
  24549. +//#define I2S_FREQ_36_864 (0x14)
  24550. +#define I2S_FREQ_73_728 (0x15)
  24551. +
  24552. +#define FICMMP_IDE_PWR 9
  24553. +#define FICMMP_FOCUS_RST 2
  24554. +
  24555. +static __inline void ficmmp_config_set(u16 bits)
  24556. +{
  24557. + extern u16 ficmmp_config;
  24558. + //printk("set_config: %X, Old: %X, New: %X\n", bits, ficmmp_config, ficmmp_config | bits);
  24559. + ficmmp_config |= bits;
  24560. + *((u16*)FICMMP_CONFIG_BASE) = ficmmp_config;
  24561. +}
  24562. +
  24563. +static __inline void ficmmp_config_clear(u16 bits)
  24564. +{
  24565. + extern u16 ficmmp_config;
  24566. +// printk("clear_config: %X, Old: %X, New: %X\n", bits, ficmmp_config, ficmmp_config & ~bits);
  24567. + ficmmp_config &= ~bits;
  24568. + *((u16*)FICMMP_CONFIG_BASE) = ficmmp_config;
  24569. +}
  24570. +
  24571. +static __inline void ficmmp_config_init(void)
  24572. +{
  24573. + au1xxx_gpio_write(FICMMP_CONFIG_ENABLE, 0); //Enable configuration latch
  24574. + ficmmp_config_set(FICMMP_CONFIG_LCMDATAOUT | FICMMP_CONFIG_TVODATAOUT | FICMMP_CONFIG_IDERST); //Disable display data buffers
  24575. + ficmmp_config_set(FICMMP_CONFIG_I2SFREQ(I2S_FREQ_36_864));
  24576. +}
  24577. +
  24578. +static __inline u32 ficmmp_set_i2s_sample_rate(u32 rate)
  24579. +{
  24580. + u32 freq;
  24581. +
  24582. + switch(rate)
  24583. + {
  24584. + case 88200:
  24585. + case 44100:
  24586. + case 8018: freq = I2S_FREQ_11_2896; break;
  24587. + case 48000:
  24588. + case 32000: //freq = I2S_FREQ_18_432; break;
  24589. + case 8000: freq = I2S_FREQ_12_288; break;
  24590. + default: freq = I2S_FREQ_12_288; rate = 8000;
  24591. + }
  24592. + ficmmp_config_clear(FICMMP_CONFIG_I2SFREQ(0xF));
  24593. + ficmmp_config_set(FICMMP_CONFIG_I2SFREQ(freq));
  24594. + return rate;
  24595. +}
  24596. +
  24597. +#endif /* __ASM_FICMMP_H */
  24598. +
  24599. --- a/include/asm-mips/hazards.h
  24600. +++ b/include/asm-mips/hazards.h
  24601. @@ -3,7 +3,7 @@
  24602. * License. See the file "COPYING" in the main directory of this archive
  24603. * for more details.
  24604. *
  24605. - * Copyright (C) 2003 Ralf Baechle
  24606. + * Copyright (C) 2003, 2004 Ralf Baechle
  24607. */
  24608. #ifndef _ASM_HAZARDS_H
  24609. #define _ASM_HAZARDS_H
  24610. @@ -12,38 +12,200 @@
  24611. #ifdef __ASSEMBLY__
  24612. + .macro _ssnop
  24613. + sll $0, $0, 1
  24614. + .endm
  24615. +
  24616. /*
  24617. * RM9000 hazards. When the JTLB is updated by tlbwi or tlbwr, a subsequent
  24618. * use of the JTLB for instructions should not occur for 4 cpu cycles and use
  24619. * for data translations should not occur for 3 cpu cycles.
  24620. */
  24621. #ifdef CONFIG_CPU_RM9000
  24622. -#define rm9000_tlb_hazard \
  24623. +
  24624. +#define mtc0_tlbw_hazard \
  24625. .set push; \
  24626. .set mips32; \
  24627. - ssnop; ssnop; ssnop; ssnop; \
  24628. + _ssnop; _ssnop; _ssnop; _ssnop; \
  24629. .set pop
  24630. +
  24631. +#define tlbw_eret_hazard \
  24632. + .set push; \
  24633. + .set mips32; \
  24634. + _ssnop; _ssnop; _ssnop; _ssnop; \
  24635. + .set pop
  24636. +
  24637. #else
  24638. -#define rm9000_tlb_hazard
  24639. +
  24640. +/*
  24641. + * The taken branch will result in a two cycle penalty for the two killed
  24642. + * instructions on R4000 / R4400. Other processors only have a single cycle
  24643. + * hazard so this is nice trick to have an optimal code for a range of
  24644. + * processors.
  24645. + */
  24646. +#define mtc0_tlbw_hazard \
  24647. + b . + 8
  24648. +#define tlbw_eret_hazard \
  24649. + nop
  24650. #endif
  24651. +/*
  24652. + * mtc0->mfc0 hazard
  24653. + * The 24K has a 2 cycle mtc0/mfc0 execution hazard.
  24654. + * It is a MIPS32R2 processor so ehb will clear the hazard.
  24655. + */
  24656. +
  24657. +#ifdef CONFIG_CPU_MIPSR2
  24658. +/*
  24659. + * Use a macro for ehb unless explicit support for MIPSR2 is enabled
  24660. + */
  24661. + .macro ehb
  24662. + sll $0, $0, 3
  24663. + .endm
  24664. +
  24665. +#define irq_enable_hazard \
  24666. + ehb # irq_enable_hazard
  24667. +
  24668. +#define irq_disable_hazard \
  24669. + ehb # irq_disable_hazard
  24670. +
  24671. +#elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_RM9000)
  24672. +
  24673. +/*
  24674. + * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer.
  24675. + */
  24676. +
  24677. +#define irq_enable_hazard
  24678. +
  24679. +#define irq_disable_hazard
  24680. +
  24681. #else
  24682. /*
  24683. + * Classic MIPS needs 1 - 3 nops or ssnops
  24684. + */
  24685. +#define irq_enable_hazard
  24686. +#define irq_disable_hazard \
  24687. + _ssnop; _ssnop; _ssnop
  24688. +
  24689. +#endif
  24690. +
  24691. +#else /* __ASSEMBLY__ */
  24692. +
  24693. +/*
  24694. * RM9000 hazards. When the JTLB is updated by tlbwi or tlbwr, a subsequent
  24695. * use of the JTLB for instructions should not occur for 4 cpu cycles and use
  24696. * for data translations should not occur for 3 cpu cycles.
  24697. */
  24698. #ifdef CONFIG_CPU_RM9000
  24699. -#define rm9000_tlb_hazard() \
  24700. +
  24701. +#define mtc0_tlbw_hazard() \
  24702. __asm__ __volatile__( \
  24703. ".set\tmips32\n\t" \
  24704. - "ssnop; ssnop; ssnop; ssnop\n\t" \
  24705. + "_ssnop; _ssnop; _ssnop; _ssnop\n\t" \
  24706. + ".set\tmips0")
  24707. +
  24708. +#define tlbw_use_hazard() \
  24709. + __asm__ __volatile__( \
  24710. + ".set\tmips32\n\t" \
  24711. + "_ssnop; _ssnop; _ssnop; _ssnop\n\t" \
  24712. ".set\tmips0")
  24713. #else
  24714. -#define rm9000_tlb_hazard() do { } while (0)
  24715. +
  24716. +/*
  24717. + * Overkill warning ...
  24718. + */
  24719. +#define mtc0_tlbw_hazard() \
  24720. + __asm__ __volatile__( \
  24721. + ".set noreorder\n\t" \
  24722. + "nop; nop; nop; nop; nop; nop;\n\t" \
  24723. + ".set reorder\n\t")
  24724. +
  24725. +#define tlbw_use_hazard() \
  24726. + __asm__ __volatile__( \
  24727. + ".set noreorder\n\t" \
  24728. + "nop; nop; nop; nop; nop; nop;\n\t" \
  24729. + ".set reorder\n\t")
  24730. +
  24731. #endif
  24732. +/*
  24733. + * mtc0->mfc0 hazard
  24734. + * The 24K has a 2 cycle mtc0/mfc0 execution hazard.
  24735. + * It is a MIPS32R2 processor so ehb will clear the hazard.
  24736. + */
  24737. +
  24738. +#ifdef CONFIG_CPU_MIPSR2
  24739. +/*
  24740. + * Use a macro for ehb unless explicit support for MIPSR2 is enabled
  24741. + */
  24742. +__asm__(
  24743. + " .macro ehb \n\t"
  24744. + " sll $0, $0, 3 \n\t"
  24745. + " .endm \n\t"
  24746. + " \n\t"
  24747. + " .macro\tirq_enable_hazard \n\t"
  24748. + " ehb \n\t"
  24749. + " .endm \n\t"
  24750. + " \n\t"
  24751. + " .macro\tirq_disable_hazard \n\t"
  24752. + " ehb \n\t"
  24753. + " .endm");
  24754. +
  24755. +#define irq_enable_hazard() \
  24756. + __asm__ __volatile__( \
  24757. + "ehb\t\t\t\t# irq_enable_hazard")
  24758. +
  24759. +#define irq_disable_hazard() \
  24760. + __asm__ __volatile__( \
  24761. + "ehb\t\t\t\t# irq_disable_hazard")
  24762. +
  24763. +#elif defined(CONFIG_CPU_R10000)
  24764. +
  24765. +/*
  24766. + * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer.
  24767. + */
  24768. +
  24769. +__asm__(
  24770. + " .macro\tirq_enable_hazard \n\t"
  24771. + " .endm \n\t"
  24772. + " \n\t"
  24773. + " .macro\tirq_disable_hazard \n\t"
  24774. + " .endm");
  24775. +
  24776. +#define irq_enable_hazard() do { } while (0)
  24777. +#define irq_disable_hazard() do { } while (0)
  24778. +
  24779. +#else
  24780. +
  24781. +/*
  24782. + * Default for classic MIPS processors. Assume worst case hazards but don't
  24783. + * care about the irq_enable_hazard - sooner or later the hardware will
  24784. + * enable it and we don't care when exactly.
  24785. + */
  24786. +
  24787. +__asm__(
  24788. + " .macro _ssnop \n\t"
  24789. + " sll $0, $2, 1 \n\t"
  24790. + " .endm \n\t"
  24791. + " \n\t"
  24792. + " # \n\t"
  24793. + " # There is a hazard but we do not care \n\t"
  24794. + " # \n\t"
  24795. + " .macro\tirq_enable_hazard \n\t"
  24796. + " .endm \n\t"
  24797. + " \n\t"
  24798. + " .macro\tirq_disable_hazard \n\t"
  24799. + " _ssnop; _ssnop; _ssnop \n\t"
  24800. + " .endm");
  24801. +
  24802. +#define irq_enable_hazard() do { } while (0)
  24803. +#define irq_disable_hazard() \
  24804. + __asm__ __volatile__( \
  24805. + "_ssnop; _ssnop; _ssnop;\t\t# irq_disable_hazard")
  24806. +
  24807. #endif
  24808. +#endif /* __ASSEMBLY__ */
  24809. +
  24810. #endif /* _ASM_HAZARDS_H */
  24811. --- a/include/asm-mips/ide.h
  24812. +++ b/include/asm-mips/ide.h
  24813. @@ -32,12 +32,12 @@ struct ide_ops {
  24814. extern struct ide_ops *ide_ops;
  24815. -static __inline__ int ide_default_irq(ide_ioreg_t base)
  24816. +static inline int ide_default_irq(ide_ioreg_t base)
  24817. {
  24818. return ide_ops->ide_default_irq(base);
  24819. }
  24820. -static __inline__ ide_ioreg_t ide_default_io_base(int index)
  24821. +static inline ide_ioreg_t ide_default_io_base(int index)
  24822. {
  24823. return ide_ops->ide_default_io_base(index);
  24824. }
  24825. @@ -48,7 +48,7 @@ static inline void ide_init_hwif_ports(h
  24826. ide_ops->ide_init_hwif_ports(hw, data_port, ctrl_port, irq);
  24827. }
  24828. -static __inline__ void ide_init_default_hwifs(void)
  24829. +static inline void ide_init_default_hwifs(void)
  24830. {
  24831. #ifndef CONFIG_BLK_DEV_IDEPCI
  24832. hw_regs_t hw;
  24833. @@ -68,7 +68,89 @@ static __inline__ void ide_init_default_
  24834. #define ide_ack_intr(hwif) ((hwif)->hw.ack_intr ? (hwif)->hw.ack_intr(hwif) : 1)
  24835. #endif
  24836. -#include <asm-generic/ide_iops.h>
  24837. +/* MIPS port and memory-mapped I/O string operations. */
  24838. +
  24839. +static inline void __ide_flush_dcache_range(unsigned long addr, unsigned long size)
  24840. +{
  24841. + if (cpu_has_dc_aliases) {
  24842. + unsigned long end = addr + size;
  24843. + for (; addr < end; addr += PAGE_SIZE)
  24844. + flush_dcache_page(virt_to_page(addr));
  24845. + }
  24846. +}
  24847. +
  24848. +static inline void __ide_insw(unsigned long port, void *addr,
  24849. + unsigned int count)
  24850. +{
  24851. + insw(port, addr, count);
  24852. + __ide_flush_dcache_range((unsigned long)addr, count * 2);
  24853. +}
  24854. +
  24855. +static inline void __ide_insl(unsigned long port, void *addr, unsigned int count)
  24856. +{
  24857. + insl(port, addr, count);
  24858. + __ide_flush_dcache_range((unsigned long)addr, count * 4);
  24859. +}
  24860. +
  24861. +static inline void __ide_outsw(unsigned long port, const void *addr,
  24862. + unsigned long count)
  24863. +{
  24864. + outsw(port, addr, count);
  24865. + __ide_flush_dcache_range((unsigned long)addr, count * 2);
  24866. +}
  24867. +
  24868. +static inline void __ide_outsl(unsigned long port, const void *addr,
  24869. + unsigned long count)
  24870. +{
  24871. + outsl(port, addr, count);
  24872. + __ide_flush_dcache_range((unsigned long)addr, count * 4);
  24873. +}
  24874. +
  24875. +static inline void __ide_mm_insw(unsigned long port, void *addr, u32 count)
  24876. +{
  24877. + unsigned long start = (unsigned long) addr;
  24878. +
  24879. + while (count--) {
  24880. + *(u16 *)addr = readw(port);
  24881. + addr += 2;
  24882. + }
  24883. + __ide_flush_dcache_range(start, count * 2);
  24884. +}
  24885. +
  24886. +static inline void __ide_mm_insl(unsigned long port, void *addr, u32 count)
  24887. +{
  24888. + unsigned long start = (unsigned long) addr;
  24889. +
  24890. + while (count--) {
  24891. + *(u32 *)addr = readl(port);
  24892. + addr += 4;
  24893. + }
  24894. + __ide_flush_dcache_range(start, count * 4);
  24895. +}
  24896. +
  24897. +static inline void __ide_mm_outsw(unsigned long port, const void *addr,
  24898. + u32 count)
  24899. +{
  24900. + unsigned long start = (unsigned long) addr;
  24901. +
  24902. + while (count--) {
  24903. + writew(*(u16 *)addr, port);
  24904. + addr += 2;
  24905. + }
  24906. + __ide_flush_dcache_range(start, count * 2);
  24907. +}
  24908. +
  24909. +static inline void __ide_mm_outsl(unsigned long port, const void *addr,
  24910. + u32 count)
  24911. +{
  24912. + unsigned long start = (unsigned long) addr;
  24913. +
  24914. + while (count--) {
  24915. + writel(*(u32 *)addr, port);
  24916. + addr += 4;
  24917. + }
  24918. + __ide_flush_dcache_range(start, count * 4);
  24919. +}
  24920. #endif /* __KERNEL__ */
  24921. --- a/include/asm-mips/io.h
  24922. +++ b/include/asm-mips/io.h
  24923. @@ -392,7 +392,8 @@ static inline unsigned int inl_p(unsigne
  24924. return __ioswab32(__val);
  24925. }
  24926. -static inline void __outsb(unsigned long port, void *addr, unsigned int count)
  24927. +static inline void __outsb(unsigned long port, const void *addr,
  24928. + unsigned int count)
  24929. {
  24930. while (count--) {
  24931. outb(*(u8 *)addr, port);
  24932. @@ -408,7 +409,8 @@ static inline void __insb(unsigned long
  24933. }
  24934. }
  24935. -static inline void __outsw(unsigned long port, void *addr, unsigned int count)
  24936. +static inline void __outsw(unsigned long port, const void *addr,
  24937. + unsigned int count)
  24938. {
  24939. while (count--) {
  24940. outw(*(u16 *)addr, port);
  24941. @@ -424,7 +426,8 @@ static inline void __insw(unsigned long
  24942. }
  24943. }
  24944. -static inline void __outsl(unsigned long port, void *addr, unsigned int count)
  24945. +static inline void __outsl(unsigned long port, const void *addr,
  24946. + unsigned int count)
  24947. {
  24948. while (count--) {
  24949. outl(*(u32 *)addr, port);
  24950. --- a/include/asm-mips/mipsregs.h
  24951. +++ b/include/asm-mips/mipsregs.h
  24952. @@ -757,10 +757,18 @@ do { \
  24953. #define read_c0_config1() __read_32bit_c0_register($16, 1)
  24954. #define read_c0_config2() __read_32bit_c0_register($16, 2)
  24955. #define read_c0_config3() __read_32bit_c0_register($16, 3)
  24956. +#define read_c0_config4() __read_32bit_c0_register($16, 4)
  24957. +#define read_c0_config5() __read_32bit_c0_register($16, 5)
  24958. +#define read_c0_config6() __read_32bit_c0_register($16, 6)
  24959. +#define read_c0_config7() __read_32bit_c0_register($16, 7)
  24960. #define write_c0_config(val) __write_32bit_c0_register($16, 0, val)
  24961. #define write_c0_config1(val) __write_32bit_c0_register($16, 1, val)
  24962. #define write_c0_config2(val) __write_32bit_c0_register($16, 2, val)
  24963. #define write_c0_config3(val) __write_32bit_c0_register($16, 3, val)
  24964. +#define write_c0_config4(val) __write_32bit_c0_register($16, 4, val)
  24965. +#define write_c0_config5(val) __write_32bit_c0_register($16, 5, val)
  24966. +#define write_c0_config6(val) __write_32bit_c0_register($16, 6, val)
  24967. +#define write_c0_config7(val) __write_32bit_c0_register($16, 7, val)
  24968. /*
  24969. * The WatchLo register. There may be upto 8 of them.
  24970. @@ -874,42 +882,34 @@ do { \
  24971. */
  24972. static inline void tlb_probe(void)
  24973. {
  24974. - rm9000_tlb_hazard();
  24975. __asm__ __volatile__(
  24976. ".set noreorder\n\t"
  24977. "tlbp\n\t"
  24978. ".set reorder");
  24979. - rm9000_tlb_hazard();
  24980. }
  24981. static inline void tlb_read(void)
  24982. {
  24983. - rm9000_tlb_hazard();
  24984. __asm__ __volatile__(
  24985. ".set noreorder\n\t"
  24986. "tlbr\n\t"
  24987. ".set reorder");
  24988. - rm9000_tlb_hazard();
  24989. }
  24990. static inline void tlb_write_indexed(void)
  24991. {
  24992. - rm9000_tlb_hazard();
  24993. __asm__ __volatile__(
  24994. ".set noreorder\n\t"
  24995. "tlbwi\n\t"
  24996. ".set reorder");
  24997. - rm9000_tlb_hazard();
  24998. }
  24999. static inline void tlb_write_random(void)
  25000. {
  25001. - rm9000_tlb_hazard();
  25002. __asm__ __volatile__(
  25003. ".set noreorder\n\t"
  25004. "tlbwr\n\t"
  25005. ".set reorder");
  25006. - rm9000_tlb_hazard();
  25007. }
  25008. /*
  25009. --- a/include/asm-mips/mmu_context.h
  25010. +++ b/include/asm-mips/mmu_context.h
  25011. @@ -27,7 +27,7 @@
  25012. #define TLBMISS_HANDLER_SETUP_PGD(pgd) \
  25013. pgd_current[smp_processor_id()] = (unsigned long)(pgd)
  25014. #define TLBMISS_HANDLER_SETUP() \
  25015. - write_c0_context((unsigned long) smp_processor_id() << (23 + 3)); \
  25016. + write_c0_context((unsigned long) smp_processor_id() << 23); \
  25017. TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir)
  25018. extern unsigned long pgd_current[];
  25019. --- a/include/asm-mips/pb1100.h
  25020. +++ b/include/asm-mips/pb1100.h
  25021. @@ -1,5 +1,5 @@
  25022. /*
  25023. - * Alchemy Semi PB1100 Referrence Board
  25024. + * AMD Alchemy PB1100 Reference Boards
  25025. *
  25026. * Copyright 2001 MontaVista Software Inc.
  25027. * Author: MontaVista Software, Inc.
  25028. @@ -27,55 +27,108 @@
  25029. #ifndef __ASM_PB1100_H
  25030. #define __ASM_PB1100_H
  25031. -#define PB1100_IDENT 0xAE000000
  25032. -#define BOARD_STATUS_REG 0xAE000004
  25033. - #define PB1100_ROM_SEL (1<<15)
  25034. - #define PB1100_ROM_SIZ (1<<14)
  25035. - #define PB1100_SWAP_BOOT (1<<13)
  25036. - #define PB1100_FLASH_WP (1<<12)
  25037. - #define PB1100_ROM_H_STS (1<<11)
  25038. - #define PB1100_ROM_L_STS (1<<10)
  25039. - #define PB1100_FLASH_H_STS (1<<9)
  25040. - #define PB1100_FLASH_L_STS (1<<8)
  25041. - #define PB1100_SRAM_SIZ (1<<7)
  25042. - #define PB1100_TSC_BUSY (1<<6)
  25043. - #define PB1100_PCMCIA_VS_MASK (3<<4)
  25044. - #define PB1100_RS232_CD (1<<3)
  25045. - #define PB1100_RS232_CTS (1<<2)
  25046. - #define PB1100_RS232_DSR (1<<1)
  25047. - #define PB1100_RS232_RI (1<<0)
  25048. -
  25049. -#define PB1100_IRDA_RS232 0xAE00000C
  25050. - #define PB1100_IRDA_FULL (0<<14) /* full power */
  25051. - #define PB1100_IRDA_SHUTDOWN (1<<14)
  25052. - #define PB1100_IRDA_TT (2<<14) /* 2/3 power */
  25053. - #define PB1100_IRDA_OT (3<<14) /* 1/3 power */
  25054. - #define PB1100_IRDA_FIR (1<<13)
  25055. -
  25056. -#define PCMCIA_BOARD_REG 0xAE000010
  25057. - #define PB1100_SD_WP1_RO (1<<15) /* read only */
  25058. - #define PB1100_SD_WP0_RO (1<<14) /* read only */
  25059. - #define PB1100_SD_PWR1 (1<<11) /* applies power to SD1 */
  25060. - #define PB1100_SD_PWR0 (1<<10) /* applies power to SD0 */
  25061. - #define PB1100_SEL_SD_CONN1 (1<<9)
  25062. - #define PB1100_SEL_SD_CONN0 (1<<8)
  25063. - #define PC_DEASSERT_RST (1<<7)
  25064. - #define PC_DRV_EN (1<<4)
  25065. -
  25066. -#define PB1100_G_CONTROL 0xAE000014 /* graphics control */
  25067. -
  25068. -#define PB1100_RST_VDDI 0xAE00001C
  25069. - #define PB1100_SOFT_RESET (1<<15) /* clear to reset the board */
  25070. - #define PB1100_VDDI_MASK (0x1F)
  25071. +#define BCSR_KSEG1_ADDR 0xAE000000
  25072. +
  25073. +/*
  25074. + * Overlay data structure of the Pb1100 board registers.
  25075. + * Registers located at physical 0E0000xx, KSEG1 0xAE0000xx
  25076. + */
  25077. +typedef volatile struct
  25078. +{
  25079. + /*00*/ unsigned short whoami;
  25080. + unsigned short reserved0;
  25081. + /*04*/ unsigned short status;
  25082. + unsigned short reserved1;
  25083. + /*08*/ unsigned short switches;
  25084. + unsigned short reserved2;
  25085. + /*0C*/ unsigned short resets;
  25086. + unsigned short reserved3;
  25087. + /*10*/ unsigned short pcmcia;
  25088. + unsigned short reserved4;
  25089. + /*14*/ unsigned short graphics;
  25090. + unsigned short reserved5;
  25091. + /*18*/ unsigned short leds;
  25092. + unsigned short reserved6;
  25093. + /*1C*/ unsigned short swreset;
  25094. + unsigned short reserved7;
  25095. +
  25096. +} BCSR;
  25097. -#define PB1100_LEDS 0xAE000018
  25098. -/* 11:8 is 4 discreet LEDs. Clearing a bit illuminates the LED.
  25099. - * 7:0 is the LED Display's decimal points.
  25100. +/*
  25101. + * Register/mask bit definitions for the BCSRs
  25102. */
  25103. -#define PB1100_HEX_LED 0xAE000018
  25104. +#define BCSR_WHOAMI_DCID 0x000F
  25105. +#define BCSR_WHOAMI_CPLD 0x00F0
  25106. +#define BCSR_WHOAMI_BOARD 0x0F00
  25107. +
  25108. +#define BCSR_STATUS_RS232_RI 0x0001
  25109. +#define BCSR_STATUS_RS232_DSR 0x0002
  25110. +#define BCSR_STATUS_RS232_CTS 0x0004
  25111. +#define BCSR_STATUS_RS232_CD 0x0008
  25112. +#define BCSR_STATUS_PCMCIA_VS_MASK 0x0030
  25113. +#define BCSR_STATUS_TSC_BUSY 0x0040
  25114. +#define BCSR_STATUS_SRAM_SIZ 0x0080
  25115. +#define BCSR_STATUS_FLASH_L_STS 0x0100
  25116. +#define BCSR_STATUS_FLASH_H_STS 0x0200
  25117. +#define BCSR_STATUS_ROM_H_STS 0x0400
  25118. +#define BCSR_STATUS_ROM_L_STS 0x0800
  25119. +#define BCSR_STATUS_FLASH_WP 0x1000
  25120. +#define BCSR_STATUS_SWAP_BOOT 0x2000
  25121. +#define BCSR_STATUS_ROM_SIZ 0x4000
  25122. +#define BCSR_STATUS_ROM_SEL 0x8000
  25123. +
  25124. +#define BCSR_SWITCHES_DIP 0x00FF
  25125. +#define BCSR_SWITCHES_DIP_1 0x0080
  25126. +#define BCSR_SWITCHES_DIP_2 0x0040
  25127. +#define BCSR_SWITCHES_DIP_3 0x0020
  25128. +#define BCSR_SWITCHES_DIP_4 0x0010
  25129. +#define BCSR_SWITCHES_DIP_5 0x0008
  25130. +#define BCSR_SWITCHES_DIP_6 0x0004
  25131. +#define BCSR_SWITCHES_DIP_7 0x0002
  25132. +#define BCSR_SWITCHES_DIP_8 0x0001
  25133. +#define BCSR_SWITCHES_ROTARY 0x0F00
  25134. +#define BCSR_SWITCHES_SDO_CL 0x8000
  25135. +
  25136. +#define BCSR_RESETS_PHY0 0x0001
  25137. +#define BCSR_RESETS_PHY1 0x0002
  25138. +#define BCSR_RESETS_DC 0x0004
  25139. +#define BCSR_RESETS_RS232_RTS 0x0100
  25140. +#define BCSR_RESETS_RS232_DTR 0x0200
  25141. +#define BCSR_RESETS_FIR_SEL 0x2000
  25142. +#define BCSR_RESETS_IRDA_MODE_MASK 0xC000
  25143. +#define BCSR_RESETS_IRDA_MODE_FULL 0x0000
  25144. +#define BCSR_RESETS_IRDA_MODE_OFF 0x4000
  25145. +#define BCSR_RESETS_IRDA_MODE_2_3 0x8000
  25146. +#define BCSR_RESETS_IRDA_MODE_1_3 0xC000
  25147. +
  25148. +#define BCSR_PCMCIA_PC0VPP 0x0003
  25149. +#define BCSR_PCMCIA_PC0VCC 0x000C
  25150. +#define BCSR_PCMCIA_PC0_DR_VEN 0x0010
  25151. +#define BCSR_PCMCIA_PC0RST 0x0080
  25152. +#define BCSR_PCMCIA_SEL_SD_CON0 0x0100
  25153. +#define BCSR_PCMCIA_SEL_SD_CON1 0x0200
  25154. +#define BCSR_PCMCIA_SD0_PWR 0x0400
  25155. +#define BCSR_PCMCIA_SD1_PWR 0x0800
  25156. +#define BCSR_PCMCIA_SD0_WP 0x4000
  25157. +#define BCSR_PCMCIA_SD1_WP 0x8000
  25158. +
  25159. +#define PB1100_G_CONTROL 0xAE000014
  25160. +#define BCSR_GRAPHICS_GPX_SMPASS 0x0010
  25161. +#define BCSR_GRAPHICS_GPX_BIG_ENDIAN 0x0020
  25162. +#define BCSR_GRAPHICS_GPX_RST 0x0040
  25163. +
  25164. +#define BCSR_LEDS_DECIMALS 0x00FF
  25165. +#define BCSR_LEDS_LED0 0x0100
  25166. +#define BCSR_LEDS_LED1 0x0200
  25167. +#define BCSR_LEDS_LED2 0x0400
  25168. +#define BCSR_LEDS_LED3 0x0800
  25169. +
  25170. +#define BCSR_SWRESET_RESET 0x0080
  25171. +#define BCSR_VDDI_VDI 0x001F
  25172. -/* PCMCIA PB1100 specific defines */
  25173. +
  25174. + /* PCMCIA Pb1x00 specific defines */
  25175. #define PCMCIA_MAX_SOCK 0
  25176. #define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK+1)
  25177. @@ -83,3 +136,4 @@
  25178. #define SET_VCC_VPP(VCC, VPP) (((VCC)<<2) | ((VPP)<<0))
  25179. #endif /* __ASM_PB1100_H */
  25180. +
  25181. --- /dev/null
  25182. +++ b/include/asm-mips/pb1200.h
  25183. @@ -0,0 +1,244 @@
  25184. +/*
  25185. + * AMD Alchemy PB1200 Referrence Board
  25186. + * Board Registers defines.
  25187. + *
  25188. + * ########################################################################
  25189. + *
  25190. + * This program is free software; you can distribute it and/or modify it
  25191. + * under the terms of the GNU General Public License (Version 2) as
  25192. + * published by the Free Software Foundation.
  25193. + *
  25194. + * This program is distributed in the hope it will be useful, but WITHOUT
  25195. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  25196. + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  25197. + * for more details.
  25198. + *
  25199. + * You should have received a copy of the GNU General Public License along
  25200. + * with this program; if not, write to the Free Software Foundation, Inc.,
  25201. + * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  25202. + *
  25203. + * ########################################################################
  25204. + *
  25205. + *
  25206. + */
  25207. +#ifndef __ASM_PB1200_H
  25208. +#define __ASM_PB1200_H
  25209. +
  25210. +#include <linux/types.h>
  25211. +
  25212. +// This is defined in au1000.h with bogus value
  25213. +#undef AU1X00_EXTERNAL_INT
  25214. +
  25215. +#define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
  25216. +#define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX
  25217. +#define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC1_TX
  25218. +#define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC1_RX
  25219. +
  25220. +/* SPI and SMB are muxed on the Pb1200 board.
  25221. + Refer to board documentation.
  25222. + */
  25223. +#define SPI_PSC_BASE PSC0_BASE_ADDR
  25224. +#define SMBUS_PSC_BASE PSC0_BASE_ADDR
  25225. +/* AC97 and I2S are muxed on the Pb1200 board.
  25226. + Refer to board documentation.
  25227. + */
  25228. +#define AC97_PSC_BASE PSC1_BASE_ADDR
  25229. +#define I2S_PSC_BASE PSC1_BASE_ADDR
  25230. +
  25231. +#define BCSR_KSEG1_ADDR 0xAD800000
  25232. +
  25233. +typedef volatile struct
  25234. +{
  25235. + /*00*/ u16 whoami;
  25236. + u16 reserved0;
  25237. + /*04*/ u16 status;
  25238. + u16 reserved1;
  25239. + /*08*/ u16 switches;
  25240. + u16 reserved2;
  25241. + /*0C*/ u16 resets;
  25242. + u16 reserved3;
  25243. +
  25244. + /*10*/ u16 pcmcia;
  25245. + u16 reserved4;
  25246. + /*14*/ u16 board;
  25247. + u16 reserved5;
  25248. + /*18*/ u16 disk_leds;
  25249. + u16 reserved6;
  25250. + /*1C*/ u16 system;
  25251. + u16 reserved7;
  25252. +
  25253. + /*20*/ u16 intclr;
  25254. + u16 reserved8;
  25255. + /*24*/ u16 intset;
  25256. + u16 reserved9;
  25257. + /*28*/ u16 intclr_mask;
  25258. + u16 reserved10;
  25259. + /*2C*/ u16 intset_mask;
  25260. + u16 reserved11;
  25261. +
  25262. + /*30*/ u16 sig_status;
  25263. + u16 reserved12;
  25264. + /*34*/ u16 int_status;
  25265. + u16 reserved13;
  25266. + /*38*/ u16 reserved14;
  25267. + u16 reserved15;
  25268. + /*3C*/ u16 reserved16;
  25269. + u16 reserved17;
  25270. +
  25271. +} BCSR;
  25272. +
  25273. +static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
  25274. +
  25275. +/*
  25276. + * Register bit definitions for the BCSRs
  25277. + */
  25278. +#define BCSR_WHOAMI_DCID 0x000F
  25279. +#define BCSR_WHOAMI_CPLD 0x00F0
  25280. +#define BCSR_WHOAMI_BOARD 0x0F00
  25281. +
  25282. +#define BCSR_STATUS_PCMCIA0VS 0x0003
  25283. +#define BCSR_STATUS_PCMCIA1VS 0x000C
  25284. +#define BCSR_STATUS_SWAPBOOT 0x0040
  25285. +#define BCSR_STATUS_FLASHBUSY 0x0100
  25286. +#define BCSR_STATUS_IDECBLID 0x0200
  25287. +#define BCSR_STATUS_SD0WP 0x0400
  25288. +#define BCSR_STATUS_SD1WP 0x0800
  25289. +#define BCSR_STATUS_U0RXD 0x1000
  25290. +#define BCSR_STATUS_U1RXD 0x2000
  25291. +
  25292. +#define BCSR_SWITCHES_OCTAL 0x00FF
  25293. +#define BCSR_SWITCHES_DIP_1 0x0080
  25294. +#define BCSR_SWITCHES_DIP_2 0x0040
  25295. +#define BCSR_SWITCHES_DIP_3 0x0020
  25296. +#define BCSR_SWITCHES_DIP_4 0x0010
  25297. +#define BCSR_SWITCHES_DIP_5 0x0008
  25298. +#define BCSR_SWITCHES_DIP_6 0x0004
  25299. +#define BCSR_SWITCHES_DIP_7 0x0002
  25300. +#define BCSR_SWITCHES_DIP_8 0x0001
  25301. +#define BCSR_SWITCHES_ROTARY 0x0F00
  25302. +
  25303. +#define BCSR_RESETS_ETH 0x0001
  25304. +#define BCSR_RESETS_CAMERA 0x0002
  25305. +#define BCSR_RESETS_DC 0x0004
  25306. +#define BCSR_RESETS_IDE 0x0008
  25307. +/* not resets but in the same register */
  25308. +#define BCSR_RESETS_WSCFSM 0x0800
  25309. +#define BCSR_RESETS_PCS0MUX 0x1000
  25310. +#define BCSR_RESETS_PCS1MUX 0x2000
  25311. +#define BCSR_RESETS_SPISEL 0x4000
  25312. +#define BCSR_RESETS_SD1MUX 0x8000
  25313. +
  25314. +#define BCSR_PCMCIA_PC0VPP 0x0003
  25315. +#define BCSR_PCMCIA_PC0VCC 0x000C
  25316. +#define BCSR_PCMCIA_PC0DRVEN 0x0010
  25317. +#define BCSR_PCMCIA_PC0RST 0x0080
  25318. +#define BCSR_PCMCIA_PC1VPP 0x0300
  25319. +#define BCSR_PCMCIA_PC1VCC 0x0C00
  25320. +#define BCSR_PCMCIA_PC1DRVEN 0x1000
  25321. +#define BCSR_PCMCIA_PC1RST 0x8000
  25322. +
  25323. +#define BCSR_BOARD_LCDVEE 0x0001
  25324. +#define BCSR_BOARD_LCDVDD 0x0002
  25325. +#define BCSR_BOARD_LCDBL 0x0004
  25326. +#define BCSR_BOARD_CAMSNAP 0x0010
  25327. +#define BCSR_BOARD_CAMPWR 0x0020
  25328. +#define BCSR_BOARD_SD0PWR 0x0040
  25329. +#define BCSR_BOARD_SD1PWR 0x0080
  25330. +
  25331. +#define BCSR_LEDS_DECIMALS 0x00FF
  25332. +#define BCSR_LEDS_LED0 0x0100
  25333. +#define BCSR_LEDS_LED1 0x0200
  25334. +#define BCSR_LEDS_LED2 0x0400
  25335. +#define BCSR_LEDS_LED3 0x0800
  25336. +
  25337. +#define BCSR_SYSTEM_VDDI 0x001F
  25338. +#define BCSR_SYSTEM_POWEROFF 0x4000
  25339. +#define BCSR_SYSTEM_RESET 0x8000
  25340. +
  25341. +/* Bit positions for the different interrupt sources */
  25342. +#define BCSR_INT_IDE 0x0001
  25343. +#define BCSR_INT_ETH 0x0002
  25344. +#define BCSR_INT_PC0 0x0004
  25345. +#define BCSR_INT_PC0STSCHG 0x0008
  25346. +#define BCSR_INT_PC1 0x0010
  25347. +#define BCSR_INT_PC1STSCHG 0x0020
  25348. +#define BCSR_INT_DC 0x0040
  25349. +#define BCSR_INT_FLASHBUSY 0x0080
  25350. +#define BCSR_INT_PC0INSERT 0x0100
  25351. +#define BCSR_INT_PC0EJECT 0x0200
  25352. +#define BCSR_INT_PC1INSERT 0x0400
  25353. +#define BCSR_INT_PC1EJECT 0x0800
  25354. +#define BCSR_INT_SD0INSERT 0x1000
  25355. +#define BCSR_INT_SD0EJECT 0x2000
  25356. +#define BCSR_INT_SD1INSERT 0x4000
  25357. +#define BCSR_INT_SD1EJECT 0x8000
  25358. +
  25359. +#define AU1XXX_SMC91111_PHYS_ADDR (0x0D000300)
  25360. +#define AU1XXX_SMC91111_IRQ PB1200_ETH_INT
  25361. +
  25362. +#define AU1XXX_ATA_PHYS_ADDR (0x0C800000)
  25363. +#define AU1XXX_ATA_PHYS_LEN (0x100)
  25364. +#define AU1XXX_ATA_REG_OFFSET (5)
  25365. +#define AU1XXX_ATA_INT PB1200_IDE_INT
  25366. +#define AU1XXX_ATA_DDMA_REQ DSCR_CMD0_DMA_REQ1;
  25367. +#define AU1XXX_ATA_RQSIZE 128
  25368. +
  25369. +#define NAND_PHYS_ADDR 0x1C000000
  25370. +
  25371. +/* Timing values as described in databook, * ns value stripped of
  25372. + * lower 2 bits.
  25373. + * These defines are here rather than an SOC1200 generic file because
  25374. + * the parts chosen on another board may be different and may require
  25375. + * different timings.
  25376. + */
  25377. +#define NAND_T_H (18 >> 2)
  25378. +#define NAND_T_PUL (30 >> 2)
  25379. +#define NAND_T_SU (30 >> 2)
  25380. +#define NAND_T_WH (30 >> 2)
  25381. +
  25382. +/* Bitfield shift amounts */
  25383. +#define NAND_T_H_SHIFT 0
  25384. +#define NAND_T_PUL_SHIFT 4
  25385. +#define NAND_T_SU_SHIFT 8
  25386. +#define NAND_T_WH_SHIFT 12
  25387. +
  25388. +#define NAND_TIMING ((NAND_T_H & 0xF) << NAND_T_H_SHIFT) | \
  25389. + ((NAND_T_PUL & 0xF) << NAND_T_PUL_SHIFT) | \
  25390. + ((NAND_T_SU & 0xF) << NAND_T_SU_SHIFT) | \
  25391. + ((NAND_T_WH & 0xF) << NAND_T_WH_SHIFT)
  25392. +
  25393. +
  25394. +/*
  25395. + * External Interrupts for Pb1200 as of 8/6/2004.
  25396. + * Bit positions in the CPLD registers can be calculated by taking
  25397. + * the interrupt define and subtracting the PB1200_INT_BEGIN value.
  25398. + * *example: IDE bis pos is = 64 - 64
  25399. + ETH bit pos is = 65 - 64
  25400. + */
  25401. +#define PB1200_INT_BEGIN (AU1000_LAST_INTC1_INT + 1)
  25402. +#define PB1200_IDE_INT (PB1200_INT_BEGIN + 0)
  25403. +#define PB1200_ETH_INT (PB1200_INT_BEGIN + 1)
  25404. +#define PB1200_PC0_INT (PB1200_INT_BEGIN + 2)
  25405. +#define PB1200_PC0_STSCHG_INT (PB1200_INT_BEGIN + 3)
  25406. +#define PB1200_PC1_INT (PB1200_INT_BEGIN + 4)
  25407. +#define PB1200_PC1_STSCHG_INT (PB1200_INT_BEGIN + 5)
  25408. +#define PB1200_DC_INT (PB1200_INT_BEGIN + 6)
  25409. +#define PB1200_FLASHBUSY_INT (PB1200_INT_BEGIN + 7)
  25410. +#define PB1200_PC0_INSERT_INT (PB1200_INT_BEGIN + 8)
  25411. +#define PB1200_PC0_EJECT_INT (PB1200_INT_BEGIN + 9)
  25412. +#define PB1200_PC1_INSERT_INT (PB1200_INT_BEGIN + 10)
  25413. +#define PB1200_PC1_EJECT_INT (PB1200_INT_BEGIN + 11)
  25414. +#define PB1200_SD0_INSERT_INT (PB1200_INT_BEGIN + 12)
  25415. +#define PB1200_SD0_EJECT_INT (PB1200_INT_BEGIN + 13)
  25416. +#define PB1200_SD1_INSERT_INT (PB1200_INT_BEGIN + 14)
  25417. +#define PB1200_SD1_EJECT_INT (PB1200_INT_BEGIN + 15)
  25418. +
  25419. +#define PB1200_INT_END (PB1200_INT_BEGIN + 15)
  25420. +
  25421. +/* For drivers/pcmcia/au1000_db1x00.c */
  25422. +#define BOARD_PC0_INT PB1200_PC0_INT
  25423. +#define BOARD_PC1_INT PB1200_PC1_INT
  25424. +#define BOARD_CARD_INSERTED(SOCKET) bcsr->sig_status & (1<<(8+(2*SOCKET)))
  25425. +
  25426. +#endif /* __ASM_PB1200_H */
  25427. +
  25428. --- a/include/asm-mips/pb1550.h
  25429. +++ b/include/asm-mips/pb1550.h
  25430. @@ -30,13 +30,11 @@
  25431. #define DBDMA_AC97_TX_CHAN DSCR_CMD0_PSC1_TX
  25432. #define DBDMA_AC97_RX_CHAN DSCR_CMD0_PSC1_RX
  25433. -#define DBDMA_I2S_TX_CHAN DSCR_CMD0_PSC3_TX
  25434. -#define DBDMA_I2S_RX_CHAN DSCR_CMD0_PSC3_RX
  25435. -
  25436. #define SPI_PSC_BASE PSC0_BASE_ADDR
  25437. #define AC97_PSC_BASE PSC1_BASE_ADDR
  25438. #define SMBUS_PSC_BASE PSC2_BASE_ADDR
  25439. #define I2S_PSC_BASE PSC3_BASE_ADDR
  25440. +#define NAND_CS 1
  25441. #define BCSR_PHYS_ADDR 0xAF000000
  25442. @@ -160,9 +158,23 @@ static BCSR * const bcsr = (BCSR *)BCSR_
  25443. #define NAND_T_SU_SHIFT 8
  25444. #define NAND_T_WH_SHIFT 12
  25445. -#define NAND_TIMING ((NAND_T_H & 0xF) << NAND_T_H_SHIFT) | \
  25446. - ((NAND_T_PUL & 0xF) << NAND_T_PUL_SHIFT) | \
  25447. - ((NAND_T_SU & 0xF) << NAND_T_SU_SHIFT) | \
  25448. - ((NAND_T_WH & 0xF) << NAND_T_WH_SHIFT)
  25449. +#define NAND_TIMING ((NAND_T_H & 0xF) << NAND_T_H_SHIFT) | \
  25450. + ((NAND_T_PUL & 0xF) << NAND_T_PUL_SHIFT) | \
  25451. + ((NAND_T_SU & 0xF) << NAND_T_SU_SHIFT) | \
  25452. + ((NAND_T_WH & 0xF) << NAND_T_WH_SHIFT)
  25453. +
  25454. +/*
  25455. + * Daughter card information.
  25456. + */
  25457. +#define DAUGHTER_CARD_BASE (0xAC000000)
  25458. +#define DAUGHTER_CARD_MEM_SIZE (0xADFFFFFF - DAUGHTER_CARD_BASE + 1)
  25459. +#define DAUGHTER_CARD_IRQ (AU1000_GPIO_3)
  25460. +
  25461. +/* DC_IDE and DC_ETHERNET */
  25462. +#define AU1XXX_ATA_PHYS_ADDR (0x0C000000)
  25463. +#define AU1XXX_ATA_REG_OFFSET (5)
  25464. +
  25465. +#define AU1XXX_SMC91111_PHYS_ADDR (0x0C000300)
  25466. +#define AU1XXX_SMC91111_IRQ AU1000_GPIO_3
  25467. #endif /* __ASM_PB1550_H */
  25468. --- a/include/asm-mips/reg.h
  25469. +++ b/include/asm-mips/reg.h
  25470. @@ -45,6 +45,9 @@
  25471. /*
  25472. * k0/k1 unsaved
  25473. */
  25474. +#define EF_REG26 32
  25475. +#define EF_REG27 33
  25476. +
  25477. #define EF_REG28 34
  25478. #define EF_REG29 35
  25479. #define EF_REG30 36
  25480. @@ -60,6 +63,7 @@
  25481. #define EF_CP0_BADVADDR 41
  25482. #define EF_CP0_STATUS 42
  25483. #define EF_CP0_CAUSE 43
  25484. +#define EF_UNUSED0 44
  25485. #define EF_SIZE 180 /* size in bytes */
  25486. --- a/include/asm-mips/sgi/hpc3.h
  25487. +++ b/include/asm-mips/sgi/hpc3.h
  25488. @@ -128,26 +128,26 @@ struct hpc3_ethregs {
  25489. volatile u32 rx_gfptr; /* current GIO fifo ptr */
  25490. volatile u32 rx_dfptr; /* current device fifo ptr */
  25491. u32 _unused1; /* padding */
  25492. - volatile u32 rx_reset; /* reset register */
  25493. -#define HPC3_ERXRST_CRESET 0x1 /* Reset dma channel and external controller */
  25494. -#define HPC3_ERXRST_CLRIRQ 0x2 /* Clear channel interrupt */
  25495. -#define HPC3_ERXRST_LBACK 0x4 /* Enable diagnostic loopback mode of Seeq8003 */
  25496. -
  25497. - volatile u32 rx_dconfig; /* DMA configuration register */
  25498. -#define HPC3_ERXDCFG_D1 0x0000f /* Cycles to spend in D1 state for PIO */
  25499. -#define HPC3_ERXDCFG_D2 0x000f0 /* Cycles to spend in D2 state for PIO */
  25500. -#define HPC3_ERXDCFG_D3 0x00f00 /* Cycles to spend in D3 state for PIO */
  25501. -#define HPC3_ERXDCFG_WCTRL 0x01000 /* Enable writes of desc into ex ctrl port */
  25502. -#define HPC3_ERXDCFG_FRXDC 0x02000 /* Clear eop stat bits upon rxdc, hw seeq fix */
  25503. -#define HPC3_ERXDCFG_FEOP 0x04000 /* Bad packet marker timeout enable */
  25504. -#define HPC3_ERXDCFG_FIRQ 0x08000 /* Another bad packet timeout enable */
  25505. -#define HPC3_ERXDCFG_PTO 0x30000 /* Programmed timeout value for above two */
  25506. -
  25507. - volatile u32 rx_pconfig; /* PIO configuration register */
  25508. -#define HPC3_ERXPCFG_P1 0x000f /* Cycles to spend in P1 state for PIO */
  25509. -#define HPC3_ERXPCFG_P2 0x00f0 /* Cycles to spend in P2 state for PIO */
  25510. -#define HPC3_ERXPCFG_P3 0x0f00 /* Cycles to spend in P3 state for PIO */
  25511. -#define HPC3_ERXPCFG_TST 0x1000 /* Diagnistic ram test feature bit */
  25512. + volatile u32 reset; /* reset register */
  25513. +#define HPC3_ERST_CRESET 0x1 /* Reset dma channel and external controller */
  25514. +#define HPC3_ERST_CLRIRQ 0x2 /* Clear channel interrupt */
  25515. +#define HPC3_ERST_LBACK 0x4 /* Enable diagnostic loopback mode of Seeq8003 */
  25516. +
  25517. + volatile u32 dconfig; /* DMA configuration register */
  25518. +#define HPC3_EDCFG_D1 0x0000f /* Cycles to spend in D1 state for PIO */
  25519. +#define HPC3_EDCFG_D2 0x000f0 /* Cycles to spend in D2 state for PIO */
  25520. +#define HPC3_EDCFG_D3 0x00f00 /* Cycles to spend in D3 state for PIO */
  25521. +#define HPC3_EDCFG_WCTRL 0x01000 /* Enable writes of desc into ex ctrl port */
  25522. +#define HPC3_EDCFG_FRXDC 0x02000 /* Clear eop stat bits upon rxdc, hw seeq fix */
  25523. +#define HPC3_EDCFG_FEOP 0x04000 /* Bad packet marker timeout enable */
  25524. +#define HPC3_EDCFG_FIRQ 0x08000 /* Another bad packet timeout enable */
  25525. +#define HPC3_EDCFG_PTO 0x30000 /* Programmed timeout value for above two */
  25526. +
  25527. + volatile u32 pconfig; /* PIO configuration register */
  25528. +#define HPC3_EPCFG_P1 0x000f /* Cycles to spend in P1 state for PIO */
  25529. +#define HPC3_EPCFG_P2 0x00f0 /* Cycles to spend in P2 state for PIO */
  25530. +#define HPC3_EPCFG_P3 0x0f00 /* Cycles to spend in P3 state for PIO */
  25531. +#define HPC3_EPCFG_TST 0x1000 /* Diagnistic ram test feature bit */
  25532. u32 _unused2[0x1000/4 - 8]; /* padding */
  25533. @@ -221,7 +221,7 @@ struct hpc3_regs {
  25534. #define HPC3_BESTAT_PIDMASK 0x3f700 /* DMA channel parity identifier */
  25535. u32 _unused1[0x14000/4 - 5]; /* padding */
  25536. -
  25537. +
  25538. /* Now direct PIO per-HPC3 peripheral access to external regs. */
  25539. volatile u32 scsi0_ext[256]; /* SCSI channel 0 external regs */
  25540. u32 _unused2[0x7c00/4];
  25541. @@ -304,7 +304,7 @@ struct hpc3_regs {
  25542. volatile u32 bbram[8192-50-14]; /* Battery backed ram */
  25543. };
  25544. -/*
  25545. +/*
  25546. * It is possible to have two HPC3's within the address space on
  25547. * one machine, though only having one is more likely on an Indy.
  25548. */
  25549. --- a/include/asm-mips/tx4927/tx4927.h
  25550. +++ b/include/asm-mips/tx4927/tx4927.h
  25551. @@ -88,8 +88,8 @@
  25552. /* TX4927 Configuration registers (64-bit registers) */
  25553. -#define TX4927_CONFIG_BASE 0xe300
  25554. -#define TX4927_CONFIG_CCFG 0xe300
  25555. +#define TX4927_CONFIG_BASE 0xe000
  25556. +#define TX4927_CONFIG_CCFG 0xe000
  25557. #define TX4927_CONFIG_CCFG_RESERVED_42_63 BM_63_42
  25558. #define TX4927_CONFIG_CCFG_WDRST BM_41_41
  25559. #define TX4927_CONFIG_CCFG_WDREXEN BM_40_40
  25560. @@ -124,14 +124,14 @@
  25561. #define TX4927_CONFIG_CCFG_ENDIAN BM_02_02
  25562. #define TX4927_CONFIG_CCFG_ARMODE BM_01_01
  25563. #define TX4927_CONFIG_CCFG_ACEHOLD BM_00_00
  25564. -#define TX4927_CONFIG_REVID 0xe308
  25565. +#define TX4927_CONFIG_REVID 0xe008
  25566. #define TX4927_CONFIG_REVID_RESERVED_32_63 BM_32_63
  25567. #define TX4927_CONFIG_REVID_PCODE BM_16_31
  25568. #define TX4927_CONFIG_REVID_MJERREV BM_12_15
  25569. #define TX4927_CONFIG_REVID_MINEREV BM_08_11
  25570. #define TX4927_CONFIG_REVID_MJREV BM_04_07
  25571. #define TX4927_CONFIG_REVID_MINREV BM_00_03
  25572. -#define TX4927_CONFIG_PCFG 0xe310
  25573. +#define TX4927_CONFIG_PCFG 0xe010
  25574. #define TX4927_CONFIG_PCFG_RESERVED_57_63 BM_57_63
  25575. #define TX4927_CONFIG_PCFG_DRVDATA BM_56_56
  25576. #define TX4927_CONFIG_PCFG_DRVCB BM_55_55
  25577. @@ -197,10 +197,10 @@
  25578. #define TX4927_CONFIG_PCFG_DMASEL0_SIO1 BM_00_00
  25579. #define TX4927_CONFIG_PCFG_DMASEL0_ACLC0 BM_01_01
  25580. #define TX4927_CONFIG_PCFG_DMASEL0_ACLC2 BM_00_01
  25581. -#define TX4927_CONFIG_TOEA 0xe318
  25582. +#define TX4927_CONFIG_TOEA 0xe018
  25583. #define TX4927_CONFIG_TOEA_RESERVED_36_63 BM_36_63
  25584. #define TX4927_CONFIG_TOEA_TOEA BM_00_35
  25585. -#define TX4927_CONFIG_CLKCTR 0xe320
  25586. +#define TX4927_CONFIG_CLKCTR 0xe020
  25587. #define TX4927_CONFIG_CLKCTR_RESERVED_26_63 BM_26_63
  25588. #define TX4927_CONFIG_CLKCTR_ACLCKD BM_25_25
  25589. #define TX4927_CONFIG_CLKCTR_PIOCKD BM_24_24
  25590. @@ -223,7 +223,7 @@
  25591. #define TX4927_CONFIG_CLKCTR_TM2RST BM_02_02
  25592. #define TX4927_CONFIG_CLKCTR_SIO0RST BM_01_01
  25593. #define TX4927_CONFIG_CLKCTR_SIO1RST BM_00_00
  25594. -#define TX4927_CONFIG_GARBC 0xe330
  25595. +#define TX4927_CONFIG_GARBC 0xe030
  25596. #define TX4927_CONFIG_GARBC_RESERVED_10_63 BM_10_63
  25597. #define TX4927_CONFIG_GARBC_SET_09 BM_09_09
  25598. #define TX4927_CONFIG_GARBC_ARBMD BM_08_08
  25599. @@ -243,7 +243,7 @@
  25600. #define TX4927_CONFIG_GARBC_PRIORITY_H3_PDMAC BM_00_00
  25601. #define TX4927_CONFIG_GARBC_PRIORITY_H3_DMAC BM_01_01
  25602. #define TX4927_CONFIG_GARBC_PRIORITY_H3_BAD_VALUE BM_00_01
  25603. -#define TX4927_CONFIG_RAMP 0xe348
  25604. +#define TX4927_CONFIG_RAMP 0xe048
  25605. #define TX4927_CONFIG_RAMP_RESERVED_20_63 BM_20_63
  25606. #define TX4927_CONFIG_RAMP_RAMP BM_00_19
  25607. #define TX4927_CONFIG_LIMIT 0xefff
  25608. @@ -456,7 +456,7 @@
  25609. #define TX4927_ACLC_ACINTSTS 0xf710
  25610. #define TX4927_ACLC_ACINTMSTS 0xf714
  25611. #define TX4927_ACLC_ACINTEN 0xf718
  25612. -#define TX4927_ACLC_ACINTDIS 0xfR71c
  25613. +#define TX4927_ACLC_ACINTDIS 0xf71c
  25614. #define TX4927_ACLC_ACSEMAPH 0xf720
  25615. #define TX4927_ACLC_ACGPIDAT 0xf740
  25616. #define TX4927_ACLC_ACGPODAT 0xf744
  25617. --- a/include/asm-mips/unistd.h
  25618. +++ b/include/asm-mips/unistd.h
  25619. @@ -760,7 +760,7 @@ type name(void) \
  25620. if (__a3 == 0) \
  25621. return (type) __v0; \
  25622. errno = __v0; \
  25623. - return -1; \
  25624. + return (type)-1; \
  25625. }
  25626. /*
  25627. @@ -788,7 +788,7 @@ type name(atype a) \
  25628. if (__a3 == 0) \
  25629. return (type) __v0; \
  25630. errno = __v0; \
  25631. - return -1; \
  25632. + return (type)-1; \
  25633. }
  25634. #define _syscall2(type,name,atype,a,btype,b) \
  25635. @@ -813,7 +813,7 @@ type name(atype a, btype b) \
  25636. if (__a3 == 0) \
  25637. return (type) __v0; \
  25638. errno = __v0; \
  25639. - return -1; \
  25640. + return (type)-1; \
  25641. }
  25642. #define _syscall3(type,name,atype,a,btype,b,ctype,c) \
  25643. @@ -839,7 +839,7 @@ type name(atype a, btype b, ctype c) \
  25644. if (__a3 == 0) \
  25645. return (type) __v0; \
  25646. errno = __v0; \
  25647. - return -1; \
  25648. + return (type)-1; \
  25649. }
  25650. #define _syscall4(type,name,atype,a,btype,b,ctype,c,dtype,d) \
  25651. @@ -865,7 +865,7 @@ type name(atype a, btype b, ctype c, dty
  25652. if (__a3 == 0) \
  25653. return (type) __v0; \
  25654. errno = __v0; \
  25655. - return -1; \
  25656. + return (type)-1; \
  25657. }
  25658. #if (_MIPS_SIM == _MIPS_SIM_ABI32)
  25659. @@ -902,7 +902,7 @@ type name(atype a, btype b, ctype c, dty
  25660. if (__a3 == 0) \
  25661. return (type) __v0; \
  25662. errno = __v0; \
  25663. - return -1; \
  25664. + return (type)-1; \
  25665. }
  25666. #define _syscall6(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f) \
  25667. @@ -935,7 +935,7 @@ type name(atype a, btype b, ctype c, dty
  25668. if (__a3 == 0) \
  25669. return (type) __v0; \
  25670. errno = __v0; \
  25671. - return -1; \
  25672. + return (type)-1; \
  25673. }
  25674. #endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
  25675. @@ -966,7 +966,7 @@ type name (atype a,btype b,ctype c,dtype
  25676. if (__a3 == 0) \
  25677. return (type) __v0; \
  25678. errno = __v0; \
  25679. - return -1; \
  25680. + return (type)-1; \
  25681. }
  25682. #define _syscall6(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f) \
  25683. @@ -995,7 +995,7 @@ type name (atype a,btype b,ctype c,dtype
  25684. if (__a3 == 0) \
  25685. return (type) __v0; \
  25686. errno = __v0; \
  25687. - return -1; \
  25688. + return (type)-1; \
  25689. }
  25690. #endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
  25691. --- a/include/asm-mips64/checksum.h
  25692. +++ b/include/asm-mips64/checksum.h
  25693. @@ -144,7 +144,7 @@ static inline unsigned long csum_tcpudp_
  25694. "daddu\t%0, %4\n\t"
  25695. "dsll32\t$1, %0, 0\n\t"
  25696. "daddu\t%0, $1\n\t"
  25697. - "dsrl32\t%0, %0, 0\n\t"
  25698. + "dsra32\t%0, %0, 0\n\t"
  25699. ".set\tat"
  25700. : "=&r" (sum)
  25701. : "0" (daddr), "r"(saddr),
  25702. --- a/include/asm-mips64/elf.h
  25703. +++ b/include/asm-mips64/elf.h
  25704. @@ -64,9 +64,10 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_N
  25705. #define USE_ELF_CORE_DUMP
  25706. #define ELF_EXEC_PAGESIZE PAGE_SIZE
  25707. -#define ELF_CORE_COPY_REGS(_dest,_regs) \
  25708. - memcpy((char *) &_dest, (char *) _regs, \
  25709. - sizeof(struct pt_regs));
  25710. +extern void dump_regs(elf_greg_t *, struct pt_regs *regs);
  25711. +
  25712. +#define ELF_CORE_COPY_REGS(elf_regs, regs) \
  25713. + dump_regs((elf_greg_t *)&(elf_regs), regs);
  25714. /* This yields a mask that user programs can use to figure out what
  25715. instruction set this cpu supports. This could be done in userspace,
  25716. --- a/include/asm-mips64/hazards.h
  25717. +++ b/include/asm-mips64/hazards.h
  25718. @@ -3,7 +3,7 @@
  25719. * License. See the file "COPYING" in the main directory of this archive
  25720. * for more details.
  25721. *
  25722. - * Copyright (C) 2003 Ralf Baechle
  25723. + * Copyright (C) 2003, 2004 Ralf Baechle
  25724. */
  25725. #ifndef _ASM_HAZARDS_H
  25726. #define _ASM_HAZARDS_H
  25727. @@ -12,37 +12,200 @@
  25728. #ifdef __ASSEMBLY__
  25729. + .macro _ssnop
  25730. + sll $0, $0, 1
  25731. + .endm
  25732. +
  25733. /*
  25734. * RM9000 hazards. When the JTLB is updated by tlbwi or tlbwr, a subsequent
  25735. * use of the JTLB for instructions should not occur for 4 cpu cycles and use
  25736. * for data translations should not occur for 3 cpu cycles.
  25737. */
  25738. #ifdef CONFIG_CPU_RM9000
  25739. -#define rm9000_tlb_hazard \
  25740. +
  25741. +#define mtc0_tlbw_hazard \
  25742. + .set push; \
  25743. .set mips32; \
  25744. - ssnop; ssnop; ssnop; ssnop; \
  25745. - .set mips0
  25746. + _ssnop; _ssnop; _ssnop; _ssnop; \
  25747. + .set pop
  25748. +
  25749. +#define tlbw_eret_hazard \
  25750. + .set push; \
  25751. + .set mips32; \
  25752. + _ssnop; _ssnop; _ssnop; _ssnop; \
  25753. + .set pop
  25754. +
  25755. #else
  25756. -#define rm9000_tlb_hazard
  25757. +
  25758. +/*
  25759. + * The taken branch will result in a two cycle penalty for the two killed
  25760. + * instructions on R4000 / R4400. Other processors only have a single cycle
  25761. + * hazard so this is nice trick to have an optimal code for a range of
  25762. + * processors.
  25763. + */
  25764. +#define mtc0_tlbw_hazard \
  25765. + b . + 8
  25766. +#define tlbw_eret_hazard \
  25767. + nop
  25768. #endif
  25769. +/*
  25770. + * mtc0->mfc0 hazard
  25771. + * The 24K has a 2 cycle mtc0/mfc0 execution hazard.
  25772. + * It is a MIPS32R2 processor so ehb will clear the hazard.
  25773. + */
  25774. +
  25775. +#ifdef CONFIG_CPU_MIPSR2
  25776. +/*
  25777. + * Use a macro for ehb unless explicit support for MIPSR2 is enabled
  25778. + */
  25779. + .macro ehb
  25780. + sll $0, $0, 3
  25781. + .endm
  25782. +
  25783. +#define irq_enable_hazard \
  25784. + ehb # irq_enable_hazard
  25785. +
  25786. +#define irq_disable_hazard \
  25787. + ehb # irq_disable_hazard
  25788. +
  25789. +#elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_RM9000)
  25790. +
  25791. +/*
  25792. + * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer.
  25793. + */
  25794. +
  25795. +#define irq_enable_hazard
  25796. +
  25797. +#define irq_disable_hazard
  25798. +
  25799. #else
  25800. /*
  25801. + * Classic MIPS needs 1 - 3 nops or ssnops
  25802. + */
  25803. +#define irq_enable_hazard
  25804. +#define irq_disable_hazard \
  25805. + _ssnop; _ssnop; _ssnop
  25806. +
  25807. +#endif
  25808. +
  25809. +#else /* __ASSEMBLY__ */
  25810. +
  25811. +/*
  25812. * RM9000 hazards. When the JTLB is updated by tlbwi or tlbwr, a subsequent
  25813. * use of the JTLB for instructions should not occur for 4 cpu cycles and use
  25814. * for data translations should not occur for 3 cpu cycles.
  25815. */
  25816. #ifdef CONFIG_CPU_RM9000
  25817. -#define rm9000_tlb_hazard() \
  25818. +
  25819. +#define mtc0_tlbw_hazard() \
  25820. + __asm__ __volatile__( \
  25821. + ".set\tmips32\n\t" \
  25822. + "_ssnop; _ssnop; _ssnop; _ssnop\n\t" \
  25823. + ".set\tmips0")
  25824. +
  25825. +#define tlbw_use_hazard() \
  25826. __asm__ __volatile__( \
  25827. ".set\tmips32\n\t" \
  25828. - "ssnop; ssnop; ssnop; ssnop\n\t" \
  25829. + "_ssnop; _ssnop; _ssnop; _ssnop\n\t" \
  25830. ".set\tmips0")
  25831. #else
  25832. -#define rm9000_tlb_hazard() do { } while (0)
  25833. +
  25834. +/*
  25835. + * Overkill warning ...
  25836. + */
  25837. +#define mtc0_tlbw_hazard() \
  25838. + __asm__ __volatile__( \
  25839. + ".set noreorder\n\t" \
  25840. + "nop; nop; nop; nop; nop; nop;\n\t" \
  25841. + ".set reorder\n\t")
  25842. +
  25843. +#define tlbw_use_hazard() \
  25844. + __asm__ __volatile__( \
  25845. + ".set noreorder\n\t" \
  25846. + "nop; nop; nop; nop; nop; nop;\n\t" \
  25847. + ".set reorder\n\t")
  25848. +
  25849. #endif
  25850. +/*
  25851. + * mtc0->mfc0 hazard
  25852. + * The 24K has a 2 cycle mtc0/mfc0 execution hazard.
  25853. + * It is a MIPS32R2 processor so ehb will clear the hazard.
  25854. + */
  25855. +
  25856. +#ifdef CONFIG_CPU_MIPSR2
  25857. +/*
  25858. + * Use a macro for ehb unless explicit support for MIPSR2 is enabled
  25859. + */
  25860. +__asm__(
  25861. + " .macro ehb \n\t"
  25862. + " sll $0, $0, 3 \n\t"
  25863. + " .endm \n\t"
  25864. + " \n\t"
  25865. + " .macro\tirq_enable_hazard \n\t"
  25866. + " ehb \n\t"
  25867. + " .endm \n\t"
  25868. + " \n\t"
  25869. + " .macro\tirq_disable_hazard \n\t"
  25870. + " ehb \n\t"
  25871. + " .endm");
  25872. +
  25873. +#define irq_enable_hazard() \
  25874. + __asm__ __volatile__( \
  25875. + "ehb\t\t\t\t# irq_enable_hazard")
  25876. +
  25877. +#define irq_disable_hazard() \
  25878. + __asm__ __volatile__( \
  25879. + "ehb\t\t\t\t# irq_disable_hazard")
  25880. +
  25881. +#elif defined(CONFIG_CPU_R10000)
  25882. +
  25883. +/*
  25884. + * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer.
  25885. + */
  25886. +
  25887. +__asm__(
  25888. + " .macro\tirq_enable_hazard \n\t"
  25889. + " .endm \n\t"
  25890. + " \n\t"
  25891. + " .macro\tirq_disable_hazard \n\t"
  25892. + " .endm");
  25893. +
  25894. +#define irq_enable_hazard() do { } while (0)
  25895. +#define irq_disable_hazard() do { } while (0)
  25896. +
  25897. +#else
  25898. +
  25899. +/*
  25900. + * Default for classic MIPS processors. Assume worst case hazards but don't
  25901. + * care about the irq_enable_hazard - sooner or later the hardware will
  25902. + * enable it and we don't care when exactly.
  25903. + */
  25904. +
  25905. +__asm__(
  25906. + " .macro _ssnop \n\t"
  25907. + " sll $0, $2, 1 \n\t"
  25908. + " .endm \n\t"
  25909. + " \n\t"
  25910. + " # \n\t"
  25911. + " # There is a hazard but we do not care \n\t"
  25912. + " # \n\t"
  25913. + " .macro\tirq_enable_hazard \n\t"
  25914. + " .endm \n\t"
  25915. + " \n\t"
  25916. + " .macro\tirq_disable_hazard \n\t"
  25917. + " _ssnop; _ssnop; _ssnop \n\t"
  25918. + " .endm");
  25919. +
  25920. +#define irq_enable_hazard() do { } while (0)
  25921. +#define irq_disable_hazard() \
  25922. + __asm__ __volatile__( \
  25923. + "_ssnop; _ssnop; _ssnop;\t\t# irq_disable_hazard")
  25924. +
  25925. #endif
  25926. +#endif /* __ASSEMBLY__ */
  25927. +
  25928. #endif /* _ASM_HAZARDS_H */
  25929. --- a/include/asm-mips64/ide.h
  25930. +++ b/include/asm-mips64/ide.h
  25931. @@ -32,12 +32,12 @@ struct ide_ops {
  25932. extern struct ide_ops *ide_ops;
  25933. -static __inline__ int ide_default_irq(ide_ioreg_t base)
  25934. +static inline int ide_default_irq(ide_ioreg_t base)
  25935. {
  25936. return ide_ops->ide_default_irq(base);
  25937. }
  25938. -static __inline__ ide_ioreg_t ide_default_io_base(int index)
  25939. +static inline ide_ioreg_t ide_default_io_base(int index)
  25940. {
  25941. return ide_ops->ide_default_io_base(index);
  25942. }
  25943. @@ -48,7 +48,7 @@ static inline void ide_init_hwif_ports(h
  25944. ide_ops->ide_init_hwif_ports(hw, data_port, ctrl_port, irq);
  25945. }
  25946. -static __inline__ void ide_init_default_hwifs(void)
  25947. +static inline void ide_init_default_hwifs(void)
  25948. {
  25949. #ifndef CONFIG_BLK_DEV_IDEPCI
  25950. hw_regs_t hw;
  25951. @@ -68,7 +68,89 @@ static __inline__ void ide_init_default_
  25952. #define ide_ack_intr(hwif) ((hwif)->hw.ack_intr ? (hwif)->hw.ack_intr(hwif) : 1)
  25953. #endif
  25954. -#include <asm-generic/ide_iops.h>
  25955. +/* MIPS port and memory-mapped I/O string operations. */
  25956. +
  25957. +static inline void __ide_flush_dcache_range(unsigned long addr, unsigned long size)
  25958. +{
  25959. + if (cpu_has_dc_aliases) {
  25960. + unsigned long end = addr + size;
  25961. + for (; addr < end; addr += PAGE_SIZE)
  25962. + flush_dcache_page(virt_to_page(addr));
  25963. + }
  25964. +}
  25965. +
  25966. +static inline void __ide_insw(unsigned long port, void *addr,
  25967. + unsigned int count)
  25968. +{
  25969. + insw(port, addr, count);
  25970. + __ide_flush_dcache_range((unsigned long)addr, count * 2);
  25971. +}
  25972. +
  25973. +static inline void __ide_insl(unsigned long port, void *addr, unsigned int count)
  25974. +{
  25975. + insl(port, addr, count);
  25976. + __ide_flush_dcache_range((unsigned long)addr, count * 4);
  25977. +}
  25978. +
  25979. +static inline void __ide_outsw(unsigned long port, const void *addr,
  25980. + unsigned long count)
  25981. +{
  25982. + outsw(port, addr, count);
  25983. + __ide_flush_dcache_range((unsigned long)addr, count * 2);
  25984. +}
  25985. +
  25986. +static inline void __ide_outsl(unsigned long port, const void *addr,
  25987. + unsigned long count)
  25988. +{
  25989. + outsl(port, addr, count);
  25990. + __ide_flush_dcache_range((unsigned long)addr, count * 4);
  25991. +}
  25992. +
  25993. +static inline void __ide_mm_insw(unsigned long port, void *addr, u32 count)
  25994. +{
  25995. + unsigned long start = (unsigned long) addr;
  25996. +
  25997. + while (count--) {
  25998. + *(u16 *)addr = readw(port);
  25999. + addr += 2;
  26000. + }
  26001. + __ide_flush_dcache_range(start, count * 2);
  26002. +}
  26003. +
  26004. +static inline void __ide_mm_insl(unsigned long port, void *addr, u32 count)
  26005. +{
  26006. + unsigned long start = (unsigned long) addr;
  26007. +
  26008. + while (count--) {
  26009. + *(u32 *)addr = readl(port);
  26010. + addr += 4;
  26011. + }
  26012. + __ide_flush_dcache_range(start, count * 4);
  26013. +}
  26014. +
  26015. +static inline void __ide_mm_outsw(unsigned long port, const void *addr,
  26016. + u32 count)
  26017. +{
  26018. + unsigned long start = (unsigned long) addr;
  26019. +
  26020. + while (count--) {
  26021. + writew(*(u16 *)addr, port);
  26022. + addr += 2;
  26023. + }
  26024. + __ide_flush_dcache_range(start, count * 2);
  26025. +}
  26026. +
  26027. +static inline void __ide_mm_outsl(unsigned long port, const void *addr,
  26028. + u32 count)
  26029. +{
  26030. + unsigned long start = (unsigned long) addr;
  26031. +
  26032. + while (count--) {
  26033. + writel(*(u32 *)addr, port);
  26034. + addr += 4;
  26035. + }
  26036. + __ide_flush_dcache_range(start, count * 4);
  26037. +}
  26038. #endif /* __KERNEL__ */
  26039. --- a/include/asm-mips64/io.h
  26040. +++ b/include/asm-mips64/io.h
  26041. @@ -414,7 +414,8 @@ static inline unsigned int inl_p(unsigne
  26042. return __ioswab32(__val);
  26043. }
  26044. -static inline void __outsb(unsigned long port, void *addr, unsigned int count)
  26045. +static inline void __outsb(unsigned long port, const void *addr,
  26046. + unsigned int count)
  26047. {
  26048. while (count--) {
  26049. outb(*(u8 *)addr, port);
  26050. @@ -430,7 +431,8 @@ static inline void __insb(unsigned long
  26051. }
  26052. }
  26053. -static inline void __outsw(unsigned long port, void *addr, unsigned int count)
  26054. +static inline void __outsw(unsigned long port, const void *addr,
  26055. + unsigned int count)
  26056. {
  26057. while (count--) {
  26058. outw(*(u16 *)addr, port);
  26059. @@ -446,7 +448,8 @@ static inline void __insw(unsigned long
  26060. }
  26061. }
  26062. -static inline void __outsl(unsigned long port, void *addr, unsigned int count)
  26063. +static inline void __outsl(unsigned long port, const void *addr,
  26064. + unsigned int count)
  26065. {
  26066. while (count--) {
  26067. outl(*(u32 *)addr, port);
  26068. --- a/include/asm-mips64/mipsregs.h
  26069. +++ b/include/asm-mips64/mipsregs.h
  26070. @@ -757,10 +757,18 @@ do { \
  26071. #define read_c0_config1() __read_32bit_c0_register($16, 1)
  26072. #define read_c0_config2() __read_32bit_c0_register($16, 2)
  26073. #define read_c0_config3() __read_32bit_c0_register($16, 3)
  26074. +#define read_c0_config4() __read_32bit_c0_register($16, 4)
  26075. +#define read_c0_config5() __read_32bit_c0_register($16, 5)
  26076. +#define read_c0_config6() __read_32bit_c0_register($16, 6)
  26077. +#define read_c0_config7() __read_32bit_c0_register($16, 7)
  26078. #define write_c0_config(val) __write_32bit_c0_register($16, 0, val)
  26079. #define write_c0_config1(val) __write_32bit_c0_register($16, 1, val)
  26080. #define write_c0_config2(val) __write_32bit_c0_register($16, 2, val)
  26081. #define write_c0_config3(val) __write_32bit_c0_register($16, 3, val)
  26082. +#define write_c0_config4(val) __write_32bit_c0_register($16, 4, val)
  26083. +#define write_c0_config5(val) __write_32bit_c0_register($16, 5, val)
  26084. +#define write_c0_config6(val) __write_32bit_c0_register($16, 6, val)
  26085. +#define write_c0_config7(val) __write_32bit_c0_register($16, 7, val)
  26086. /*
  26087. * The WatchLo register. There may be upto 8 of them.
  26088. @@ -856,42 +864,34 @@ do { \
  26089. */
  26090. static inline void tlb_probe(void)
  26091. {
  26092. - rm9000_tlb_hazard();
  26093. __asm__ __volatile__(
  26094. ".set noreorder\n\t"
  26095. "tlbp\n\t"
  26096. ".set reorder");
  26097. - rm9000_tlb_hazard();
  26098. }
  26099. static inline void tlb_read(void)
  26100. {
  26101. - rm9000_tlb_hazard();
  26102. __asm__ __volatile__(
  26103. ".set noreorder\n\t"
  26104. "tlbr\n\t"
  26105. ".set reorder");
  26106. - rm9000_tlb_hazard();
  26107. }
  26108. static inline void tlb_write_indexed(void)
  26109. {
  26110. - rm9000_tlb_hazard();
  26111. __asm__ __volatile__(
  26112. ".set noreorder\n\t"
  26113. "tlbwi\n\t"
  26114. ".set reorder");
  26115. - rm9000_tlb_hazard();
  26116. }
  26117. static inline void tlb_write_random(void)
  26118. {
  26119. - rm9000_tlb_hazard();
  26120. __asm__ __volatile__(
  26121. ".set noreorder\n\t"
  26122. "tlbwr\n\t"
  26123. ".set reorder");
  26124. - rm9000_tlb_hazard();
  26125. }
  26126. /*
  26127. --- a/include/asm-mips64/reg.h
  26128. +++ b/include/asm-mips64/reg.h
  26129. @@ -46,6 +46,9 @@
  26130. /*
  26131. * k0/k1 unsaved
  26132. */
  26133. +#define EF_REG26 26
  26134. +#define EF_REG27 27
  26135. +
  26136. #define EF_REG28 28
  26137. #define EF_REG29 29
  26138. #define EF_REG30 30
  26139. --- a/include/asm-mips64/sgi/hpc3.h
  26140. +++ b/include/asm-mips64/sgi/hpc3.h
  26141. @@ -128,26 +128,26 @@ struct hpc3_ethregs {
  26142. volatile u32 rx_gfptr; /* current GIO fifo ptr */
  26143. volatile u32 rx_dfptr; /* current device fifo ptr */
  26144. u32 _unused1; /* padding */
  26145. - volatile u32 rx_reset; /* reset register */
  26146. -#define HPC3_ERXRST_CRESET 0x1 /* Reset dma channel and external controller */
  26147. -#define HPC3_ERXRST_CLRIRQ 0x2 /* Clear channel interrupt */
  26148. -#define HPC3_ERXRST_LBACK 0x4 /* Enable diagnostic loopback mode of Seeq8003 */
  26149. -
  26150. - volatile u32 rx_dconfig; /* DMA configuration register */
  26151. -#define HPC3_ERXDCFG_D1 0x0000f /* Cycles to spend in D1 state for PIO */
  26152. -#define HPC3_ERXDCFG_D2 0x000f0 /* Cycles to spend in D2 state for PIO */
  26153. -#define HPC3_ERXDCFG_D3 0x00f00 /* Cycles to spend in D3 state for PIO */
  26154. -#define HPC3_ERXDCFG_WCTRL 0x01000 /* Enable writes of desc into ex ctrl port */
  26155. -#define HPC3_ERXDCFG_FRXDC 0x02000 /* Clear eop stat bits upon rxdc, hw seeq fix */
  26156. -#define HPC3_ERXDCFG_FEOP 0x04000 /* Bad packet marker timeout enable */
  26157. -#define HPC3_ERXDCFG_FIRQ 0x08000 /* Another bad packet timeout enable */
  26158. -#define HPC3_ERXDCFG_PTO 0x30000 /* Programmed timeout value for above two */
  26159. -
  26160. - volatile u32 rx_pconfig; /* PIO configuration register */
  26161. -#define HPC3_ERXPCFG_P1 0x000f /* Cycles to spend in P1 state for PIO */
  26162. -#define HPC3_ERXPCFG_P2 0x00f0 /* Cycles to spend in P2 state for PIO */
  26163. -#define HPC3_ERXPCFG_P3 0x0f00 /* Cycles to spend in P3 state for PIO */
  26164. -#define HPC3_ERXPCFG_TST 0x1000 /* Diagnistic ram test feature bit */
  26165. + volatile u32 reset; /* reset register */
  26166. +#define HPC3_ERST_CRESET 0x1 /* Reset dma channel and external controller */
  26167. +#define HPC3_ERST_CLRIRQ 0x2 /* Clear channel interrupt */
  26168. +#define HPC3_ERST_LBACK 0x4 /* Enable diagnostic loopback mode of Seeq8003 */
  26169. +
  26170. + volatile u32 dconfig; /* DMA configuration register */
  26171. +#define HPC3_EDCFG_D1 0x0000f /* Cycles to spend in D1 state for PIO */
  26172. +#define HPC3_EDCFG_D2 0x000f0 /* Cycles to spend in D2 state for PIO */
  26173. +#define HPC3_EDCFG_D3 0x00f00 /* Cycles to spend in D3 state for PIO */
  26174. +#define HPC3_EDCFG_WCTRL 0x01000 /* Enable writes of desc into ex ctrl port */
  26175. +#define HPC3_EDCFG_FRXDC 0x02000 /* Clear eop stat bits upon rxdc, hw seeq fix */
  26176. +#define HPC3_EDCFG_FEOP 0x04000 /* Bad packet marker timeout enable */
  26177. +#define HPC3_EDCFG_FIRQ 0x08000 /* Another bad packet timeout enable */
  26178. +#define HPC3_EDCFG_PTO 0x30000 /* Programmed timeout value for above two */
  26179. +
  26180. + volatile u32 pconfig; /* PIO configuration register */
  26181. +#define HPC3_EPCFG_P1 0x000f /* Cycles to spend in P1 state for PIO */
  26182. +#define HPC3_EPCFG_P2 0x00f0 /* Cycles to spend in P2 state for PIO */
  26183. +#define HPC3_EPCFG_P3 0x0f00 /* Cycles to spend in P3 state for PIO */
  26184. +#define HPC3_EPCFG_TST 0x1000 /* Diagnistic ram test feature bit */
  26185. u32 _unused2[0x1000/4 - 8]; /* padding */
  26186. @@ -221,7 +221,7 @@ struct hpc3_regs {
  26187. #define HPC3_BESTAT_PIDMASK 0x3f700 /* DMA channel parity identifier */
  26188. u32 _unused1[0x14000/4 - 5]; /* padding */
  26189. -
  26190. +
  26191. /* Now direct PIO per-HPC3 peripheral access to external regs. */
  26192. volatile u32 scsi0_ext[256]; /* SCSI channel 0 external regs */
  26193. u32 _unused2[0x7c00/4];
  26194. @@ -304,7 +304,7 @@ struct hpc3_regs {
  26195. volatile u32 bbram[8192-50-14]; /* Battery backed ram */
  26196. };
  26197. -/*
  26198. +/*
  26199. * It is possible to have two HPC3's within the address space on
  26200. * one machine, though only having one is more likely on an Indy.
  26201. */
  26202. --- a/include/asm-mips64/sn/nmi.h
  26203. +++ b/include/asm-mips64/sn/nmi.h
  26204. @@ -8,7 +8,7 @@
  26205. #ifndef __ASM_SN_NMI_H
  26206. #define __ASM_SN_NMI_H
  26207. -#ident "$Revision: 1.2.4.2 $"
  26208. +#ident "$Revision: 1.2.4.1 $"
  26209. #include <asm/sn/addrs.h>
  26210. --- a/include/asm-mips64/unistd.h
  26211. +++ b/include/asm-mips64/unistd.h
  26212. @@ -760,7 +760,7 @@ type name(void) \
  26213. if (__a3 == 0) \
  26214. return (type) __v0; \
  26215. errno = __v0; \
  26216. - return -1; \
  26217. + return (type)-1; \
  26218. }
  26219. /*
  26220. @@ -788,7 +788,7 @@ type name(atype a) \
  26221. if (__a3 == 0) \
  26222. return (type) __v0; \
  26223. errno = __v0; \
  26224. - return -1; \
  26225. + return (type)-1; \
  26226. }
  26227. #define _syscall2(type,name,atype,a,btype,b) \
  26228. @@ -813,7 +813,7 @@ type name(atype a, btype b) \
  26229. if (__a3 == 0) \
  26230. return (type) __v0; \
  26231. errno = __v0; \
  26232. - return -1; \
  26233. + return (type)-1; \
  26234. }
  26235. #define _syscall3(type,name,atype,a,btype,b,ctype,c) \
  26236. @@ -839,7 +839,7 @@ type name(atype a, btype b, ctype c) \
  26237. if (__a3 == 0) \
  26238. return (type) __v0; \
  26239. errno = __v0; \
  26240. - return -1; \
  26241. + return (type)-1; \
  26242. }
  26243. #define _syscall4(type,name,atype,a,btype,b,ctype,c,dtype,d) \
  26244. @@ -865,7 +865,7 @@ type name(atype a, btype b, ctype c, dty
  26245. if (__a3 == 0) \
  26246. return (type) __v0; \
  26247. errno = __v0; \
  26248. - return -1; \
  26249. + return (type)-1; \
  26250. }
  26251. #if (_MIPS_SIM == _MIPS_SIM_ABI32)
  26252. @@ -902,7 +902,7 @@ type name(atype a, btype b, ctype c, dty
  26253. if (__a3 == 0) \
  26254. return (type) __v0; \
  26255. errno = __v0; \
  26256. - return -1; \
  26257. + return (type)-1; \
  26258. }
  26259. #define _syscall6(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f) \
  26260. @@ -935,7 +935,7 @@ type name(atype a, btype b, ctype c, dty
  26261. if (__a3 == 0) \
  26262. return (type) __v0; \
  26263. errno = __v0; \
  26264. - return -1; \
  26265. + return (type)-1; \
  26266. }
  26267. #endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
  26268. @@ -966,7 +966,7 @@ type name (atype a,btype b,ctype c,dtype
  26269. if (__a3 == 0) \
  26270. return (type) __v0; \
  26271. errno = __v0; \
  26272. - return -1; \
  26273. + return (type)-1; \
  26274. }
  26275. #define _syscall6(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f) \
  26276. @@ -995,7 +995,7 @@ type name (atype a,btype b,ctype c,dtype
  26277. if (__a3 == 0) \
  26278. return (type) __v0; \
  26279. errno = __v0; \
  26280. - return -1; \
  26281. + return (type)-1; \
  26282. }
  26283. #endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
  26284. --- a/include/asm-ppc/param.h
  26285. +++ b/include/asm-ppc/param.h
  26286. @@ -3,6 +3,9 @@
  26287. #ifndef HZ
  26288. #define HZ 100
  26289. +#ifdef __KERNEL__
  26290. +#define hz_to_std(a) (a)
  26291. +#endif
  26292. #endif
  26293. #define EXEC_PAGESIZE 4096
  26294. --- a/include/asm-s390/param.h
  26295. +++ b/include/asm-s390/param.h
  26296. @@ -11,6 +11,9 @@
  26297. #ifndef HZ
  26298. #define HZ 100
  26299. +#ifdef __KERNEL__
  26300. +#define hz_to_std(a) (a)
  26301. +#endif
  26302. #endif
  26303. #define EXEC_PAGESIZE 4096
  26304. --- a/include/asm-sh/param.h
  26305. +++ b/include/asm-sh/param.h
  26306. @@ -3,6 +3,9 @@
  26307. #ifndef HZ
  26308. #define HZ 100
  26309. +#ifdef __KERNEL__
  26310. +#define hz_to_std(a) (a)
  26311. +#endif
  26312. #endif
  26313. #define EXEC_PAGESIZE 4096
  26314. --- a/include/asm-sparc/param.h
  26315. +++ b/include/asm-sparc/param.h
  26316. @@ -4,6 +4,9 @@
  26317. #ifndef HZ
  26318. #define HZ 100
  26319. +#ifdef __KERNEL__
  26320. +#define hz_to_std(a) (a)
  26321. +#endif
  26322. #endif
  26323. #define EXEC_PAGESIZE 8192 /* Thanks for sun4's we carry baggage... */
  26324. --- a/include/asm-sparc64/param.h
  26325. +++ b/include/asm-sparc64/param.h
  26326. @@ -4,6 +4,9 @@
  26327. #ifndef HZ
  26328. #define HZ 100
  26329. +#ifdef __KERNEL__
  26330. +#define hz_to_std(a) (a)
  26331. +#endif
  26332. #endif
  26333. #define EXEC_PAGESIZE 8192 /* Thanks for sun4's we carry baggage... */
  26334. --- /dev/null
  26335. +++ b/include/linux/i2c-algo-au1550.h
  26336. @@ -0,0 +1,31 @@
  26337. +/*
  26338. + * Copyright (C) 2004 Embedded Edge, LLC <[email protected]>
  26339. + *
  26340. + * This program is free software; you can redistribute it and/or modify
  26341. + * it under the terms of the GNU General Public License as published by
  26342. + * the Free Software Foundation; either version 2 of the License, or
  26343. + * (at your option) any later version.
  26344. + *
  26345. + * This program is distributed in the hope that it will be useful,
  26346. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  26347. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  26348. + * GNU General Public License for more details.
  26349. + *
  26350. + * You should have received a copy of the GNU General Public License
  26351. + * along with this program; if not, write to the Free Software
  26352. + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  26353. + */
  26354. +
  26355. +#ifndef I2C_ALGO_AU1550_H
  26356. +#define I2C_ALGO_AU1550_H 1
  26357. +
  26358. +struct i2c_algo_au1550_data {
  26359. + u32 psc_base;
  26360. + int xfer_timeout;
  26361. + int ack_timeout;
  26362. +};
  26363. +
  26364. +int i2c_au1550_add_bus(struct i2c_adapter *);
  26365. +int i2c_au1550_del_bus(struct i2c_adapter *);
  26366. +
  26367. +#endif /* I2C_ALGO_AU1550_H */
  26368. --- a/include/linux/i2c-id.h
  26369. +++ b/include/linux/i2c-id.h
  26370. @@ -155,6 +155,8 @@
  26371. #define I2C_ALGO_SIBYTE 0x150000 /* Broadcom SiByte SOCs */
  26372. #define I2C_ALGO_SGI 0x160000 /* SGI algorithm */
  26373. +#define I2C_ALGO_AU1550 0x140000 /* Alchemy Au1550 PSC */
  26374. +
  26375. #define I2C_ALGO_EXP 0x800000 /* experimental */
  26376. #define I2C_ALGO_MASK 0xff0000 /* Mask for algorithms */
  26377. @@ -203,6 +205,9 @@
  26378. #define I2C_HW_SGI_VINO 0x00
  26379. #define I2C_HW_SGI_MACE 0x01
  26380. +/* --- Au1550 PSC adapters */
  26381. +#define I2C_HW_AU1550_PSC 0x00
  26382. +
  26383. /* --- SMBus only adapters */
  26384. #define I2C_HW_SMBUS_PIIX4 0x00
  26385. #define I2C_HW_SMBUS_ALI15X3 0x01
  26386. --- a/include/linux/sched.h
  26387. +++ b/include/linux/sched.h
  26388. @@ -619,6 +619,10 @@ asmlinkage long sys_wait4(pid_t pid,unsi
  26389. extern int in_group_p(gid_t);
  26390. extern int in_egroup_p(gid_t);
  26391. +extern ATTRIB_NORET void cpu_idle(void);
  26392. +
  26393. +extern void release_task(struct task_struct * p);
  26394. +
  26395. extern void proc_caches_init(void);
  26396. extern void flush_signals(struct task_struct *);
  26397. extern void flush_signal_handlers(struct task_struct *);
  26398. --- a/include/linux/serial.h
  26399. +++ b/include/linux/serial.h
  26400. @@ -75,7 +75,8 @@ struct serial_struct {
  26401. #define PORT_16654 11
  26402. #define PORT_16850 12
  26403. #define PORT_RSA 13 /* RSA-DV II/S card */
  26404. -#define PORT_MAX 13
  26405. +#define PORT_SB1250 14
  26406. +#define PORT_MAX 14
  26407. #define SERIAL_IO_PORT 0
  26408. #define SERIAL_IO_HUB6 1
  26409. --- a/include/linux/swap.h
  26410. +++ b/include/linux/swap.h
  26411. @@ -1,6 +1,12 @@
  26412. #ifndef _LINUX_SWAP_H
  26413. #define _LINUX_SWAP_H
  26414. +#include <linux/config.h>
  26415. +
  26416. +#define MAX_SWAPFILES 32
  26417. +
  26418. +#ifdef __KERNEL__
  26419. +
  26420. #include <linux/spinlock.h>
  26421. #include <asm/page.h>
  26422. @@ -8,8 +14,6 @@
  26423. #define SWAP_FLAG_PRIO_MASK 0x7fff
  26424. #define SWAP_FLAG_PRIO_SHIFT 0
  26425. -#define MAX_SWAPFILES 32
  26426. -
  26427. /*
  26428. * Magic header for a swap area. The first part of the union is
  26429. * what the swap magic looks like for the old (limited to 128MB)
  26430. @@ -39,8 +43,6 @@ union swap_header {
  26431. } info;
  26432. };
  26433. -#ifdef __KERNEL__
  26434. -
  26435. /*
  26436. * Max bad pages in the new format..
  26437. */
  26438. --- a/include/video/newport.h
  26439. +++ b/include/video/newport.h
  26440. @@ -291,8 +291,6 @@ struct newport_regs {
  26441. unsigned int _unused2[0x1ef];
  26442. struct newport_cregs cgo;
  26443. };
  26444. -extern struct newport_regs *npregs;
  26445. -
  26446. typedef struct {
  26447. unsigned int drawmode1;
  26448. @@ -450,38 +448,26 @@ static __inline__ void newport_cmap_setr
  26449. /* Miscellaneous NEWPORT routines. */
  26450. #define BUSY_TIMEOUT 100000
  26451. -static __inline__ int newport_wait(void)
  26452. +static __inline__ int newport_wait(struct newport_regs *regs)
  26453. {
  26454. - int i = 0;
  26455. + int t = BUSY_TIMEOUT;
  26456. - while(i < BUSY_TIMEOUT)
  26457. - if(!(npregs->cset.status & NPORT_STAT_GBUSY))
  26458. + while (t--)
  26459. + if (!(regs->cset.status & NPORT_STAT_GBUSY))
  26460. break;
  26461. - if(i == BUSY_TIMEOUT)
  26462. - return 1;
  26463. - return 0;
  26464. + return !t;
  26465. }
  26466. -static __inline__ int newport_bfwait(void)
  26467. +static __inline__ int newport_bfwait(struct newport_regs *regs)
  26468. {
  26469. - int i = 0;
  26470. + int t = BUSY_TIMEOUT;
  26471. - while(i < BUSY_TIMEOUT)
  26472. - if(!(npregs->cset.status & NPORT_STAT_BBUSY))
  26473. + while (t--)
  26474. + if(!(regs->cset.status & NPORT_STAT_BBUSY))
  26475. break;
  26476. - if(i == BUSY_TIMEOUT)
  26477. - return 1;
  26478. - return 0;
  26479. + return !t;
  26480. }
  26481. -/* newport.c and cons_newport.c routines */
  26482. -extern struct graphics_ops *newport_probe (int, const char **);
  26483. -
  26484. -void newport_save (void *);
  26485. -void newport_restore (void *);
  26486. -void newport_reset (void);
  26487. -int newport_ioctl (int card, int cmd, unsigned long arg);
  26488. -
  26489. /*
  26490. * DCBMODE register defines:
  26491. */
  26492. @@ -564,7 +550,7 @@ xmap9FIFOWait (struct newport_regs *rex)
  26493. {
  26494. rex->set.dcbmode = DCB_XMAP0 | XM9_CRS_FIFO_AVAIL |
  26495. DCB_DATAWIDTH_1 | R_DCB_XMAP9_PROTOCOL;
  26496. - newport_bfwait ();
  26497. + newport_bfwait (rex);
  26498. while ((rex->set.dcbdata0.bybytes.b3 & 3) != XM9_FIFO_EMPTY)
  26499. ;
  26500. --- a/init/main.c
  26501. +++ b/init/main.c
  26502. @@ -296,7 +296,6 @@ static void __init parse_options(char *l
  26503. extern void setup_arch(char **);
  26504. -extern void cpu_idle(void);
  26505. unsigned long wait_init_idle;
  26506. --- a/kernel/exit.c
  26507. +++ b/kernel/exit.c
  26508. @@ -26,7 +26,7 @@ extern struct task_struct *child_reaper;
  26509. int getrusage(struct task_struct *, int, struct rusage *);
  26510. -static void release_task(struct task_struct * p)
  26511. +void release_task(struct task_struct * p)
  26512. {
  26513. if (p != current) {
  26514. #ifdef CONFIG_SMP
  26515. --- a/kernel/signal.c
  26516. +++ b/kernel/signal.c
  26517. @@ -14,6 +14,7 @@
  26518. #include <linux/init.h>
  26519. #include <linux/sched.h>
  26520. +#include <asm/param.h>
  26521. #include <asm/uaccess.h>
  26522. /*
  26523. @@ -28,6 +29,14 @@
  26524. #define SIG_SLAB_DEBUG 0
  26525. #endif
  26526. +#define DEBUG_SIG 0
  26527. +
  26528. +#if DEBUG_SIG
  26529. +#define SIG_SLAB_DEBUG (SLAB_DEBUG_FREE | SLAB_RED_ZONE /* | SLAB_POISON */)
  26530. +#else
  26531. +#define SIG_SLAB_DEBUG 0
  26532. +#endif
  26533. +
  26534. static kmem_cache_t *sigqueue_cachep;
  26535. atomic_t nr_queued_signals;
  26536. @@ -270,6 +279,11 @@ printk("SIG dequeue (%s:%d): %d ", curre
  26537. signal_pending(current));
  26538. #endif
  26539. +#if DEBUG_SIG
  26540. +printk("SIG dequeue (%s:%d): %d ", current->comm, current->pid,
  26541. + signal_pending(current));
  26542. +#endif
  26543. +
  26544. sig = next_signal(current, mask);
  26545. if (sig) {
  26546. if (current->notifier) {
  26547. @@ -293,6 +307,10 @@ printk("SIG dequeue (%s:%d): %d ", curre
  26548. printk(" %d -> %d\n", signal_pending(current), sig);
  26549. #endif
  26550. +#if DEBUG_SIG
  26551. +printk(" %d -> %d\n", signal_pending(current), sig);
  26552. +#endif
  26553. +
  26554. return sig;
  26555. }
  26556. @@ -551,6 +569,11 @@ send_sig_info(int sig, struct siginfo *i
  26557. printk("SIG queue (%s:%d): %d ", t->comm, t->pid, sig);
  26558. #endif
  26559. +
  26560. +#if DEBUG_SIG
  26561. +printk("SIG queue (%s:%d): %d ", t->comm, t->pid, sig);
  26562. +#endif
  26563. +
  26564. ret = -EINVAL;
  26565. if (sig < 0 || sig > _NSIG)
  26566. goto out_nolock;
  26567. @@ -789,8 +812,8 @@ void do_notify_parent(struct task_struct
  26568. info.si_uid = tsk->uid;
  26569. /* FIXME: find out whether or not this is supposed to be c*time. */
  26570. - info.si_utime = tsk->times.tms_utime;
  26571. - info.si_stime = tsk->times.tms_stime;
  26572. + info.si_utime = hz_to_std(tsk->times.tms_utime);
  26573. + info.si_stime = hz_to_std(tsk->times.tms_stime);
  26574. status = tsk->exit_code & 0x7f;
  26575. why = SI_KERNEL; /* shouldn't happen */
  26576. --- a/kernel/sys.c
  26577. +++ b/kernel/sys.c
  26578. @@ -801,16 +801,23 @@ asmlinkage long sys_setfsgid(gid_t gid)
  26579. asmlinkage long sys_times(struct tms * tbuf)
  26580. {
  26581. + struct tms temp;
  26582. +
  26583. /*
  26584. * In the SMP world we might just be unlucky and have one of
  26585. * the times increment as we use it. Since the value is an
  26586. * atomically safe type this is just fine. Conceptually its
  26587. * as if the syscall took an instant longer to occur.
  26588. */
  26589. - if (tbuf)
  26590. - if (copy_to_user(tbuf, &current->times, sizeof(struct tms)))
  26591. + if (tbuf) {
  26592. + temp.tms_utime = hz_to_std(current->times.tms_utime);
  26593. + temp.tms_stime = hz_to_std(current->times.tms_stime);
  26594. + temp.tms_cutime = hz_to_std(current->times.tms_cutime);
  26595. + temp.tms_cstime = hz_to_std(current->times.tms_cstime);
  26596. + if (copy_to_user(tbuf, &temp, sizeof(struct tms)))
  26597. return -EFAULT;
  26598. - return jiffies;
  26599. + }
  26600. + return hz_to_std(jiffies);
  26601. }
  26602. /*
  26603. --- a/lib/Makefile
  26604. +++ b/lib/Makefile
  26605. @@ -27,6 +27,7 @@ obj-$(CONFIG_CRC32) += crc32.o
  26606. subdir-$(CONFIG_ZLIB_INFLATE) += zlib_inflate
  26607. subdir-$(CONFIG_ZLIB_DEFLATE) += zlib_deflate
  26608. +-include $(TOPDIR)/arch/$(ARCH)/Makefile.lib
  26609. include $(TOPDIR)/drivers/net/Makefile.lib
  26610. include $(TOPDIR)/drivers/usb/Makefile.lib
  26611. include $(TOPDIR)/drivers/bluetooth/Makefile.lib
  26612. --- a/Makefile
  26613. +++ b/Makefile
  26614. @@ -472,10 +472,11 @@ mrproper: clean archmrproper
  26615. $(MAKE) -C Documentation/DocBook mrproper
  26616. distclean: mrproper
  26617. - rm -f core `find . \( -not -type d \) -and \
  26618. - \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
  26619. - -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
  26620. - -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -type f -print` TAGS tags
  26621. + find . \( -not -type d \) -and \
  26622. + \( -name core -o -name '*.orig' -o -name '*.rej' \
  26623. + -o -name '*~' -o -name '*.bak' -o -name '#*#' \
  26624. + -o -name '.*.rej' -o -name '.SUMS' -o -size 0 \
  26625. + -o -name TAGS -o -name tags \) -print | env -i xargs rm -f
  26626. backup: mrproper
  26627. cd .. && tar cf - linux/ | gzip -9 > backup.gz
  26628. @@ -502,7 +503,7 @@ mandocs:
  26629. $(MAKE) -C Documentation/DocBook man
  26630. sums:
  26631. - find . -type f -print | sort | xargs sum > .SUMS
  26632. + find . -type f -print | sort | env -i xargs sum > .SUMS
  26633. dep-files: scripts/mkdep archdep include/linux/version.h
  26634. rm -f .depend .hdepend