100-ubicom_headers.patch 452 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723
  1. diff -ruN linux-2.6.28.10_o/arch/ubicom32/configs/IP5160EVAL_defconfig linux-2.6.28.10/arch/ubicom32/configs/IP5160EVAL_defconfig
  2. --- linux-2.6.28.10_o/arch/ubicom32/configs/IP5160EVAL_defconfig 1970-01-01 02:00:00.000000000 +0200
  3. +++ linux-2.6.28.10/arch/ubicom32/configs/IP5160EVAL_defconfig 2009-08-12 13:08:37.000000000 +0300
  4. @@ -0,0 +1,524 @@
  5. +#
  6. +# Automatically generated make config: don't edit
  7. +# Linux kernel version: 2.6.28.10
  8. +#
  9. +CONFIG_RAMBASE=0x40000000
  10. +CONFIG_UBICOM32=y
  11. +CONFIG_RAMKERNEL=y
  12. +CONFIG_CPU_BIG_ENDIAN=y
  13. +CONFIG_FORCE_MAX_ZONEORDER=14
  14. +CONFIG_HAVE_CLK=y
  15. +# CONFIG_MMU is not set
  16. +# CONFIG_FPU is not set
  17. +CONFIG_ZONE_DMA=y
  18. +CONFIG_RWSEM_GENERIC_SPINLOCK=y
  19. +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
  20. +# CONFIG_ARCH_HAS_ILOG2_U32 is not set
  21. +# CONFIG_ARCH_HAS_ILOG2_U64 is not set
  22. +CONFIG_GENERIC_FIND_NEXT_BIT=y
  23. +CONFIG_GENERIC_GPIO=y
  24. +CONFIG_GPIOLIB=y
  25. +CONFIG_GENERIC_HWEIGHT=y
  26. +CONFIG_GENERIC_HARDIRQS=y
  27. +CONFIG_STACKTRACE_SUPPORT=y
  28. +CONFIG_LOCKDEP_SUPPORT=y
  29. +CONFIG_GENERIC_CALIBRATE_DELAY=y
  30. +CONFIG_GENERIC_TIME=y
  31. +CONFIG_TIME_LOW_RES=y
  32. +CONFIG_GENERIC_CLOCKEVENTS=y
  33. +CONFIG_NO_IOPORT=y
  34. +CONFIG_ARCH_SUPPORTS_AOUT=y
  35. +CONFIG_IRQ_PER_CPU=y
  36. +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
  37. +
  38. +#
  39. +# Processor type and features
  40. +#
  41. +CONFIG_BRD_32MB=y
  42. +
  43. +#
  44. +# Processor type will be selected by Board
  45. +#
  46. +CONFIG_UBICOM32_V3=y
  47. +
  48. +#
  49. +# Board
  50. +#
  51. +# CONFIG_NOBOARD is not set
  52. +# CONFIG_IP5170DPF is not set
  53. +# CONFIG_IP5160DEV is not set
  54. +CONFIG_IP5160EVAL=y
  55. +# CONFIG_IP7145DPF is not set
  56. +# CONFIG_IP7160RGW is not set
  57. +# CONFIG_IP7160BRINGUP is not set
  58. +# CONFIG_IP7160DPF is not set
  59. +# CONFIG_IP7500MODULE is not set
  60. +# CONFIG_IP7500AV is not set
  61. +# CONFIG_IP7500MEDIA is not set
  62. +
  63. +#
  64. +# Kernel Options
  65. +#
  66. +# CONFIG_SMP is not set
  67. +CONFIG_TIMER_EXTRA_ALLOC=0
  68. +# CONFIG_IRQSTACKS is not set
  69. +CONFIG_UBICOM32_OCM_MODULES=y
  70. +CONFIG_OCM_MODULES_RESERVATION=41
  71. +CONFIG_OCM_MODULES_MAY_CONSUME_REMAINING_CODESPACE=y
  72. +CONFIG_HZ=1000
  73. +
  74. +#
  75. +# RAM configuration
  76. +#
  77. +CONFIG_RAMSIZE=0x02000000
  78. +CONFIG_KERNELBASE=0x40400000
  79. +
  80. +#
  81. +# Build options
  82. +#
  83. +CONFIG_LINKER_RELAXATION=y
  84. +
  85. +#
  86. +# Driver options
  87. +#
  88. +
  89. +#
  90. +# PCI Bus
  91. +#
  92. +# CONFIG_PCI is not set
  93. +# CONFIG_ARCH_SUPPORTS_MSI is not set
  94. +
  95. +#
  96. +# Input devices
  97. +#
  98. +# CONFIG_UBICOM_INPUT is not set
  99. +# CONFIG_UBICOM_INPUT_I2C is not set
  100. +CONFIG_UBICOM_SWITCH=y
  101. +
  102. +#
  103. +# Misc devices
  104. +#
  105. +# CONFIG_UBICOM_HID is not set
  106. +CONFIG_CMDLINE_BOOL=y
  107. +CONFIG_CMDLINE="console=ttyUM0"
  108. +# CONFIG_CMDLINE_OVERRIDE is not set
  109. +
  110. +#
  111. +# Kernel hacking
  112. +#
  113. +CONFIG_TRACE_IRQFLAGS_SUPPORT=y
  114. +CONFIG_PROTECT_KERNEL=y
  115. +# CONFIG_NO_KERNEL_MSG is not set
  116. +# CONFIG_EARLY_PRINTK is not set
  117. +# CONFIG_STOP_ON_TRAP is not set
  118. +# CONFIG_STOP_ON_BUG is not set
  119. +# CONFIG_DEBUG_IRQMEASURE is not set
  120. +# CONFIG_DEBUG_PCIMEASURE is not set
  121. +# CONFIG_ACCESS_OK_CHECKS_ENABLED is not set
  122. +CONFIG_UNALIGNED_ACCESS_ENABLED=y
  123. +# CONFIG_UNALIGNED_ACCESS_USERSPACE_ONLY is not set
  124. +# CONFIG_UNALIGNED_ACCESS_DISABLED is not set
  125. +# CONFIG_DEBUG_STACKOVERFLOW is not set
  126. +# CONFIG_DEBUG_STACK_USAGE is not set
  127. +# CONFIG_PRINTK_TIME is not set
  128. +CONFIG_ENABLE_WARN_DEPRECATED=y
  129. +CONFIG_ENABLE_MUST_CHECK=y
  130. +CONFIG_FRAME_WARN=1024
  131. +# CONFIG_MAGIC_SYSRQ is not set
  132. +# CONFIG_UNUSED_SYMBOLS is not set
  133. +# CONFIG_HEADERS_CHECK is not set
  134. +CONFIG_DEBUG_KERNEL=y
  135. +# CONFIG_DEBUG_SHIRQ is not set
  136. +CONFIG_DETECT_SOFTLOCKUP=y
  137. +# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
  138. +CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
  139. +CONFIG_SCHED_DEBUG=y
  140. +# CONFIG_SCHEDSTATS is not set
  141. +# CONFIG_TIMER_STATS is not set
  142. +# CONFIG_DEBUG_OBJECTS is not set
  143. +# CONFIG_DEBUG_SLAB is not set
  144. +# CONFIG_DEBUG_SPINLOCK is not set
  145. +# CONFIG_DEBUG_MUTEXES is not set
  146. +# CONFIG_DEBUG_LOCK_ALLOC is not set
  147. +# CONFIG_PROVE_LOCKING is not set
  148. +# CONFIG_LOCK_STAT is not set
  149. +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
  150. +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
  151. +# CONFIG_DEBUG_KOBJECT is not set
  152. +CONFIG_DEBUG_INFO=y
  153. +# CONFIG_DEBUG_VM is not set
  154. +# CONFIG_DEBUG_WRITECOUNT is not set
  155. +# CONFIG_DEBUG_MEMORY_INIT is not set
  156. +# CONFIG_DEBUG_LIST is not set
  157. +# CONFIG_DEBUG_SG is not set
  158. +# CONFIG_FRAME_POINTER is not set
  159. +# CONFIG_BOOT_PRINTK_DELAY is not set
  160. +# CONFIG_RCU_TORTURE_TEST is not set
  161. +# CONFIG_RCU_CPU_STALL_DETECTOR is not set
  162. +# CONFIG_BACKTRACE_SELF_TEST is not set
  163. +# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
  164. +# CONFIG_FAULT_INJECTION is not set
  165. +# CONFIG_SYSCTL_SYSCALL_CHECK is not set
  166. +
  167. +#
  168. +# Tracers
  169. +#
  170. +# CONFIG_IRQSOFF_TRACER is not set
  171. +# CONFIG_SCHED_TRACER is not set
  172. +# CONFIG_CONTEXT_SWITCH_TRACER is not set
  173. +# CONFIG_BOOT_TRACER is not set
  174. +# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
  175. +# CONFIG_SAMPLES is not set
  176. +
  177. +#
  178. +# Executable file formats
  179. +#
  180. +CONFIG_BINFMT_ELF_FDPIC=y
  181. +CONFIG_BINFMT_FLAT=y
  182. +# CONFIG_BINFMT_ZFLAT is not set
  183. +# CONFIG_BINFMT_SHARED_FLAT is not set
  184. +# CONFIG_HAVE_AOUT is not set
  185. +# CONFIG_BINFMT_MISC is not set
  186. +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
  187. +
  188. +#
  189. +# General setup
  190. +#
  191. +CONFIG_EXPERIMENTAL=y
  192. +CONFIG_BROKEN_ON_SMP=y
  193. +CONFIG_INIT_ENV_ARG_LIMIT=32
  194. +CONFIG_LOCALVERSION=""
  195. +CONFIG_LOCALVERSION_AUTO=y
  196. +# CONFIG_SYSVIPC is not set
  197. +# CONFIG_BSD_PROCESS_ACCT is not set
  198. +# CONFIG_IKCONFIG is not set
  199. +CONFIG_LOG_BUF_SHIFT=14
  200. +# CONFIG_CGROUPS is not set
  201. +# CONFIG_GROUP_SCHED is not set
  202. +# CONFIG_RELAY is not set
  203. +# CONFIG_NAMESPACES is not set
  204. +CONFIG_BLK_DEV_INITRD=y
  205. +CONFIG_INITRAMFS_SOURCE=""
  206. +CONFIG_INITRAMFS_ROOT_UID=0
  207. +CONFIG_INITRAMFS_ROOT_GID=0
  208. +CONFIG_CC_OPTIMIZE_FOR_SIZE=y
  209. +CONFIG_SYSCTL=y
  210. +CONFIG_EMBEDDED=y
  211. +CONFIG_SYSCTL_SYSCALL=y
  212. +# CONFIG_KALLSYMS is not set
  213. +# CONFIG_HOTPLUG is not set
  214. +CONFIG_PRINTK=y
  215. +CONFIG_BUG=y
  216. +# CONFIG_ELF_CORE is not set
  217. +CONFIG_BASE_FULL=y
  218. +# CONFIG_FUTEX is not set
  219. +# CONFIG_EPOLL is not set
  220. +# CONFIG_SIGNALFD is not set
  221. +# CONFIG_TIMERFD is not set
  222. +# CONFIG_EVENTFD is not set
  223. +CONFIG_AIO=y
  224. +# CONFIG_VM_EVENT_COUNTERS is not set
  225. +# CONFIG_COMPAT_BRK is not set
  226. +CONFIG_SLAB=y
  227. +# CONFIG_SLUB is not set
  228. +# CONFIG_SLOB is not set
  229. +# CONFIG_PROFILING is not set
  230. +# CONFIG_MARKERS is not set
  231. +CONFIG_HAVE_OPROFILE=y
  232. +# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
  233. +CONFIG_SLABINFO=y
  234. +CONFIG_TINY_SHMEM=y
  235. +CONFIG_BASE_SMALL=0
  236. +# CONFIG_MODULES is not set
  237. +CONFIG_BLOCK=y
  238. +# CONFIG_LBD is not set
  239. +# CONFIG_LSF is not set
  240. +# CONFIG_BLK_DEV_BSG is not set
  241. +# CONFIG_BLK_DEV_INTEGRITY is not set
  242. +
  243. +#
  244. +# IO Schedulers
  245. +#
  246. +CONFIG_IOSCHED_NOOP=y
  247. +# CONFIG_IOSCHED_AS is not set
  248. +# CONFIG_IOSCHED_DEADLINE is not set
  249. +# CONFIG_IOSCHED_CFQ is not set
  250. +# CONFIG_DEFAULT_AS is not set
  251. +# CONFIG_DEFAULT_DEADLINE is not set
  252. +# CONFIG_DEFAULT_CFQ is not set
  253. +CONFIG_DEFAULT_NOOP=y
  254. +CONFIG_DEFAULT_IOSCHED="noop"
  255. +CONFIG_CLASSIC_RCU=y
  256. +CONFIG_PREEMPT_NONE=y
  257. +# CONFIG_PREEMPT_VOLUNTARY is not set
  258. +# CONFIG_PREEMPT is not set
  259. +# CONFIG_NO_HZ is not set
  260. +# CONFIG_HIGH_RES_TIMERS is not set
  261. +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
  262. +CONFIG_SELECT_MEMORY_MODEL=y
  263. +CONFIG_FLATMEM_MANUAL=y
  264. +# CONFIG_DISCONTIGMEM_MANUAL is not set
  265. +# CONFIG_SPARSEMEM_MANUAL is not set
  266. +CONFIG_FLATMEM=y
  267. +CONFIG_FLAT_NODE_MEM_MAP=y
  268. +CONFIG_PAGEFLAGS_EXTENDED=y
  269. +CONFIG_SPLIT_PTLOCK_CPUS=4
  270. +# CONFIG_RESOURCES_64BIT is not set
  271. +# CONFIG_PHYS_ADDR_T_64BIT is not set
  272. +CONFIG_ZONE_DMA_FLAG=1
  273. +CONFIG_VIRT_TO_BUS=y
  274. +# CONFIG_NET is not set
  275. +
  276. +#
  277. +# Device Drivers
  278. +#
  279. +
  280. +#
  281. +# Generic Driver Options
  282. +#
  283. +CONFIG_STANDALONE=y
  284. +CONFIG_PREVENT_FIRMWARE_BUILD=y
  285. +CONFIG_DEBUG_DRIVER=y
  286. +CONFIG_DEBUG_DEVRES=y
  287. +# CONFIG_SYS_HYPERVISOR is not set
  288. +# CONFIG_MTD is not set
  289. +# CONFIG_PARPORT is not set
  290. +CONFIG_BLK_DEV=y
  291. +# CONFIG_BLK_DEV_COW_COMMON is not set
  292. +# CONFIG_BLK_DEV_LOOP is not set
  293. +CONFIG_BLK_DEV_RAM=y
  294. +CONFIG_BLK_DEV_RAM_COUNT=16
  295. +CONFIG_BLK_DEV_RAM_SIZE=4096
  296. +# CONFIG_BLK_DEV_XIP is not set
  297. +# CONFIG_CDROM_PKTCDVD is not set
  298. +# CONFIG_MISC_DEVICES is not set
  299. +
  300. +#
  301. +# SCSI device support
  302. +#
  303. +# CONFIG_RAID_ATTRS is not set
  304. +# CONFIG_SCSI is not set
  305. +# CONFIG_SCSI_DMA is not set
  306. +# CONFIG_SCSI_NETLINK is not set
  307. +# CONFIG_ATA is not set
  308. +# CONFIG_MD is not set
  309. +# CONFIG_PHONE is not set
  310. +
  311. +#
  312. +# Input device support
  313. +#
  314. +# CONFIG_INPUT is not set
  315. +
  316. +#
  317. +# Hardware I/O ports
  318. +#
  319. +# CONFIG_SERIO is not set
  320. +# CONFIG_GAMEPORT is not set
  321. +
  322. +#
  323. +# Character devices
  324. +#
  325. +# CONFIG_VT is not set
  326. +CONFIG_DEVKMEM=y
  327. +# CONFIG_SERIAL_NONSTANDARD is not set
  328. +
  329. +#
  330. +# Serial drivers
  331. +#
  332. +# CONFIG_SERIAL_8250 is not set
  333. +
  334. +#
  335. +# Non-8250 serial port support
  336. +#
  337. +CONFIG_SERIAL_UBI32_SERDES=y
  338. +CONFIG_SERIAL_UBI32_SERDES_CONSOLE=y
  339. +# CONFIG_SERIAL_UBI32_MAILBOX is not set
  340. +CONFIG_SERIAL_CORE=y
  341. +CONFIG_SERIAL_CORE_CONSOLE=y
  342. +# CONFIG_UNIX98_PTYS is not set
  343. +CONFIG_LEGACY_PTYS=y
  344. +CONFIG_LEGACY_PTY_COUNT=256
  345. +# CONFIG_IPMI_HANDLER is not set
  346. +# CONFIG_HW_RANDOM is not set
  347. +# CONFIG_RTC is not set
  348. +# CONFIG_GEN_RTC is not set
  349. +# CONFIG_R3964 is not set
  350. +# CONFIG_RAW_DRIVER is not set
  351. +# CONFIG_TCG_TPM is not set
  352. +# CONFIG_I2C is not set
  353. +# CONFIG_SPI is not set
  354. +# CONFIG_DEBUG_GPIO is not set
  355. +
  356. +#
  357. +# Memory mapped GPIO expanders:
  358. +#
  359. +
  360. +#
  361. +# I2C GPIO expanders:
  362. +#
  363. +
  364. +#
  365. +# PCI GPIO expanders:
  366. +#
  367. +
  368. +#
  369. +# SPI GPIO expanders:
  370. +#
  371. +# CONFIG_W1 is not set
  372. +# CONFIG_POWER_SUPPLY is not set
  373. +# CONFIG_HWMON is not set
  374. +# CONFIG_THERMAL is not set
  375. +# CONFIG_THERMAL_HWMON is not set
  376. +# CONFIG_WATCHDOG is not set
  377. +CONFIG_SSB_POSSIBLE=y
  378. +
  379. +#
  380. +# Sonics Silicon Backplane
  381. +#
  382. +# CONFIG_SSB is not set
  383. +
  384. +#
  385. +# Multifunction device drivers
  386. +#
  387. +# CONFIG_MFD_CORE is not set
  388. +# CONFIG_MFD_SM501 is not set
  389. +# CONFIG_HTC_PASIC3 is not set
  390. +# CONFIG_MFD_TMIO is not set
  391. +# CONFIG_REGULATOR is not set
  392. +
  393. +#
  394. +# Multimedia devices
  395. +#
  396. +
  397. +#
  398. +# Multimedia core support
  399. +#
  400. +# CONFIG_VIDEO_DEV is not set
  401. +# CONFIG_VIDEO_MEDIA is not set
  402. +
  403. +#
  404. +# Multimedia drivers
  405. +#
  406. +# CONFIG_DAB is not set
  407. +
  408. +#
  409. +# Graphics support
  410. +#
  411. +# CONFIG_VGASTATE is not set
  412. +# CONFIG_VIDEO_OUTPUT_CONTROL is not set
  413. +# CONFIG_FB is not set
  414. +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
  415. +
  416. +#
  417. +# Display device support
  418. +#
  419. +# CONFIG_DISPLAY_SUPPORT is not set
  420. +# CONFIG_SOUND is not set
  421. +# CONFIG_USB_SUPPORT is not set
  422. +# CONFIG_MMC is not set
  423. +# CONFIG_MEMSTICK is not set
  424. +# CONFIG_NEW_LEDS is not set
  425. +# CONFIG_ACCESSIBILITY is not set
  426. +# CONFIG_RTC_CLASS is not set
  427. +# CONFIG_DMADEVICES is not set
  428. +# CONFIG_UIO is not set
  429. +# CONFIG_STAGING is not set
  430. +
  431. +#
  432. +# File systems
  433. +#
  434. +# CONFIG_EXT2_FS is not set
  435. +# CONFIG_EXT3_FS is not set
  436. +# CONFIG_EXT4_FS is not set
  437. +# CONFIG_REISERFS_FS is not set
  438. +# CONFIG_JFS_FS is not set
  439. +# CONFIG_FS_POSIX_ACL is not set
  440. +CONFIG_FILE_LOCKING=y
  441. +# CONFIG_XFS_FS is not set
  442. +# CONFIG_DNOTIFY is not set
  443. +# CONFIG_INOTIFY is not set
  444. +# CONFIG_QUOTA is not set
  445. +# CONFIG_AUTOFS_FS is not set
  446. +# CONFIG_AUTOFS4_FS is not set
  447. +# CONFIG_FUSE_FS is not set
  448. +
  449. +#
  450. +# CD-ROM/DVD Filesystems
  451. +#
  452. +# CONFIG_ISO9660_FS is not set
  453. +# CONFIG_UDF_FS is not set
  454. +
  455. +#
  456. +# DOS/FAT/NT Filesystems
  457. +#
  458. +# CONFIG_MSDOS_FS is not set
  459. +# CONFIG_VFAT_FS is not set
  460. +# CONFIG_NTFS_FS is not set
  461. +
  462. +#
  463. +# Pseudo filesystems
  464. +#
  465. +CONFIG_PROC_FS=y
  466. +CONFIG_PROC_SYSCTL=y
  467. +# CONFIG_SYSFS is not set
  468. +# CONFIG_TMPFS is not set
  469. +# CONFIG_HUGETLB_PAGE is not set
  470. +
  471. +#
  472. +# Layered filesystems
  473. +#
  474. +# CONFIG_UNION_FS is not set
  475. +
  476. +#
  477. +# Miscellaneous filesystems
  478. +#
  479. +# CONFIG_ADFS_FS is not set
  480. +# CONFIG_AFFS_FS is not set
  481. +# CONFIG_HFS_FS is not set
  482. +# CONFIG_HFSPLUS_FS is not set
  483. +# CONFIG_BEFS_FS is not set
  484. +# CONFIG_BFS_FS is not set
  485. +# CONFIG_EFS_FS is not set
  486. +# CONFIG_CRAMFS is not set
  487. +# CONFIG_VXFS_FS is not set
  488. +# CONFIG_MINIX_FS is not set
  489. +# CONFIG_OMFS_FS is not set
  490. +# CONFIG_HPFS_FS is not set
  491. +# CONFIG_QNX4FS_FS is not set
  492. +CONFIG_ROMFS_FS=y
  493. +# CONFIG_SYSV_FS is not set
  494. +# CONFIG_UFS_FS is not set
  495. +
  496. +#
  497. +# Partition Types
  498. +#
  499. +# CONFIG_PARTITION_ADVANCED is not set
  500. +CONFIG_MSDOS_PARTITION=y
  501. +# CONFIG_NLS is not set
  502. +
  503. +#
  504. +# Security options
  505. +#
  506. +# CONFIG_KEYS is not set
  507. +# CONFIG_SECURITYFS is not set
  508. +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
  509. +# CONFIG_CRYPTO is not set
  510. +
  511. +#
  512. +# OCF Configuration
  513. +#
  514. +# CONFIG_OCF_OCF is not set
  515. +
  516. +#
  517. +# Library routines
  518. +#
  519. +CONFIG_BITREVERSE=y
  520. +# CONFIG_CRC_CCITT is not set
  521. +# CONFIG_CRC16 is not set
  522. +# CONFIG_CRC_T10DIF is not set
  523. +# CONFIG_CRC_ITU_T is not set
  524. +CONFIG_CRC32=y
  525. +# CONFIG_CRC7 is not set
  526. +# CONFIG_LIBCRC32C is not set
  527. +CONFIG_HAS_IOMEM=y
  528. +CONFIG_HAS_DMA=y
  529. diff -ruN linux-2.6.28.10_o/arch/ubicom32/configs/IP7160RGW_defconfig linux-2.6.28.10/arch/ubicom32/configs/IP7160RGW_defconfig
  530. --- linux-2.6.28.10_o/arch/ubicom32/configs/IP7160RGW_defconfig 1970-01-01 02:00:00.000000000 +0200
  531. +++ linux-2.6.28.10/arch/ubicom32/configs/IP7160RGW_defconfig 2009-08-12 13:08:37.000000000 +0300
  532. @@ -0,0 +1,1301 @@
  533. +#
  534. +# Automatically generated make config: don't edit
  535. +# Linux kernel version: 2.6.28.10
  536. +#
  537. +CONFIG_RAMBASE=0x40000000
  538. +CONFIG_UBICOM32=y
  539. +CONFIG_RAMKERNEL=y
  540. +CONFIG_CPU_BIG_ENDIAN=y
  541. +CONFIG_FORCE_MAX_ZONEORDER=14
  542. +CONFIG_HAVE_CLK=y
  543. +# CONFIG_MMU is not set
  544. +# CONFIG_FPU is not set
  545. +CONFIG_ZONE_DMA=y
  546. +CONFIG_RWSEM_GENERIC_SPINLOCK=y
  547. +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
  548. +# CONFIG_ARCH_HAS_ILOG2_U32 is not set
  549. +# CONFIG_ARCH_HAS_ILOG2_U64 is not set
  550. +CONFIG_GENERIC_FIND_NEXT_BIT=y
  551. +CONFIG_GENERIC_GPIO=y
  552. +CONFIG_GPIOLIB=y
  553. +CONFIG_GENERIC_HWEIGHT=y
  554. +CONFIG_GENERIC_HARDIRQS=y
  555. +CONFIG_STACKTRACE_SUPPORT=y
  556. +CONFIG_LOCKDEP_SUPPORT=y
  557. +CONFIG_GENERIC_CALIBRATE_DELAY=y
  558. +CONFIG_GENERIC_TIME=y
  559. +CONFIG_TIME_LOW_RES=y
  560. +CONFIG_GENERIC_CLOCKEVENTS=y
  561. +CONFIG_NO_IOPORT=y
  562. +CONFIG_ARCH_SUPPORTS_AOUT=y
  563. +CONFIG_IRQ_PER_CPU=y
  564. +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
  565. +
  566. +#
  567. +# Processor type and features
  568. +#
  569. +CONFIG_BRD_64MB=y
  570. +
  571. +#
  572. +# Processor type will be selected by Board
  573. +#
  574. +CONFIG_UBICOM32_V4=y
  575. +
  576. +#
  577. +# Board
  578. +#
  579. +# CONFIG_NOBOARD is not set
  580. +# CONFIG_IP5170DPF is not set
  581. +# CONFIG_IP5160DEV is not set
  582. +# CONFIG_IP5160EVAL is not set
  583. +# CONFIG_IP7145DPF is not set
  584. +CONFIG_IP7160RGW=y
  585. +# CONFIG_IP7160BRINGUP is not set
  586. +# CONFIG_IP7160DPF is not set
  587. +# CONFIG_IP7500MODULE is not set
  588. +# CONFIG_IP7500AV is not set
  589. +# CONFIG_IP7500MEDIA is not set
  590. +
  591. +#
  592. +# Kernel Options
  593. +#
  594. +# CONFIG_SMP is not set
  595. +CONFIG_TIMER_EXTRA_ALLOC=0
  596. +# CONFIG_IRQSTACKS is not set
  597. +CONFIG_UBICOM32_OCM_MODULES=y
  598. +CONFIG_OCM_MODULES_RESERVATION=41
  599. +CONFIG_OCM_MODULES_MAY_CONSUME_REMAINING_CODESPACE=y
  600. +CONFIG_HZ=100
  601. +
  602. +#
  603. +# RAM configuration
  604. +#
  605. +CONFIG_RAMSIZE=0x04000000
  606. +CONFIG_KERNELBASE=0x40400000
  607. +
  608. +#
  609. +# Build options
  610. +#
  611. +# CONFIG_LINKER_RELAXATION is not set
  612. +
  613. +#
  614. +# Driver options
  615. +#
  616. +
  617. +#
  618. +# PCI Bus
  619. +#
  620. +CONFIG_PCI=y
  621. +# CONFIG_ARCH_SUPPORTS_MSI is not set
  622. +# CONFIG_PCI_LEGACY is not set
  623. +# CONFIG_PCI_DEBUG is not set
  624. +CONFIG_PCI_DEV0_IDSEL=0x001000000
  625. +CONFIG_PCI_DEV1_IDSEL=0x002000000
  626. +
  627. +#
  628. +# Input devices
  629. +#
  630. +CONFIG_UBICOM_INPUT=y
  631. +# CONFIG_UBICOM_INPUT_I2C is not set
  632. +CONFIG_UBICOM_SWITCH=y
  633. +CONFIG_UBICOM_SWITCH_BCM539X=y
  634. +
  635. +#
  636. +# Misc devices
  637. +#
  638. +# CONFIG_UBICOM_HID is not set
  639. +CONFIG_CMDLINE_BOOL=y
  640. +CONFIG_CMDLINE="console=ttyUM0 console=ttyUS0 serdes=0x02004000,61,250000000"
  641. +# CONFIG_CMDLINE_OVERRIDE is not set
  642. +
  643. +#
  644. +# Kernel hacking
  645. +#
  646. +CONFIG_TRACE_IRQFLAGS_SUPPORT=y
  647. +CONFIG_PROTECT_KERNEL=y
  648. +# CONFIG_NO_KERNEL_MSG is not set
  649. +CONFIG_EARLY_PRINTK=y
  650. +# CONFIG_STOP_ON_TRAP is not set
  651. +# CONFIG_STOP_ON_BUG is not set
  652. +# CONFIG_DEBUG_IRQMEASURE is not set
  653. +# CONFIG_DEBUG_PCIMEASURE is not set
  654. +# CONFIG_ACCESS_OK_CHECKS_ENABLED is not set
  655. +CONFIG_UNALIGNED_ACCESS_ENABLED=y
  656. +# CONFIG_UNALIGNED_ACCESS_USERSPACE_ONLY is not set
  657. +# CONFIG_UNALIGNED_ACCESS_DISABLED is not set
  658. +# CONFIG_DEBUG_STACKOVERFLOW is not set
  659. +# CONFIG_DEBUG_STACK_USAGE is not set
  660. +CONFIG_PRINTK_TIME=y
  661. +CONFIG_ENABLE_WARN_DEPRECATED=y
  662. +CONFIG_ENABLE_MUST_CHECK=y
  663. +CONFIG_FRAME_WARN=1024
  664. +# CONFIG_MAGIC_SYSRQ is not set
  665. +# CONFIG_UNUSED_SYMBOLS is not set
  666. +# CONFIG_DEBUG_FS is not set
  667. +# CONFIG_HEADERS_CHECK is not set
  668. +CONFIG_DEBUG_KERNEL=y
  669. +# CONFIG_DEBUG_SHIRQ is not set
  670. +# CONFIG_DETECT_SOFTLOCKUP is not set
  671. +# CONFIG_SCHED_DEBUG is not set
  672. +# CONFIG_SCHEDSTATS is not set
  673. +# CONFIG_TIMER_STATS is not set
  674. +# CONFIG_DEBUG_OBJECTS is not set
  675. +# CONFIG_DEBUG_SLAB is not set
  676. +# CONFIG_DEBUG_SPINLOCK is not set
  677. +# CONFIG_DEBUG_MUTEXES is not set
  678. +# CONFIG_DEBUG_LOCK_ALLOC is not set
  679. +# CONFIG_PROVE_LOCKING is not set
  680. +# CONFIG_LOCK_STAT is not set
  681. +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
  682. +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
  683. +# CONFIG_DEBUG_KOBJECT is not set
  684. +CONFIG_DEBUG_INFO=y
  685. +# CONFIG_DEBUG_VM is not set
  686. +# CONFIG_DEBUG_WRITECOUNT is not set
  687. +# CONFIG_DEBUG_MEMORY_INIT is not set
  688. +# CONFIG_DEBUG_LIST is not set
  689. +# CONFIG_DEBUG_SG is not set
  690. +# CONFIG_FRAME_POINTER is not set
  691. +# CONFIG_BOOT_PRINTK_DELAY is not set
  692. +# CONFIG_RCU_TORTURE_TEST is not set
  693. +# CONFIG_RCU_CPU_STALL_DETECTOR is not set
  694. +# CONFIG_BACKTRACE_SELF_TEST is not set
  695. +# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
  696. +# CONFIG_FAULT_INJECTION is not set
  697. +# CONFIG_SYSCTL_SYSCALL_CHECK is not set
  698. +
  699. +#
  700. +# Tracers
  701. +#
  702. +# CONFIG_IRQSOFF_TRACER is not set
  703. +# CONFIG_SCHED_TRACER is not set
  704. +# CONFIG_CONTEXT_SWITCH_TRACER is not set
  705. +# CONFIG_BOOT_TRACER is not set
  706. +# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
  707. +# CONFIG_SAMPLES is not set
  708. +
  709. +#
  710. +# Executable file formats
  711. +#
  712. +CONFIG_BINFMT_ELF_FDPIC=y
  713. +CONFIG_BINFMT_FLAT=y
  714. +CONFIG_BINFMT_ZFLAT=y
  715. +# CONFIG_BINFMT_SHARED_FLAT is not set
  716. +# CONFIG_HAVE_AOUT is not set
  717. +# CONFIG_BINFMT_MISC is not set
  718. +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
  719. +
  720. +#
  721. +# General setup
  722. +#
  723. +CONFIG_EXPERIMENTAL=y
  724. +CONFIG_BROKEN_ON_SMP=y
  725. +CONFIG_INIT_ENV_ARG_LIMIT=32
  726. +CONFIG_LOCALVERSION=""
  727. +# CONFIG_LOCALVERSION_AUTO is not set
  728. +CONFIG_SYSVIPC=y
  729. +CONFIG_SYSVIPC_SYSCTL=y
  730. +# CONFIG_POSIX_MQUEUE is not set
  731. +# CONFIG_BSD_PROCESS_ACCT is not set
  732. +# CONFIG_TASKSTATS is not set
  733. +# CONFIG_AUDIT is not set
  734. +# CONFIG_IKCONFIG is not set
  735. +CONFIG_LOG_BUF_SHIFT=14
  736. +# CONFIG_CGROUPS is not set
  737. +# CONFIG_GROUP_SCHED is not set
  738. +CONFIG_SYSFS_DEPRECATED=y
  739. +CONFIG_SYSFS_DEPRECATED_V2=y
  740. +# CONFIG_RELAY is not set
  741. +# CONFIG_NAMESPACES is not set
  742. +CONFIG_BLK_DEV_INITRD=y
  743. +CONFIG_INITRAMFS_SOURCE=""
  744. +CONFIG_INITRAMFS_ROOT_UID=0
  745. +CONFIG_INITRAMFS_ROOT_GID=0
  746. +CONFIG_CC_OPTIMIZE_FOR_SIZE=y
  747. +CONFIG_SYSCTL=y
  748. +CONFIG_EMBEDDED=y
  749. +CONFIG_SYSCTL_SYSCALL=y
  750. +# CONFIG_KALLSYMS is not set
  751. +# CONFIG_HOTPLUG is not set
  752. +CONFIG_PRINTK=y
  753. +CONFIG_BUG=y
  754. +# CONFIG_ELF_CORE is not set
  755. +CONFIG_BASE_FULL=y
  756. +# CONFIG_FUTEX is not set
  757. +# CONFIG_EPOLL is not set
  758. +# CONFIG_SIGNALFD is not set
  759. +# CONFIG_TIMERFD is not set
  760. +# CONFIG_EVENTFD is not set
  761. +CONFIG_AIO=y
  762. +# CONFIG_VM_EVENT_COUNTERS is not set
  763. +CONFIG_PCI_QUIRKS=y
  764. +# CONFIG_COMPAT_BRK is not set
  765. +CONFIG_SLAB=y
  766. +# CONFIG_SLUB is not set
  767. +# CONFIG_SLOB is not set
  768. +# CONFIG_PROFILING is not set
  769. +# CONFIG_MARKERS is not set
  770. +CONFIG_HAVE_OPROFILE=y
  771. +# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
  772. +CONFIG_SLABINFO=y
  773. +CONFIG_TINY_SHMEM=y
  774. +CONFIG_BASE_SMALL=0
  775. +CONFIG_MODULES=y
  776. +CONFIG_MODULE_FORCE_LOAD=y
  777. +# CONFIG_MODULE_UNLOAD is not set
  778. +# CONFIG_MODVERSIONS is not set
  779. +# CONFIG_MODULE_SRCVERSION_ALL is not set
  780. +CONFIG_KMOD=y
  781. +CONFIG_BLOCK=y
  782. +# CONFIG_LBD is not set
  783. +# CONFIG_BLK_DEV_IO_TRACE is not set
  784. +# CONFIG_LSF is not set
  785. +# CONFIG_BLK_DEV_BSG is not set
  786. +# CONFIG_BLK_DEV_INTEGRITY is not set
  787. +
  788. +#
  789. +# IO Schedulers
  790. +#
  791. +CONFIG_IOSCHED_NOOP=y
  792. +# CONFIG_IOSCHED_AS is not set
  793. +# CONFIG_IOSCHED_DEADLINE is not set
  794. +# CONFIG_IOSCHED_CFQ is not set
  795. +# CONFIG_DEFAULT_AS is not set
  796. +# CONFIG_DEFAULT_DEADLINE is not set
  797. +# CONFIG_DEFAULT_CFQ is not set
  798. +CONFIG_DEFAULT_NOOP=y
  799. +CONFIG_DEFAULT_IOSCHED="noop"
  800. +CONFIG_CLASSIC_RCU=y
  801. +CONFIG_PREEMPT_NONE=y
  802. +# CONFIG_PREEMPT_VOLUNTARY is not set
  803. +# CONFIG_PREEMPT is not set
  804. +CONFIG_TICK_ONESHOT=y
  805. +CONFIG_NO_HZ=y
  806. +CONFIG_HIGH_RES_TIMERS=y
  807. +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
  808. +CONFIG_SELECT_MEMORY_MODEL=y
  809. +CONFIG_FLATMEM_MANUAL=y
  810. +# CONFIG_DISCONTIGMEM_MANUAL is not set
  811. +# CONFIG_SPARSEMEM_MANUAL is not set
  812. +CONFIG_FLATMEM=y
  813. +CONFIG_FLAT_NODE_MEM_MAP=y
  814. +CONFIG_PAGEFLAGS_EXTENDED=y
  815. +CONFIG_SPLIT_PTLOCK_CPUS=4
  816. +# CONFIG_RESOURCES_64BIT is not set
  817. +# CONFIG_PHYS_ADDR_T_64BIT is not set
  818. +CONFIG_ZONE_DMA_FLAG=1
  819. +CONFIG_VIRT_TO_BUS=y
  820. +CONFIG_NET=y
  821. +
  822. +#
  823. +# Networking options
  824. +#
  825. +CONFIG_PACKET=y
  826. +# CONFIG_PACKET_MMAP is not set
  827. +CONFIG_UNIX=y
  828. +# CONFIG_NET_KEY is not set
  829. +CONFIG_INET=y
  830. +CONFIG_IP_MULTICAST=y
  831. +CONFIG_IP_ADVANCED_ROUTER=y
  832. +CONFIG_ASK_IP_FIB_HASH=y
  833. +# CONFIG_IP_FIB_TRIE is not set
  834. +CONFIG_IP_FIB_HASH=y
  835. +# CONFIG_IP_MULTIPLE_TABLES is not set
  836. +# CONFIG_IP_ROUTE_MULTIPATH is not set
  837. +CONFIG_IP_ROUTE_VERBOSE=y
  838. +CONFIG_IP_PNP=y
  839. +CONFIG_IP_PNP_DHCP=y
  840. +CONFIG_IP_PNP_BOOTP=y
  841. +CONFIG_IP_PNP_RARP=y
  842. +CONFIG_NET_IPIP=y
  843. +CONFIG_NET_IPGRE=y
  844. +# CONFIG_NET_IPGRE_BROADCAST is not set
  845. +# CONFIG_IP_MROUTE is not set
  846. +# CONFIG_ARPD is not set
  847. +# CONFIG_SYN_COOKIES is not set
  848. +# CONFIG_INET_AH is not set
  849. +# CONFIG_INET_ESP is not set
  850. +# CONFIG_INET_IPCOMP is not set
  851. +# CONFIG_INET_XFRM_TUNNEL is not set
  852. +CONFIG_INET_TUNNEL=y
  853. +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
  854. +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
  855. +# CONFIG_INET_XFRM_MODE_BEET is not set
  856. +# CONFIG_INET_LRO is not set
  857. +CONFIG_INET_DIAG=y
  858. +CONFIG_INET_TCP_DIAG=y
  859. +# CONFIG_TCP_CONG_ADVANCED is not set
  860. +CONFIG_TCP_CONG_CUBIC=y
  861. +CONFIG_DEFAULT_TCP_CONG="cubic"
  862. +# CONFIG_TCP_MD5SIG is not set
  863. +# CONFIG_IPV6 is not set
  864. +# CONFIG_NETWORK_SECMARK is not set
  865. +CONFIG_NETFILTER=y
  866. +# CONFIG_NETFILTER_DEBUG is not set
  867. +CONFIG_NETFILTER_ADVANCED=y
  868. +# CONFIG_BRIDGE_NETFILTER is not set
  869. +
  870. +#
  871. +# Core Netfilter Configuration
  872. +#
  873. +# CONFIG_NETFILTER_NETLINK_QUEUE is not set
  874. +# CONFIG_NETFILTER_NETLINK_LOG is not set
  875. +CONFIG_NF_CONNTRACK=y
  876. +# CONFIG_NF_CT_ACCT is not set
  877. +# CONFIG_NF_CONNTRACK_MARK is not set
  878. +# CONFIG_NF_CONNTRACK_EVENTS is not set
  879. +# CONFIG_NF_CT_PROTO_DCCP is not set
  880. +CONFIG_NF_CT_PROTO_GRE=y
  881. +# CONFIG_NF_CT_PROTO_SCTP is not set
  882. +# CONFIG_NF_CT_PROTO_UDPLITE is not set
  883. +# CONFIG_NF_CONNTRACK_AMANDA is not set
  884. +# CONFIG_NF_CONNTRACK_FTP is not set
  885. +# CONFIG_NF_CONNTRACK_H323 is not set
  886. +# CONFIG_NF_CONNTRACK_IRC is not set
  887. +# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set
  888. +CONFIG_NF_CONNTRACK_PPTP=y
  889. +# CONFIG_NF_CONNTRACK_SANE is not set
  890. +# CONFIG_NF_CONNTRACK_SIP is not set
  891. +# CONFIG_NF_CONNTRACK_TFTP is not set
  892. +# CONFIG_NF_CT_NETLINK is not set
  893. +# CONFIG_NETFILTER_TPROXY is not set
  894. +CONFIG_NETFILTER_XTABLES=y
  895. +# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set
  896. +# CONFIG_NETFILTER_XT_TARGET_CONNMARK is not set
  897. +# CONFIG_NETFILTER_XT_TARGET_DSCP is not set
  898. +# CONFIG_NETFILTER_XT_TARGET_MARK is not set
  899. +# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set
  900. +# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set
  901. +# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set
  902. +CONFIG_NETFILTER_XT_TARGET_TCPMSS=y
  903. +# CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set
  904. +# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set
  905. +# CONFIG_NETFILTER_XT_MATCH_CONNBYTES is not set
  906. +# CONFIG_NETFILTER_XT_MATCH_CONNLIMIT is not set
  907. +# CONFIG_NETFILTER_XT_MATCH_CONNMARK is not set
  908. +# CONFIG_NETFILTER_XT_MATCH_CONNTRACK is not set
  909. +# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
  910. +# CONFIG_NETFILTER_XT_MATCH_DSCP is not set
  911. +CONFIG_NETFILTER_XT_MATCH_ESP=y
  912. +# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
  913. +# CONFIG_NETFILTER_XT_MATCH_HELPER is not set
  914. +CONFIG_NETFILTER_XT_MATCH_IPRANGE=y
  915. +# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set
  916. +CONFIG_NETFILTER_XT_MATCH_LIMIT=y
  917. +CONFIG_NETFILTER_XT_MATCH_MAC=y
  918. +# CONFIG_NETFILTER_XT_MATCH_MARK is not set
  919. +CONFIG_NETFILTER_XT_MATCH_MULTIPORT=y
  920. +# CONFIG_NETFILTER_XT_MATCH_OWNER is not set
  921. +# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set
  922. +# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set
  923. +# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set
  924. +# CONFIG_NETFILTER_XT_MATCH_REALM is not set
  925. +# CONFIG_NETFILTER_XT_MATCH_RECENT is not set
  926. +# CONFIG_NETFILTER_XT_MATCH_SCTP is not set
  927. +CONFIG_NETFILTER_XT_MATCH_STATE=y
  928. +# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
  929. +CONFIG_NETFILTER_XT_MATCH_STRING=y
  930. +CONFIG_NETFILTER_XT_MATCH_TCPMSS=y
  931. +# CONFIG_NETFILTER_XT_MATCH_TIME is not set
  932. +# CONFIG_NETFILTER_XT_MATCH_U32 is not set
  933. +# CONFIG_IP_VS is not set
  934. +
  935. +#
  936. +# IP: Netfilter Configuration
  937. +#
  938. +CONFIG_NF_DEFRAG_IPV4=y
  939. +CONFIG_NF_CONNTRACK_IPV4=y
  940. +CONFIG_NF_CONNTRACK_PROC_COMPAT=y
  941. +# CONFIG_IP_NF_QUEUE is not set
  942. +CONFIG_IP_NF_IPTABLES=y
  943. +# CONFIG_IP_NF_MATCH_ADDRTYPE is not set
  944. +CONFIG_IP_NF_MATCH_AH=y
  945. +# CONFIG_IP_NF_MATCH_ECN is not set
  946. +CONFIG_IP_NF_MATCH_TTL=y
  947. +CONFIG_IP_NF_FILTER=y
  948. +CONFIG_IP_NF_TARGET_REJECT=y
  949. +CONFIG_IP_NF_TARGET_LOG=y
  950. +# CONFIG_IP_NF_TARGET_ULOG is not set
  951. +# CONFIG_NF_QOS_UBICOM_STREAMENGINE_DEFAULT_CLASSIFIER is not set
  952. +CONFIG_NF_NAT=y
  953. +CONFIG_NF_NAT_NEEDED=y
  954. +CONFIG_IP_NF_TARGET_MASQUERADE=y
  955. +CONFIG_IP_NF_TARGET_NETMAP=y
  956. +CONFIG_IP_NF_TARGET_REDIRECT=y
  957. +CONFIG_NF_NAT_SNMP_BASIC=y
  958. +CONFIG_NF_NAT_PROTO_GRE=y
  959. +# CONFIG_NF_NAT_FTP is not set
  960. +# CONFIG_NF_NAT_IRC is not set
  961. +# CONFIG_NF_NAT_TFTP is not set
  962. +# CONFIG_NF_NAT_AMANDA is not set
  963. +CONFIG_NF_NAT_PPTP=y
  964. +# CONFIG_NF_NAT_H323 is not set
  965. +# CONFIG_NF_NAT_SIP is not set
  966. +CONFIG_IP_NF_MANGLE=y
  967. +# CONFIG_IP_NF_TARGET_CLUSTERIP is not set
  968. +# CONFIG_IP_NF_TARGET_ECN is not set
  969. +CONFIG_IP_NF_TARGET_TTL=y
  970. +# CONFIG_IP_NF_RAW is not set
  971. +# CONFIG_IP_NF_ARPTABLES is not set
  972. +# CONFIG_IP_DCCP is not set
  973. +# CONFIG_IP_SCTP is not set
  974. +# CONFIG_TIPC is not set
  975. +# CONFIG_ATM is not set
  976. +CONFIG_STP=y
  977. +CONFIG_BRIDGE=y
  978. +# CONFIG_NET_DSA is not set
  979. +CONFIG_VLAN_8021Q=y
  980. +# CONFIG_VLAN_8021Q_GVRP is not set
  981. +# CONFIG_DECNET is not set
  982. +CONFIG_LLC=y
  983. +# CONFIG_LLC2 is not set
  984. +# CONFIG_IPX is not set
  985. +# CONFIG_ATALK is not set
  986. +# CONFIG_X25 is not set
  987. +# CONFIG_LAPB is not set
  988. +# CONFIG_ECONET is not set
  989. +# CONFIG_WAN_ROUTER is not set
  990. +# CONFIG_NET_SCHED is not set
  991. +
  992. +#
  993. +# Network testing
  994. +#
  995. +# CONFIG_NET_PKTGEN is not set
  996. +# CONFIG_HAMRADIO is not set
  997. +# CONFIG_CAN is not set
  998. +# CONFIG_IRDA is not set
  999. +# CONFIG_BT is not set
  1000. +# CONFIG_AF_RXRPC is not set
  1001. +# CONFIG_PHONET is not set
  1002. +CONFIG_WIRELESS=y
  1003. +# CONFIG_CFG80211 is not set
  1004. +# CONFIG_WIRELESS_OLD_REGULATORY is not set
  1005. +CONFIG_WIRELESS_EXT=y
  1006. +CONFIG_WIRELESS_EXT_SYSFS=y
  1007. +# CONFIG_MAC80211 is not set
  1008. +# CONFIG_IEEE80211 is not set
  1009. +# CONFIG_RFKILL is not set
  1010. +# CONFIG_NET_9P is not set
  1011. +
  1012. +#
  1013. +# Device Drivers
  1014. +#
  1015. +
  1016. +#
  1017. +# Generic Driver Options
  1018. +#
  1019. +CONFIG_STANDALONE=y
  1020. +CONFIG_PREVENT_FIRMWARE_BUILD=y
  1021. +# CONFIG_DEBUG_DRIVER is not set
  1022. +# CONFIG_DEBUG_DEVRES is not set
  1023. +# CONFIG_SYS_HYPERVISOR is not set
  1024. +# CONFIG_CONNECTOR is not set
  1025. +CONFIG_MTD=y
  1026. +# CONFIG_MTD_DEBUG is not set
  1027. +# CONFIG_MTD_CONCAT is not set
  1028. +CONFIG_MTD_PARTITIONS=y
  1029. +# CONFIG_MTD_REDBOOT_PARTS is not set
  1030. +CONFIG_MTD_CMDLINE_PARTS=y
  1031. +# CONFIG_MTD_AR7_PARTS is not set
  1032. +
  1033. +#
  1034. +# User Modules And Translation Layers
  1035. +#
  1036. +CONFIG_MTD_CHAR=y
  1037. +CONFIG_MTD_BLKDEVS=y
  1038. +CONFIG_MTD_BLOCK=y
  1039. +# CONFIG_FTL is not set
  1040. +# CONFIG_NFTL is not set
  1041. +# CONFIG_INFTL is not set
  1042. +# CONFIG_RFD_FTL is not set
  1043. +# CONFIG_SSFDC is not set
  1044. +# CONFIG_MTD_OOPS is not set
  1045. +
  1046. +#
  1047. +# RAM/ROM/Flash chip drivers
  1048. +#
  1049. +# CONFIG_MTD_CFI is not set
  1050. +# CONFIG_MTD_JEDECPROBE is not set
  1051. +CONFIG_MTD_MAP_BANK_WIDTH_1=y
  1052. +CONFIG_MTD_MAP_BANK_WIDTH_2=y
  1053. +CONFIG_MTD_MAP_BANK_WIDTH_4=y
  1054. +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
  1055. +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
  1056. +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
  1057. +CONFIG_MTD_CFI_I1=y
  1058. +CONFIG_MTD_CFI_I2=y
  1059. +# CONFIG_MTD_CFI_I4 is not set
  1060. +# CONFIG_MTD_CFI_I8 is not set
  1061. +# CONFIG_MTD_RAM is not set
  1062. +# CONFIG_MTD_ROM is not set
  1063. +# CONFIG_MTD_ABSENT is not set
  1064. +
  1065. +#
  1066. +# Mapping drivers for chip access
  1067. +#
  1068. +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
  1069. +# CONFIG_MTD_INTEL_VR_NOR is not set
  1070. +# CONFIG_MTD_PLATRAM is not set
  1071. +
  1072. +#
  1073. +# Self-contained MTD device drivers
  1074. +#
  1075. +# CONFIG_MTD_PMC551 is not set
  1076. +# CONFIG_MTD_DATAFLASH is not set
  1077. +# CONFIG_MTD_M25P80 is not set
  1078. +CONFIG_MTD_UBI32_M25P80=y
  1079. +# CONFIG_MTD_SLRAM is not set
  1080. +# CONFIG_MTD_PHRAM is not set
  1081. +# CONFIG_MTD_MTDRAM is not set
  1082. +# CONFIG_MTD_BLOCK2MTD is not set
  1083. +
  1084. +#
  1085. +# Disk-On-Chip Device Drivers
  1086. +#
  1087. +# CONFIG_MTD_DOC2000 is not set
  1088. +# CONFIG_MTD_DOC2001 is not set
  1089. +# CONFIG_MTD_DOC2001PLUS is not set
  1090. +# CONFIG_MTD_NAND is not set
  1091. +# CONFIG_MTD_ONENAND is not set
  1092. +
  1093. +#
  1094. +# UBI - Unsorted block images
  1095. +#
  1096. +# CONFIG_MTD_UBI is not set
  1097. +# CONFIG_PARPORT is not set
  1098. +CONFIG_BLK_DEV=y
  1099. +# CONFIG_BLK_CPQ_DA is not set
  1100. +# CONFIG_BLK_CPQ_CISS_DA is not set
  1101. +# CONFIG_BLK_DEV_DAC960 is not set
  1102. +# CONFIG_BLK_DEV_UMEM is not set
  1103. +# CONFIG_BLK_DEV_COW_COMMON is not set
  1104. +# CONFIG_BLK_DEV_LOOP is not set
  1105. +# CONFIG_BLK_DEV_NBD is not set
  1106. +# CONFIG_BLK_DEV_SX8 is not set
  1107. +# CONFIG_BLK_DEV_UB is not set
  1108. +CONFIG_BLK_DEV_RAM=y
  1109. +CONFIG_BLK_DEV_RAM_COUNT=16
  1110. +CONFIG_BLK_DEV_RAM_SIZE=4096
  1111. +# CONFIG_BLK_DEV_XIP is not set
  1112. +# CONFIG_CDROM_PKTCDVD is not set
  1113. +# CONFIG_ATA_OVER_ETH is not set
  1114. +# CONFIG_MISC_DEVICES is not set
  1115. +
  1116. +#
  1117. +# SCSI device support
  1118. +#
  1119. +# CONFIG_RAID_ATTRS is not set
  1120. +CONFIG_SCSI=y
  1121. +CONFIG_SCSI_DMA=y
  1122. +# CONFIG_SCSI_TGT is not set
  1123. +# CONFIG_SCSI_NETLINK is not set
  1124. +CONFIG_SCSI_PROC_FS=y
  1125. +
  1126. +#
  1127. +# SCSI support type (disk, tape, CD-ROM)
  1128. +#
  1129. +CONFIG_BLK_DEV_SD=y
  1130. +# CONFIG_CHR_DEV_ST is not set
  1131. +# CONFIG_CHR_DEV_OSST is not set
  1132. +# CONFIG_BLK_DEV_SR is not set
  1133. +CONFIG_CHR_DEV_SG=y
  1134. +# CONFIG_CHR_DEV_SCH is not set
  1135. +
  1136. +#
  1137. +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
  1138. +#
  1139. +CONFIG_SCSI_MULTI_LUN=y
  1140. +# CONFIG_SCSI_CONSTANTS is not set
  1141. +# CONFIG_SCSI_LOGGING is not set
  1142. +# CONFIG_SCSI_SCAN_ASYNC is not set
  1143. +CONFIG_SCSI_WAIT_SCAN=m
  1144. +
  1145. +#
  1146. +# SCSI Transports
  1147. +#
  1148. +# CONFIG_SCSI_SPI_ATTRS is not set
  1149. +# CONFIG_SCSI_FC_ATTRS is not set
  1150. +# CONFIG_SCSI_ISCSI_ATTRS is not set
  1151. +# CONFIG_SCSI_SAS_LIBSAS is not set
  1152. +# CONFIG_SCSI_SRP_ATTRS is not set
  1153. +# CONFIG_SCSI_LOWLEVEL is not set
  1154. +# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
  1155. +# CONFIG_SCSI_DH is not set
  1156. +# CONFIG_ATA is not set
  1157. +# CONFIG_MD is not set
  1158. +# CONFIG_FUSION is not set
  1159. +
  1160. +#
  1161. +# IEEE 1394 (FireWire) support
  1162. +#
  1163. +
  1164. +#
  1165. +# Enable only one of the two stacks, unless you know what you are doing
  1166. +#
  1167. +# CONFIG_FIREWIRE is not set
  1168. +# CONFIG_IEEE1394 is not set
  1169. +# CONFIG_I2O is not set
  1170. +CONFIG_NETDEVICES=y
  1171. +# CONFIG_DUMMY is not set
  1172. +# CONFIG_BONDING is not set
  1173. +# CONFIG_MACVLAN is not set
  1174. +# CONFIG_EQUALIZER is not set
  1175. +# CONFIG_TUN is not set
  1176. +# CONFIG_VETH is not set
  1177. +# CONFIG_ARCNET is not set
  1178. +# CONFIG_NET_ETHERNET is not set
  1179. +CONFIG_MII=y
  1180. +CONFIG_NETDEV_1000=y
  1181. +# CONFIG_ACENIC is not set
  1182. +# CONFIG_DL2K is not set
  1183. +# CONFIG_E1000 is not set
  1184. +# CONFIG_E1000E is not set
  1185. +# CONFIG_IP1000 is not set
  1186. +# CONFIG_IGB is not set
  1187. +# CONFIG_NS83820 is not set
  1188. +# CONFIG_HAMACHI is not set
  1189. +# CONFIG_YELLOWFIN is not set
  1190. +# CONFIG_R8169 is not set
  1191. +# CONFIG_SIS190 is not set
  1192. +# CONFIG_SKGE is not set
  1193. +# CONFIG_SKY2 is not set
  1194. +# CONFIG_VIA_VELOCITY is not set
  1195. +# CONFIG_TIGON3 is not set
  1196. +# CONFIG_BNX2 is not set
  1197. +# CONFIG_QLA3XXX is not set
  1198. +# CONFIG_ATL1 is not set
  1199. +# CONFIG_ATL1E is not set
  1200. +# CONFIG_JME is not set
  1201. +CONFIG_UBICOM32_GMAC=y
  1202. +CONFIG_UBICOM32_NAPI=y
  1203. +CONFIG_UBICOM32_OCM_FOR_SKB=y
  1204. +# CONFIG_NETDEV_10000 is not set
  1205. +# CONFIG_TR is not set
  1206. +
  1207. +#
  1208. +# Wireless LAN
  1209. +#
  1210. +# CONFIG_WLAN_PRE80211 is not set
  1211. +# CONFIG_WLAN_80211 is not set
  1212. +# CONFIG_IWLWIFI_LEDS is not set
  1213. +
  1214. +#
  1215. +# USB Network Adapters
  1216. +#
  1217. +# CONFIG_USB_CATC is not set
  1218. +# CONFIG_USB_KAWETH is not set
  1219. +# CONFIG_USB_PEGASUS is not set
  1220. +# CONFIG_USB_RTL8150 is not set
  1221. +CONFIG_USB_USBNET=y
  1222. +CONFIG_USB_NET_AX8817X=y
  1223. +CONFIG_USB_NET_CDCETHER=y
  1224. +# CONFIG_USB_NET_DM9601 is not set
  1225. +# CONFIG_USB_NET_SMSC95XX is not set
  1226. +# CONFIG_USB_NET_GL620A is not set
  1227. +# CONFIG_USB_NET_NET1080 is not set
  1228. +# CONFIG_USB_NET_PLUSB is not set
  1229. +# CONFIG_USB_NET_MCS7830 is not set
  1230. +# CONFIG_USB_NET_RNDIS_HOST is not set
  1231. +# CONFIG_USB_NET_CDC_SUBSET is not set
  1232. +# CONFIG_USB_NET_ZAURUS is not set
  1233. +# CONFIG_WAN is not set
  1234. +# CONFIG_FDDI is not set
  1235. +# CONFIG_HIPPI is not set
  1236. +CONFIG_PPP=y
  1237. +# CONFIG_PPP_MULTILINK is not set
  1238. +# CONFIG_PPP_FILTER is not set
  1239. +CONFIG_PPP_ASYNC=y
  1240. +# CONFIG_PPP_SYNC_TTY is not set
  1241. +# CONFIG_PPP_DEFLATE is not set
  1242. +# CONFIG_PPP_BSDCOMP is not set
  1243. +# CONFIG_PPP_MPPE is not set
  1244. +# CONFIG_PPPOE is not set
  1245. +# CONFIG_PPPOL2TP is not set
  1246. +# CONFIG_SLIP is not set
  1247. +CONFIG_SLHC=y
  1248. +# CONFIG_NET_FC is not set
  1249. +# CONFIG_NETCONSOLE is not set
  1250. +# CONFIG_NETPOLL is not set
  1251. +# CONFIG_NET_POLL_CONTROLLER is not set
  1252. +# CONFIG_ISDN is not set
  1253. +# CONFIG_PHONE is not set
  1254. +
  1255. +#
  1256. +# Input device support
  1257. +#
  1258. +CONFIG_INPUT=y
  1259. +# CONFIG_INPUT_FF_MEMLESS is not set
  1260. +CONFIG_INPUT_POLLDEV=y
  1261. +
  1262. +#
  1263. +# Userland interfaces
  1264. +#
  1265. +# CONFIG_INPUT_MOUSEDEV is not set
  1266. +# CONFIG_INPUT_JOYDEV is not set
  1267. +# CONFIG_INPUT_EVDEV is not set
  1268. +# CONFIG_INPUT_EVBUG is not set
  1269. +
  1270. +#
  1271. +# Input Device Drivers
  1272. +#
  1273. +# CONFIG_INPUT_KEYBOARD is not set
  1274. +# CONFIG_INPUT_MOUSE is not set
  1275. +# CONFIG_INPUT_JOYSTICK is not set
  1276. +# CONFIG_INPUT_TABLET is not set
  1277. +# CONFIG_INPUT_TOUCHSCREEN is not set
  1278. +# CONFIG_INPUT_MISC is not set
  1279. +
  1280. +#
  1281. +# Hardware I/O ports
  1282. +#
  1283. +# CONFIG_SERIO is not set
  1284. +# CONFIG_GAMEPORT is not set
  1285. +
  1286. +#
  1287. +# Character devices
  1288. +#
  1289. +# CONFIG_VT is not set
  1290. +CONFIG_DEVKMEM=y
  1291. +# CONFIG_SERIAL_NONSTANDARD is not set
  1292. +# CONFIG_NOZOMI is not set
  1293. +
  1294. +#
  1295. +# Serial drivers
  1296. +#
  1297. +# CONFIG_SERIAL_8250 is not set
  1298. +
  1299. +#
  1300. +# Non-8250 serial port support
  1301. +#
  1302. +# CONFIG_SERIAL_UBI32_SERDES is not set
  1303. +CONFIG_SERIAL_UBI32_MAILBOX=y
  1304. +CONFIG_SERIAL_UBI32_MAILBOX_CONSOLE=y
  1305. +CONFIG_SERIAL_CORE=y
  1306. +CONFIG_SERIAL_CORE_CONSOLE=y
  1307. +# CONFIG_SERIAL_JSM is not set
  1308. +CONFIG_UNIX98_PTYS=y
  1309. +CONFIG_LEGACY_PTYS=y
  1310. +CONFIG_LEGACY_PTY_COUNT=256
  1311. +# CONFIG_IPMI_HANDLER is not set
  1312. +CONFIG_HW_RANDOM=y
  1313. +CONFIG_HW_RANDOM_UBICOM32=y
  1314. +# CONFIG_RTC is not set
  1315. +# CONFIG_GEN_RTC is not set
  1316. +# CONFIG_R3964 is not set
  1317. +# CONFIG_APPLICOM is not set
  1318. +# CONFIG_RAW_DRIVER is not set
  1319. +# CONFIG_TCG_TPM is not set
  1320. +CONFIG_DEVPORT=y
  1321. +# CONFIG_I2C is not set
  1322. +CONFIG_SPI=y
  1323. +# CONFIG_SPI_DEBUG is not set
  1324. +CONFIG_SPI_MASTER=y
  1325. +
  1326. +#
  1327. +# SPI Master Controller Drivers
  1328. +#
  1329. +CONFIG_SPI_BITBANG=y
  1330. +CONFIG_SPI_UBICOM32_GPIO=y
  1331. +
  1332. +#
  1333. +# SPI Protocol Masters
  1334. +#
  1335. +# CONFIG_SPI_AT25 is not set
  1336. +# CONFIG_SPI_SPIDEV is not set
  1337. +# CONFIG_SPI_TLE62X0 is not set
  1338. +# CONFIG_DEBUG_GPIO is not set
  1339. +# CONFIG_GPIO_SYSFS is not set
  1340. +
  1341. +#
  1342. +# Memory mapped GPIO expanders:
  1343. +#
  1344. +
  1345. +#
  1346. +# I2C GPIO expanders:
  1347. +#
  1348. +
  1349. +#
  1350. +# PCI GPIO expanders:
  1351. +#
  1352. +# CONFIG_GPIO_BT8XX is not set
  1353. +
  1354. +#
  1355. +# SPI GPIO expanders:
  1356. +#
  1357. +# CONFIG_GPIO_MAX7301 is not set
  1358. +# CONFIG_GPIO_MCP23S08 is not set
  1359. +# CONFIG_W1 is not set
  1360. +# CONFIG_POWER_SUPPLY is not set
  1361. +# CONFIG_HWMON is not set
  1362. +# CONFIG_THERMAL is not set
  1363. +# CONFIG_THERMAL_HWMON is not set
  1364. +CONFIG_WATCHDOG=y
  1365. +# CONFIG_WATCHDOG_NOWAYOUT is not set
  1366. +
  1367. +#
  1368. +# Watchdog Device Drivers
  1369. +#
  1370. +# CONFIG_SOFT_WATCHDOG is not set
  1371. +# CONFIG_ALIM7101_WDT is not set
  1372. +CONFIG_UBI32_WDT=y
  1373. +
  1374. +#
  1375. +# PCI-based Watchdog Cards
  1376. +#
  1377. +# CONFIG_PCIPCWATCHDOG is not set
  1378. +# CONFIG_WDTPCI is not set
  1379. +
  1380. +#
  1381. +# USB-based Watchdog Cards
  1382. +#
  1383. +# CONFIG_USBPCWATCHDOG is not set
  1384. +CONFIG_SSB_POSSIBLE=y
  1385. +
  1386. +#
  1387. +# Sonics Silicon Backplane
  1388. +#
  1389. +# CONFIG_SSB is not set
  1390. +
  1391. +#
  1392. +# Multifunction device drivers
  1393. +#
  1394. +# CONFIG_MFD_CORE is not set
  1395. +# CONFIG_MFD_SM501 is not set
  1396. +# CONFIG_HTC_PASIC3 is not set
  1397. +# CONFIG_MFD_TMIO is not set
  1398. +# CONFIG_REGULATOR is not set
  1399. +
  1400. +#
  1401. +# Multimedia devices
  1402. +#
  1403. +
  1404. +#
  1405. +# Multimedia core support
  1406. +#
  1407. +# CONFIG_VIDEO_DEV is not set
  1408. +# CONFIG_DVB_CORE is not set
  1409. +# CONFIG_VIDEO_MEDIA is not set
  1410. +
  1411. +#
  1412. +# Multimedia drivers
  1413. +#
  1414. +# CONFIG_DAB is not set
  1415. +
  1416. +#
  1417. +# Graphics support
  1418. +#
  1419. +# CONFIG_VGASTATE is not set
  1420. +# CONFIG_VIDEO_OUTPUT_CONTROL is not set
  1421. +# CONFIG_FB is not set
  1422. +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
  1423. +
  1424. +#
  1425. +# Display device support
  1426. +#
  1427. +# CONFIG_DISPLAY_SUPPORT is not set
  1428. +# CONFIG_SOUND is not set
  1429. +# CONFIG_HID_SUPPORT is not set
  1430. +CONFIG_USB_SUPPORT=y
  1431. +CONFIG_USB_ARCH_HAS_HCD=y
  1432. +CONFIG_USB_ARCH_HAS_OHCI=y
  1433. +CONFIG_USB_ARCH_HAS_EHCI=y
  1434. +CONFIG_USB=y
  1435. +# CONFIG_USB_DEBUG is not set
  1436. +# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
  1437. +
  1438. +#
  1439. +# Miscellaneous USB options
  1440. +#
  1441. +CONFIG_USB_DEVICEFS=y
  1442. +# CONFIG_USB_DEVICE_CLASS is not set
  1443. +# CONFIG_USB_DYNAMIC_MINORS is not set
  1444. +# CONFIG_USB_OTG is not set
  1445. +# CONFIG_USB_OTG_WHITELIST is not set
  1446. +# CONFIG_USB_OTG_BLACKLIST_HUB is not set
  1447. +# CONFIG_USB_MON is not set
  1448. +# CONFIG_USB_WUSB is not set
  1449. +# CONFIG_USB_WUSB_CBAF is not set
  1450. +
  1451. +#
  1452. +# USB Host Controller Drivers
  1453. +#
  1454. +# CONFIG_USB_C67X00_HCD is not set
  1455. +# CONFIG_USB_EHCI_HCD is not set
  1456. +# CONFIG_USB_ISP116X_HCD is not set
  1457. +# CONFIG_USB_ISP1760_HCD is not set
  1458. +# CONFIG_USB_OHCI_HCD is not set
  1459. +# CONFIG_USB_UHCI_HCD is not set
  1460. +# CONFIG_USB_SL811_HCD is not set
  1461. +# CONFIG_USB_R8A66597_HCD is not set
  1462. +# CONFIG_USB_WHCI_HCD is not set
  1463. +# CONFIG_USB_HWA_HCD is not set
  1464. +CONFIG_USB_MUSB_HDRC=y
  1465. +# CONFIG_USB_TUSB6010 is not set
  1466. +CONFIG_USB_MUSB_HOST=y
  1467. +# CONFIG_USB_MUSB_PERIPHERAL is not set
  1468. +# CONFIG_USB_MUSB_OTG is not set
  1469. +CONFIG_USB_MUSB_HDRC_HCD=y
  1470. +CONFIG_MUSB_PIO_ONLY=y
  1471. +# CONFIG_USB_MUSB_DEBUG is not set
  1472. +
  1473. +#
  1474. +# USB Device Class drivers
  1475. +#
  1476. +# CONFIG_USB_ACM is not set
  1477. +# CONFIG_USB_PRINTER is not set
  1478. +# CONFIG_USB_WDM is not set
  1479. +# CONFIG_USB_TMC is not set
  1480. +
  1481. +#
  1482. +# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
  1483. +#
  1484. +
  1485. +#
  1486. +# see USB_STORAGE Help for more information
  1487. +#
  1488. +CONFIG_USB_STORAGE=y
  1489. +# CONFIG_USB_STORAGE_DEBUG is not set
  1490. +# CONFIG_USB_STORAGE_DATAFAB is not set
  1491. +# CONFIG_USB_STORAGE_FREECOM is not set
  1492. +# CONFIG_USB_STORAGE_ISD200 is not set
  1493. +# CONFIG_USB_STORAGE_DPCM is not set
  1494. +# CONFIG_USB_STORAGE_USBAT is not set
  1495. +# CONFIG_USB_STORAGE_SDDR09 is not set
  1496. +# CONFIG_USB_STORAGE_SDDR55 is not set
  1497. +# CONFIG_USB_STORAGE_JUMPSHOT is not set
  1498. +# CONFIG_USB_STORAGE_ALAUDA is not set
  1499. +# CONFIG_USB_STORAGE_ONETOUCH is not set
  1500. +# CONFIG_USB_STORAGE_KARMA is not set
  1501. +# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
  1502. +CONFIG_USB_LIBUSUAL=y
  1503. +
  1504. +#
  1505. +# USB Imaging devices
  1506. +#
  1507. +# CONFIG_USB_MDC800 is not set
  1508. +# CONFIG_USB_MICROTEK is not set
  1509. +
  1510. +#
  1511. +# USB port drivers
  1512. +#
  1513. +# CONFIG_USB_SERIAL is not set
  1514. +
  1515. +#
  1516. +# USB Miscellaneous drivers
  1517. +#
  1518. +# CONFIG_USB_EMI62 is not set
  1519. +# CONFIG_USB_EMI26 is not set
  1520. +# CONFIG_USB_ADUTUX is not set
  1521. +# CONFIG_USB_SEVSEG is not set
  1522. +# CONFIG_USB_RIO500 is not set
  1523. +# CONFIG_USB_LEGOTOWER is not set
  1524. +# CONFIG_USB_LCD is not set
  1525. +# CONFIG_USB_BERRY_CHARGE is not set
  1526. +# CONFIG_USB_LED is not set
  1527. +# CONFIG_USB_CYPRESS_CY7C63 is not set
  1528. +# CONFIG_USB_CYTHERM is not set
  1529. +# CONFIG_USB_PHIDGET is not set
  1530. +# CONFIG_USB_IDMOUSE is not set
  1531. +# CONFIG_USB_FTDI_ELAN is not set
  1532. +# CONFIG_USB_APPLEDISPLAY is not set
  1533. +# CONFIG_USB_LD is not set
  1534. +# CONFIG_USB_TRANCEVIBRATOR is not set
  1535. +# CONFIG_USB_IOWARRIOR is not set
  1536. +# CONFIG_USB_TEST is not set
  1537. +# CONFIG_USB_ISIGHTFW is not set
  1538. +# CONFIG_USB_VST is not set
  1539. +# CONFIG_USB_GADGET is not set
  1540. +# CONFIG_UWB is not set
  1541. +# CONFIG_MMC is not set
  1542. +# CONFIG_MEMSTICK is not set
  1543. +CONFIG_NEW_LEDS=y
  1544. +CONFIG_LEDS_CLASS=y
  1545. +
  1546. +#
  1547. +# LED drivers
  1548. +#
  1549. +CONFIG_LEDS_GPIO=y
  1550. +
  1551. +#
  1552. +# LED Triggers
  1553. +#
  1554. +# CONFIG_LEDS_TRIGGERS is not set
  1555. +# CONFIG_ACCESSIBILITY is not set
  1556. +# CONFIG_INFINIBAND is not set
  1557. +# CONFIG_RTC_CLASS is not set
  1558. +# CONFIG_DMADEVICES is not set
  1559. +# CONFIG_UIO is not set
  1560. +# CONFIG_STAGING is not set
  1561. +
  1562. +#
  1563. +# File systems
  1564. +#
  1565. +# CONFIG_EXT2_FS is not set
  1566. +# CONFIG_EXT3_FS is not set
  1567. +# CONFIG_EXT4_FS is not set
  1568. +# CONFIG_REISERFS_FS is not set
  1569. +# CONFIG_JFS_FS is not set
  1570. +# CONFIG_FS_POSIX_ACL is not set
  1571. +CONFIG_FILE_LOCKING=y
  1572. +# CONFIG_XFS_FS is not set
  1573. +# CONFIG_OCFS2_FS is not set
  1574. +# CONFIG_DNOTIFY is not set
  1575. +# CONFIG_INOTIFY is not set
  1576. +# CONFIG_QUOTA is not set
  1577. +CONFIG_AUTOFS_FS=y
  1578. +# CONFIG_AUTOFS4_FS is not set
  1579. +# CONFIG_FUSE_FS is not set
  1580. +
  1581. +#
  1582. +# CD-ROM/DVD Filesystems
  1583. +#
  1584. +# CONFIG_ISO9660_FS is not set
  1585. +# CONFIG_UDF_FS is not set
  1586. +
  1587. +#
  1588. +# DOS/FAT/NT Filesystems
  1589. +#
  1590. +CONFIG_FAT_FS=y
  1591. +CONFIG_MSDOS_FS=y
  1592. +CONFIG_VFAT_FS=y
  1593. +CONFIG_FAT_DEFAULT_CODEPAGE=437
  1594. +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
  1595. +# CONFIG_NTFS_FS is not set
  1596. +
  1597. +#
  1598. +# Pseudo filesystems
  1599. +#
  1600. +CONFIG_PROC_FS=y
  1601. +CONFIG_PROC_SYSCTL=y
  1602. +CONFIG_SYSFS=y
  1603. +# CONFIG_TMPFS is not set
  1604. +# CONFIG_HUGETLB_PAGE is not set
  1605. +# CONFIG_CONFIGFS_FS is not set
  1606. +
  1607. +#
  1608. +# Layered filesystems
  1609. +#
  1610. +CONFIG_UNION_FS=y
  1611. +# CONFIG_UNION_FS_XATTR is not set
  1612. +# CONFIG_UNION_FS_DEBUG is not set
  1613. +
  1614. +#
  1615. +# Miscellaneous filesystems
  1616. +#
  1617. +# CONFIG_ADFS_FS is not set
  1618. +# CONFIG_AFFS_FS is not set
  1619. +# CONFIG_HFS_FS is not set
  1620. +# CONFIG_HFSPLUS_FS is not set
  1621. +# CONFIG_BEFS_FS is not set
  1622. +# CONFIG_BFS_FS is not set
  1623. +# CONFIG_EFS_FS is not set
  1624. +CONFIG_JFFS2_FS=y
  1625. +CONFIG_JFFS2_FS_DEBUG=0
  1626. +CONFIG_JFFS2_FS_WRITEBUFFER=y
  1627. +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
  1628. +# CONFIG_JFFS2_SUMMARY is not set
  1629. +# CONFIG_JFFS2_FS_XATTR is not set
  1630. +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
  1631. +CONFIG_JFFS2_ZLIB=y
  1632. +# CONFIG_JFFS2_LZO is not set
  1633. +CONFIG_JFFS2_RTIME=y
  1634. +# CONFIG_JFFS2_RUBIN is not set
  1635. +# CONFIG_CRAMFS is not set
  1636. +# CONFIG_VXFS_FS is not set
  1637. +# CONFIG_MINIX_FS is not set
  1638. +# CONFIG_OMFS_FS is not set
  1639. +# CONFIG_HPFS_FS is not set
  1640. +# CONFIG_QNX4FS_FS is not set
  1641. +CONFIG_ROMFS_FS=y
  1642. +# CONFIG_SYSV_FS is not set
  1643. +# CONFIG_UFS_FS is not set
  1644. +# CONFIG_NETWORK_FILESYSTEMS is not set
  1645. +
  1646. +#
  1647. +# Partition Types
  1648. +#
  1649. +CONFIG_PARTITION_ADVANCED=y
  1650. +# CONFIG_ACORN_PARTITION is not set
  1651. +# CONFIG_OSF_PARTITION is not set
  1652. +# CONFIG_AMIGA_PARTITION is not set
  1653. +# CONFIG_ATARI_PARTITION is not set
  1654. +# CONFIG_MAC_PARTITION is not set
  1655. +CONFIG_MSDOS_PARTITION=y
  1656. +# CONFIG_BSD_DISKLABEL is not set
  1657. +# CONFIG_MINIX_SUBPARTITION is not set
  1658. +# CONFIG_SOLARIS_X86_PARTITION is not set
  1659. +# CONFIG_UNIXWARE_DISKLABEL is not set
  1660. +CONFIG_LDM_PARTITION=y
  1661. +CONFIG_LDM_DEBUG=y
  1662. +# CONFIG_SGI_PARTITION is not set
  1663. +# CONFIG_ULTRIX_PARTITION is not set
  1664. +# CONFIG_SUN_PARTITION is not set
  1665. +# CONFIG_KARMA_PARTITION is not set
  1666. +# CONFIG_EFI_PARTITION is not set
  1667. +# CONFIG_SYSV68_PARTITION is not set
  1668. +CONFIG_NLS=y
  1669. +CONFIG_NLS_DEFAULT="iso8859-1"
  1670. +CONFIG_NLS_CODEPAGE_437=y
  1671. +# CONFIG_NLS_CODEPAGE_737 is not set
  1672. +# CONFIG_NLS_CODEPAGE_775 is not set
  1673. +# CONFIG_NLS_CODEPAGE_850 is not set
  1674. +# CONFIG_NLS_CODEPAGE_852 is not set
  1675. +# CONFIG_NLS_CODEPAGE_855 is not set
  1676. +# CONFIG_NLS_CODEPAGE_857 is not set
  1677. +# CONFIG_NLS_CODEPAGE_860 is not set
  1678. +# CONFIG_NLS_CODEPAGE_861 is not set
  1679. +# CONFIG_NLS_CODEPAGE_862 is not set
  1680. +# CONFIG_NLS_CODEPAGE_863 is not set
  1681. +# CONFIG_NLS_CODEPAGE_864 is not set
  1682. +# CONFIG_NLS_CODEPAGE_865 is not set
  1683. +# CONFIG_NLS_CODEPAGE_866 is not set
  1684. +# CONFIG_NLS_CODEPAGE_869 is not set
  1685. +# CONFIG_NLS_CODEPAGE_936 is not set
  1686. +# CONFIG_NLS_CODEPAGE_950 is not set
  1687. +# CONFIG_NLS_CODEPAGE_932 is not set
  1688. +# CONFIG_NLS_CODEPAGE_949 is not set
  1689. +# CONFIG_NLS_CODEPAGE_874 is not set
  1690. +# CONFIG_NLS_ISO8859_8 is not set
  1691. +# CONFIG_NLS_CODEPAGE_1250 is not set
  1692. +# CONFIG_NLS_CODEPAGE_1251 is not set
  1693. +CONFIG_NLS_ASCII=y
  1694. +CONFIG_NLS_ISO8859_1=y
  1695. +# CONFIG_NLS_ISO8859_2 is not set
  1696. +# CONFIG_NLS_ISO8859_3 is not set
  1697. +# CONFIG_NLS_ISO8859_4 is not set
  1698. +# CONFIG_NLS_ISO8859_5 is not set
  1699. +# CONFIG_NLS_ISO8859_6 is not set
  1700. +# CONFIG_NLS_ISO8859_7 is not set
  1701. +# CONFIG_NLS_ISO8859_9 is not set
  1702. +# CONFIG_NLS_ISO8859_13 is not set
  1703. +# CONFIG_NLS_ISO8859_14 is not set
  1704. +CONFIG_NLS_ISO8859_15=y
  1705. +# CONFIG_NLS_KOI8_R is not set
  1706. +# CONFIG_NLS_KOI8_U is not set
  1707. +CONFIG_NLS_UTF8=y
  1708. +# CONFIG_DLM is not set
  1709. +
  1710. +#
  1711. +# Security options
  1712. +#
  1713. +# CONFIG_KEYS is not set
  1714. +# CONFIG_SECURITY is not set
  1715. +# CONFIG_SECURITYFS is not set
  1716. +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
  1717. +CONFIG_CRYPTO=y
  1718. +
  1719. +#
  1720. +# Crypto core or helper
  1721. +#
  1722. +# CONFIG_CRYPTO_FIPS is not set
  1723. +CONFIG_CRYPTO_ALGAPI=y
  1724. +CONFIG_CRYPTO_ALGAPI2=y
  1725. +CONFIG_CRYPTO_AEAD2=y
  1726. +CONFIG_CRYPTO_BLKCIPHER=y
  1727. +CONFIG_CRYPTO_BLKCIPHER2=y
  1728. +CONFIG_CRYPTO_HASH2=y
  1729. +CONFIG_CRYPTO_RNG2=y
  1730. +CONFIG_CRYPTO_MANAGER=y
  1731. +CONFIG_CRYPTO_MANAGER2=y
  1732. +# CONFIG_CRYPTO_GF128MUL is not set
  1733. +# CONFIG_CRYPTO_NULL is not set
  1734. +# CONFIG_CRYPTO_CRYPTD is not set
  1735. +# CONFIG_CRYPTO_AUTHENC is not set
  1736. +# CONFIG_CRYPTO_TEST is not set
  1737. +
  1738. +#
  1739. +# Authenticated Encryption with Associated Data
  1740. +#
  1741. +# CONFIG_CRYPTO_CCM is not set
  1742. +# CONFIG_CRYPTO_GCM is not set
  1743. +# CONFIG_CRYPTO_SEQIV is not set
  1744. +
  1745. +#
  1746. +# Block modes
  1747. +#
  1748. +# CONFIG_CRYPTO_CBC is not set
  1749. +# CONFIG_CRYPTO_CTR is not set
  1750. +# CONFIG_CRYPTO_CTS is not set
  1751. +CONFIG_CRYPTO_ECB=y
  1752. +# CONFIG_CRYPTO_LRW is not set
  1753. +# CONFIG_CRYPTO_PCBC is not set
  1754. +# CONFIG_CRYPTO_XTS is not set
  1755. +
  1756. +#
  1757. +# Hash modes
  1758. +#
  1759. +# CONFIG_CRYPTO_HMAC is not set
  1760. +# CONFIG_CRYPTO_XCBC is not set
  1761. +
  1762. +#
  1763. +# Digest
  1764. +#
  1765. +# CONFIG_CRYPTO_CRC32C is not set
  1766. +# CONFIG_CRYPTO_MD4 is not set
  1767. +# CONFIG_CRYPTO_MD5 is not set
  1768. +# CONFIG_CRYPTO_MICHAEL_MIC is not set
  1769. +# CONFIG_CRYPTO_RMD128 is not set
  1770. +# CONFIG_CRYPTO_RMD160 is not set
  1771. +# CONFIG_CRYPTO_RMD256 is not set
  1772. +# CONFIG_CRYPTO_RMD320 is not set
  1773. +# CONFIG_CRYPTO_SHA1 is not set
  1774. +# CONFIG_CRYPTO_SHA256 is not set
  1775. +# CONFIG_CRYPTO_SHA512 is not set
  1776. +# CONFIG_CRYPTO_TGR192 is not set
  1777. +# CONFIG_CRYPTO_WP512 is not set
  1778. +
  1779. +#
  1780. +# Ciphers
  1781. +#
  1782. +CONFIG_CRYPTO_AES=y
  1783. +# CONFIG_CRYPTO_ANUBIS is not set
  1784. +CONFIG_CRYPTO_ARC4=y
  1785. +# CONFIG_CRYPTO_BLOWFISH is not set
  1786. +# CONFIG_CRYPTO_CAMELLIA is not set
  1787. +# CONFIG_CRYPTO_CAST5 is not set
  1788. +# CONFIG_CRYPTO_CAST6 is not set
  1789. +# CONFIG_CRYPTO_DES is not set
  1790. +# CONFIG_CRYPTO_FCRYPT is not set
  1791. +# CONFIG_CRYPTO_KHAZAD is not set
  1792. +# CONFIG_CRYPTO_SALSA20 is not set
  1793. +# CONFIG_CRYPTO_SEED is not set
  1794. +# CONFIG_CRYPTO_SERPENT is not set
  1795. +# CONFIG_CRYPTO_TEA is not set
  1796. +# CONFIG_CRYPTO_TWOFISH is not set
  1797. +
  1798. +#
  1799. +# Compression
  1800. +#
  1801. +# CONFIG_CRYPTO_DEFLATE is not set
  1802. +# CONFIG_CRYPTO_LZO is not set
  1803. +
  1804. +#
  1805. +# Random Number Generation
  1806. +#
  1807. +# CONFIG_CRYPTO_ANSI_CPRNG is not set
  1808. +# CONFIG_CRYPTO_HW is not set
  1809. +
  1810. +#
  1811. +# OCF Configuration
  1812. +#
  1813. +# CONFIG_OCF_OCF is not set
  1814. +
  1815. +#
  1816. +# Library routines
  1817. +#
  1818. +CONFIG_BITREVERSE=y
  1819. +CONFIG_CRC_CCITT=y
  1820. +# CONFIG_CRC16 is not set
  1821. +# CONFIG_CRC_T10DIF is not set
  1822. +# CONFIG_CRC_ITU_T is not set
  1823. +CONFIG_CRC32=y
  1824. +# CONFIG_CRC7 is not set
  1825. +# CONFIG_LIBCRC32C is not set
  1826. +CONFIG_ZLIB_INFLATE=y
  1827. +CONFIG_ZLIB_DEFLATE=y
  1828. +CONFIG_TEXTSEARCH=y
  1829. +CONFIG_TEXTSEARCH_KMP=y
  1830. +CONFIG_TEXTSEARCH_BM=y
  1831. +CONFIG_TEXTSEARCH_FSM=y
  1832. +CONFIG_HAS_IOMEM=y
  1833. +CONFIG_HAS_DMA=y
  1834. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/a.out.h linux-2.6.28.10/arch/ubicom32/include/asm/a.out.h
  1835. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/a.out.h 1970-01-01 02:00:00.000000000 +0200
  1836. +++ linux-2.6.28.10/arch/ubicom32/include/asm/a.out.h 2009-08-06 10:31:02.000000000 +0300
  1837. @@ -0,0 +1,47 @@
  1838. +/*
  1839. + * arch/ubicom32/include/asm/a.out.h
  1840. + * Definitions for Ubicom32 a.out executable format.
  1841. + *
  1842. + * (C) Copyright 2009, Ubicom, Inc.
  1843. + *
  1844. + * This file is part of the Ubicom32 Linux Kernel Port.
  1845. + *
  1846. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  1847. + * it and/or modify it under the terms of the GNU General Public License
  1848. + * as published by the Free Software Foundation, either version 2 of the
  1849. + * License, or (at your option) any later version.
  1850. + *
  1851. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  1852. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  1853. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  1854. + * the GNU General Public License for more details.
  1855. + *
  1856. + * You should have received a copy of the GNU General Public License
  1857. + * along with the Ubicom32 Linux Kernel Port. If not,
  1858. + * see <http://www.gnu.org/licenses/>.
  1859. + *
  1860. + * Ubicom32 implementation derived from (with many thanks):
  1861. + * arch/m68knommu
  1862. + * arch/blackfin
  1863. + * arch/parisc
  1864. + */
  1865. +#ifndef _ASM_UBICOM32_A_OUT_H
  1866. +#define _ASM_UBICOM32_A_OUT_H
  1867. +
  1868. +struct exec
  1869. +{
  1870. + unsigned long a_info; /* Use macros N_MAGIC, etc for access */
  1871. + unsigned a_text; /* length of text, in bytes */
  1872. + unsigned a_data; /* length of data, in bytes */
  1873. + unsigned a_bss; /* length of uninitialized data area for file, in bytes */
  1874. + unsigned a_syms; /* length of symbol table data in file, in bytes */
  1875. + unsigned a_entry; /* start address */
  1876. + unsigned a_trsize; /* length of relocation info for text, in bytes */
  1877. + unsigned a_drsize; /* length of relocation info for data, in bytes */
  1878. +};
  1879. +
  1880. +#define N_TRSIZE(a) ((a).a_trsize)
  1881. +#define N_DRSIZE(a) ((a).a_drsize)
  1882. +#define N_SYMSIZE(a) ((a).a_syms)
  1883. +
  1884. +#endif /* _ASM_UBICOM32_A_OUT_H */
  1885. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/atomic.h linux-2.6.28.10/arch/ubicom32/include/asm/atomic.h
  1886. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/atomic.h 1970-01-01 02:00:00.000000000 +0200
  1887. +++ linux-2.6.28.10/arch/ubicom32/include/asm/atomic.h 2009-08-06 10:31:02.000000000 +0300
  1888. @@ -0,0 +1,352 @@
  1889. +/*
  1890. + * arch/ubicom32/include/asm/atomic.h
  1891. + * Atomic operations definitions for Ubicom32 architecture.
  1892. + *
  1893. + * (C) Copyright 2009, Ubicom, Inc.
  1894. + *
  1895. + * This file is part of the Ubicom32 Linux Kernel Port.
  1896. + *
  1897. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  1898. + * it and/or modify it under the terms of the GNU General Public License
  1899. + * as published by the Free Software Foundation, either version 2 of the
  1900. + * License, or (at your option) any later version.
  1901. + *
  1902. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  1903. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  1904. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  1905. + * the GNU General Public License for more details.
  1906. + *
  1907. + * You should have received a copy of the GNU General Public License
  1908. + * along with the Ubicom32 Linux Kernel Port. If not,
  1909. + * see <http://www.gnu.org/licenses/>.
  1910. + *
  1911. + * Ubicom32 implementation derived from (with many thanks):
  1912. + * arch/m68knommu
  1913. + * arch/blackfin
  1914. + * arch/parisc
  1915. + */
  1916. +#ifndef _ASM_UBICOM32_ATOMIC_H
  1917. +#define _ASM_UBICOM32_ATOMIC_H
  1918. +
  1919. +#include <asm/system.h>
  1920. +#include <asm/ubicom32-common.h>
  1921. +#include <asm/types.h>
  1922. +
  1923. +/*
  1924. + * Most instructions on the Ubicom32 processor are atomic in that they
  1925. + * execute in one clock cycle. However, Linux has several operations
  1926. + * (e.g. compare and swap) which will require more than a single instruction
  1927. + * to perform. To achieve this, the Ubicom32 processor uses a single
  1928. + * global bit in a scratchpad register as a critical section lock. All
  1929. + * atomic operations acquire this lock.
  1930. + *
  1931. + * NOTE: To AVOID DEADLOCK(s), the atomic lock must only be used for atomic
  1932. + * operations or by the ldsr to avoid disabling a thread performing an atomic
  1933. + * operation.
  1934. + *
  1935. + * Do not attempt to disable interrupts while holding the atomic operations
  1936. + * lock or you will DEADLOCK the system.
  1937. + */
  1938. +
  1939. +typedef struct {
  1940. + volatile int counter;
  1941. +} atomic_t;
  1942. +
  1943. +#define ATOMIC_INIT(i) { (i) }
  1944. +
  1945. +/*
  1946. + * __atomic_add()
  1947. + * Add i to v and return the result.
  1948. + */
  1949. +static inline void __atomic_add(int i, atomic_t *v)
  1950. +{
  1951. + atomic_t *vt = v;
  1952. +
  1953. + __atomic_lock_acquire();
  1954. + vt->counter += i;
  1955. + __atomic_lock_release();
  1956. +}
  1957. +
  1958. +/*
  1959. + * __atomic_sub()
  1960. + * Subtract i from v and return the result.
  1961. + */
  1962. +static inline void __atomic_sub(int i, atomic_t *v)
  1963. +{
  1964. + atomic_t *vt = v;
  1965. +
  1966. + __atomic_lock_acquire();
  1967. + vt->counter -= i;
  1968. + __atomic_lock_release();
  1969. +}
  1970. +
  1971. +/*
  1972. + * __atomic_add_return()
  1973. + * Add i to v and return the result.
  1974. + *
  1975. + * The implementation here looks rather odd because we appear to be doing
  1976. + * the addition twice. In fact that's exactly what we're doing but with
  1977. + * the ubicom32 instruction set we can do the inner load and add with two
  1978. + * instructions whereas generating both the atomic result and the "ret"
  1979. + * result requires three instructions. The second add is generally only as
  1980. + * costly as a move instruction and in cases where we compare the result
  1981. + * with a constant the compiler can fold two constant values and do a
  1982. + * single instruction, thus saving an instruction overall!
  1983. + *
  1984. + * At the worst we save one instruction inside the atomic lock.
  1985. + */
  1986. +static inline int __atomic_add_return(int i, atomic_t *v)
  1987. +{
  1988. + int ret;
  1989. + atomic_t *vt = v;
  1990. +
  1991. + __atomic_lock_acquire();
  1992. + ret = vt->counter;
  1993. + vt->counter = ret + i;
  1994. + __atomic_lock_release();
  1995. +
  1996. + return ret + i;
  1997. +}
  1998. +
  1999. +/*
  2000. + * __atomic_sub_return()
  2001. + * Subtract i from v and return the result.
  2002. + *
  2003. + * The implementation here looks rather odd because we appear to be doing
  2004. + * the subtraction twice. In fact that's exactly what we're doing but with
  2005. + * the ubicom32 instruction set we can do the inner load and sub with two
  2006. + * instructions whereas generating both the atomic result and the "ret"
  2007. + * result requires three instructions. The second sub is generally only as
  2008. + * costly as a move instruction and in cases where we compare the result
  2009. + * with a constant the compiler can fold two constant values and do a
  2010. + * single instruction, thus saving an instruction overall!
  2011. + *
  2012. + * At the worst we save one instruction inside the atomic lock.
  2013. + */
  2014. +static inline int __atomic_sub_return(int i, atomic_t *v)
  2015. +{
  2016. + int ret;
  2017. + atomic_t *vt = v;
  2018. +
  2019. + __atomic_lock_acquire();
  2020. + ret = vt->counter;
  2021. + vt->counter = ret - i;
  2022. + __atomic_lock_release();
  2023. +
  2024. + return ret - i;
  2025. +}
  2026. +
  2027. +/*
  2028. + * PUBLIC API FOR ATOMIC!
  2029. + */
  2030. +#define atomic_add(i,v) (__atomic_add( ((int)i),(v)))
  2031. +#define atomic_sub(i,v) (__atomic_sub( ((int)i),(v)))
  2032. +#define atomic_inc(v) (__atomic_add( 1,(v)))
  2033. +#define atomic_dec(v) (__atomic_sub( 1,(v)))
  2034. +#define atomic_add_return(i,v) (__atomic_add_return( ((int)i),(v)))
  2035. +#define atomic_sub_return(i,v) (__atomic_sub_return( ((int)i),(v)))
  2036. +#define atomic_inc_return(v) (__atomic_add_return( 1,(v)))
  2037. +#define atomic_dec_return(v) (__atomic_sub_return( 1,(v)))
  2038. +#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
  2039. +#define atomic_dec_and_test(v) (atomic_dec_return(v) == 0)
  2040. +#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0)
  2041. +#define atomic_sub_and_test(i,v) (atomic_sub_return((i),(v)) == 0)
  2042. +
  2043. +/*
  2044. + * atomic_read()
  2045. + * Acquire the atomic lock and read the variable.
  2046. + */
  2047. +static inline int atomic_read(const atomic_t *v)
  2048. +{
  2049. + int ret;
  2050. + const atomic_t *vt = v;
  2051. +
  2052. + __atomic_lock_acquire();
  2053. + ret = vt->counter;
  2054. + __atomic_lock_release();
  2055. +
  2056. + return ret;
  2057. +}
  2058. +
  2059. +/*
  2060. + * atomic_set()
  2061. + * Acquire the atomic lock and set the variable.
  2062. + */
  2063. +static inline void atomic_set(atomic_t *v, int i)
  2064. +{
  2065. + atomic_t *vt = v;
  2066. +
  2067. + __atomic_lock_acquire();
  2068. + vt->counter = i;
  2069. + __atomic_lock_release();
  2070. +}
  2071. +
  2072. +/*
  2073. + * atomic_cmpxchg
  2074. + * Acquire the atomic lock and exchange if current == old.
  2075. + */
  2076. +static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
  2077. +{
  2078. + int prev;
  2079. + atomic_t *vt = v;
  2080. +
  2081. + __atomic_lock_acquire();
  2082. + prev = vt->counter;
  2083. + if (prev == old) {
  2084. + vt->counter = new;
  2085. + }
  2086. + __atomic_lock_release();
  2087. +
  2088. + return prev;
  2089. +}
  2090. +
  2091. +/*
  2092. + * atomic_xchg()
  2093. + * Acquire the atomic lock and exchange values.
  2094. + */
  2095. +static inline int atomic_xchg(atomic_t *v, int new)
  2096. +{
  2097. + int prev;
  2098. + atomic_t *vt = v;
  2099. +
  2100. + __atomic_lock_acquire();
  2101. + prev = vt->counter;
  2102. + vt->counter = new;
  2103. + __atomic_lock_release();
  2104. +
  2105. + return prev;
  2106. +}
  2107. +
  2108. +/*
  2109. + * atomic_add_unless()
  2110. + * Acquire the atomic lock and add a unless the value is u.
  2111. + */
  2112. +static inline int atomic_add_unless(atomic_t *v, int a, int u)
  2113. +{
  2114. + int prev;
  2115. + atomic_t *vt = v;
  2116. +
  2117. + __atomic_lock_acquire();
  2118. + prev = vt->counter;
  2119. + if (prev != u) {
  2120. + vt->counter += a;
  2121. + __atomic_lock_release();
  2122. + return 1;
  2123. + }
  2124. +
  2125. + __atomic_lock_release();
  2126. + return 0;
  2127. +}
  2128. +
  2129. +#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
  2130. +
  2131. +#include <asm-generic/atomic.h>
  2132. +
  2133. +/*
  2134. + * The following is not a real function. The compiler should remove the function
  2135. + * call as long as the user does not pass in a size that __xchg and __cmpxchg
  2136. + * are not prepared for. If the user does pass in an unknown size, the user
  2137. + * will get a link time error.
  2138. + *
  2139. + * The no return is to prevent a compiler error that can occur when dealing with
  2140. + * uninitialized variables. Given that the function doesn't exist there is no
  2141. + * net effect (and if it did it would not return).
  2142. + */
  2143. +extern void __xchg_called_with_bad_pointer(void) __attribute__((noreturn));
  2144. +
  2145. +/*
  2146. + * __xchg()
  2147. + * Xchange *ptr for x atomically.
  2148. + *
  2149. + * Must be both locally atomic and atomic on SMP. Ubicom32 does not have an
  2150. + * atomic exchange instruction so we use the global atomic_lock.
  2151. + */
  2152. +static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
  2153. +{
  2154. + unsigned long ret;
  2155. +
  2156. + __atomic_lock_acquire();
  2157. +
  2158. + switch (size) {
  2159. + case 1:
  2160. + ret = *(volatile unsigned char *)ptr;
  2161. + *(volatile unsigned char *)ptr = x;
  2162. + break;
  2163. +
  2164. + case 2:
  2165. + ret = *(volatile unsigned short *)ptr;
  2166. + *(volatile unsigned short *)ptr = x;
  2167. + break;
  2168. +
  2169. + case 4:
  2170. + ret = *(volatile unsigned int *)ptr;
  2171. + *(volatile unsigned int *)ptr = x;
  2172. + break;
  2173. +
  2174. + default:
  2175. + __xchg_called_with_bad_pointer();
  2176. + break;
  2177. + }
  2178. + __atomic_lock_release();
  2179. + return ret;
  2180. +}
  2181. +
  2182. +#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
  2183. +
  2184. +/*
  2185. + * __cmpxchg()
  2186. + * Compare and Xchange *ptr for x atomically.
  2187. + *
  2188. + * Must be both locally atomic and atomic on SMP. Ubicom32 does not have an
  2189. + * atomic exchange instruction so we use the global atomic_lock.
  2190. + */
  2191. +static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, unsigned long next, int size)
  2192. +{
  2193. + unsigned long prev;
  2194. +
  2195. + __atomic_lock_acquire();
  2196. + switch (size) {
  2197. + case 1:
  2198. + prev = *(u8 *)ptr;
  2199. + if (prev == old) {
  2200. + *(u8 *)ptr = (u8)next;
  2201. + }
  2202. + break;
  2203. +
  2204. + case 2:
  2205. + prev = *(u16 *)ptr;
  2206. + if (prev == old) {
  2207. + *(u16 *)ptr = (u16)next;
  2208. + }
  2209. + break;
  2210. +
  2211. + case 4:
  2212. + prev = *(u32 *)ptr;
  2213. + if (prev == old) {
  2214. + *(u32 *)ptr = (u32)next;
  2215. + }
  2216. + break;
  2217. +
  2218. + default:
  2219. + __xchg_called_with_bad_pointer();
  2220. + break;
  2221. + }
  2222. + __atomic_lock_release();
  2223. + return prev;
  2224. +}
  2225. +
  2226. +/*
  2227. + * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
  2228. + * them available.
  2229. + */
  2230. +#define cmpxchg_local(ptr, o, n) \
  2231. + ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), (unsigned long)(n), sizeof(*(ptr))))
  2232. +
  2233. +#define cmpxchg(ptr, o, n) __cmpxchg((ptr), (o), (n), sizeof(*(ptr)))
  2234. +
  2235. +#define smp_mb__before_atomic_inc() asm volatile ("" : : : "memory")
  2236. +#define smp_mb__after_atomic_inc() asm volatile ("" : : : "memory")
  2237. +#define smp_mb__before_atomic_dec() asm volatile ("" : : : "memory")
  2238. +#define smp_mb__after_atomic_dec() asm volatile ("" : : : "memory")
  2239. +
  2240. +#endif /* _ASM_UBICOM32_ATOMIC_H */
  2241. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/audio_tio.h linux-2.6.28.10/arch/ubicom32/include/asm/audio_tio.h
  2242. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/audio_tio.h 1970-01-01 02:00:00.000000000 +0200
  2243. +++ linux-2.6.28.10/arch/ubicom32/include/asm/audio_tio.h 2009-08-06 10:31:02.000000000 +0300
  2244. @@ -0,0 +1,124 @@
  2245. +/*
  2246. + * arch/ubicom32/include/asm/audio_tio.h
  2247. + * AudioTIO include file
  2248. + *
  2249. + * (C) Copyright 2009, Ubicom, Inc.
  2250. + *
  2251. + * This file is part of the Ubicom32 Linux Kernel Port.
  2252. + *
  2253. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  2254. + * it and/or modify it under the terms of the GNU General Public License
  2255. + * as published by the Free Software Foundation, either version 2 of the
  2256. + * License, or (at your option) any later version.
  2257. + *
  2258. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  2259. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  2260. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  2261. + * the GNU General Public License for more details.
  2262. + *
  2263. + * You should have received a copy of the GNU General Public License
  2264. + * along with the Ubicom32 Linux Kernel Port. If not,
  2265. + * see <http://www.gnu.org/licenses/>.
  2266. + */
  2267. +
  2268. +#ifndef _AUDIO_TIO_H
  2269. +#define _AUDIO_TIO_H
  2270. +
  2271. +#include <asm/devtree.h>
  2272. +#include <asm/ubi32-pcm.h>
  2273. +
  2274. +#define UBI32_AUDIO_INT_FLAG_MORE_SAMPLES 0x00000001
  2275. +#define UBI32_AUDIO_INT_FLAG_COMMAND 0x00000002
  2276. +
  2277. +/*
  2278. + * Commands the Primary OS sends to the audio device
  2279. + */
  2280. +enum ubi32_audio_command {
  2281. + UBI32_AUDIO_CMD_NONE,
  2282. + UBI32_AUDIO_CMD_START,
  2283. + UBI32_AUDIO_CMD_STOP,
  2284. + UBI32_AUDIO_CMD_PAUSE,
  2285. + UBI32_AUDIO_CMD_RESUME,
  2286. + UBI32_AUDIO_CMD_MUTE,
  2287. + UBI32_AUDIO_CMD_UNMUTE,
  2288. + UBI32_AUDIO_CMD_SETUP,
  2289. + UBI32_AUDIO_CMD_ENABLE,
  2290. + UBI32_AUDIO_CMD_DISABLE,
  2291. +};
  2292. +
  2293. +/*
  2294. + * Flag bits passed in the registers
  2295. + */
  2296. +#define UBI32_CMD_SETUP_FLAG_LE (1 << 0) /* Use Little Endian Mode */
  2297. +
  2298. +/*
  2299. + * Status bits that audio device can set to indicate reason
  2300. + * for interrupting the Primary OS
  2301. + */
  2302. +#define UBI32_AUDIO_STATUS_PLAY_DMA0_REQUEST (1 << 0) /* Audio device needs samples in DMA0 for playback */
  2303. +#define UBI32_AUDIO_STATUS_PLAY_DMA1_REQUEST (1 << 1) /* Audio device needs samples in DMA1 for playback */
  2304. +
  2305. +struct ubi32_audio_dma {
  2306. + /*
  2307. + * NOTE: The active flag shall only be SET by the producer and CLEARED
  2308. + * by the consumer, NEVER the other way around. For playback, the
  2309. + * Primary OS sets this flag and ipAudioTIO clears it.
  2310. + *
  2311. + * The producer shall not modify the ptr or ctr fields when the transfer
  2312. + * is marked as active, as these are used by the consumer to do the
  2313. + * transfer.
  2314. + */
  2315. + volatile uint32_t active; /* Nonzero if data in ptr/ctr ready to be transferred */
  2316. + //volatile u32_t active; /* Nonzero if data in ptr/ctr ready to be transferred */
  2317. + volatile void *ptr; /* Pointer to data to be transferred */
  2318. + volatile uint32_t ctr; /* Counter: number of data units to transfer */
  2319. + //volatile u32_t ctr; /* Counter: number of data units to transfer */
  2320. +};
  2321. +
  2322. +#define AUDIOTIONODE_CAP_BE (1 << 0)
  2323. +#define AUDIOTIONODE_CAP_LE (1 << 1)
  2324. +
  2325. +/*
  2326. + * Resource indices used to access IRQs via platform_get_resource
  2327. + */
  2328. +#define AUDIOTIO_MEM_RESOURCE 0
  2329. +#define AUDIOTIO_TX_IRQ_RESOURCE 0
  2330. +#define AUDIOTIO_RX_IRQ_RESOURCE 1
  2331. +
  2332. +#define AUDIOTIONODE_VERSION 5
  2333. +struct audiotionode {
  2334. + struct devtree_node dn;
  2335. + uint32_t version; /* Version of this node */
  2336. + struct audiotioregs *regs;
  2337. +};
  2338. +
  2339. +#define AUDIOTIOREGS_VERSION 3
  2340. +struct audiotioregs {
  2341. + uint32_t version;
  2342. + uint32_t caps; /* Capabilities of the driver */
  2343. + u32_t *sample_rates; /* Sample Rates supported by this driver */
  2344. + u32_t n_sample_rates; /* Number of sample rates supported by this driver */
  2345. + u32_t channel_mask; /* The channel configs supported by this driver (bit 1 = 1 channel, etc) */
  2346. + volatile uint32_t int_flags; /* Reason for interrupting audio device */
  2347. + volatile enum ubi32_audio_command command; /* Command from Primary OS */
  2348. + volatile uint32_t flags; /* Flag bits for this command */
  2349. + volatile uint32_t channels; /* Number of channels in stream */
  2350. + volatile uint32_t sample_rate; /* Sample rate */
  2351. + volatile uint32_t status; /* Status bits sent from AudioTIO to Primary OS */
  2352. + volatile void *current_read_pos; /* Position of next sample to be removed from Primary OS sample buffer */
  2353. +
  2354. + /*
  2355. + * These are the transfer requests. They are used in alternating
  2356. + * order so that when ipAudioTIO is processing one request, the
  2357. + * Primary OS can fill in the other one.
  2358. + *
  2359. + * NOTE: The active bit shall always be SET by the producer and
  2360. + * CLEARED by the consumer, NEVER the other way around.
  2361. + */
  2362. + struct ubi32_audio_dma playback_xfer_requests[2];
  2363. +};
  2364. +
  2365. +extern struct platform_device * __init audio_tio_alloc(const char *driver_name, const char *node_name, int priv_size);
  2366. +
  2367. +#define audio_tio_priv(pdev) (((struct ubi32pcm_platform_data *)(((struct platform_device *)(pdev))->dev.platform_data))->priv_data)
  2368. +#endif
  2369. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/auxvec.h linux-2.6.28.10/arch/ubicom32/include/asm/auxvec.h
  2370. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/auxvec.h 1970-01-01 02:00:00.000000000 +0200
  2371. +++ linux-2.6.28.10/arch/ubicom32/include/asm/auxvec.h 2009-08-06 10:31:02.000000000 +0300
  2372. @@ -0,0 +1,32 @@
  2373. +/*
  2374. + * arch/ubicom32/include/asm/auxvec.h
  2375. + * Symbolic values for the entries in the auxiliary table
  2376. + * put on the initial stack.
  2377. + *
  2378. + * (C) Copyright 2009, Ubicom, Inc.
  2379. + *
  2380. + * This file is part of the Ubicom32 Linux Kernel Port.
  2381. + *
  2382. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  2383. + * it and/or modify it under the terms of the GNU General Public License
  2384. + * as published by the Free Software Foundation, either version 2 of the
  2385. + * License, or (at your option) any later version.
  2386. + *
  2387. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  2388. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  2389. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  2390. + * the GNU General Public License for more details.
  2391. + *
  2392. + * You should have received a copy of the GNU General Public License
  2393. + * along with the Ubicom32 Linux Kernel Port. If not,
  2394. + * see <http://www.gnu.org/licenses/>.
  2395. + *
  2396. + * Ubicom32 implementation derived from (with many thanks):
  2397. + * arch/m68knommu
  2398. + * arch/blackfin
  2399. + * arch/parisc
  2400. + */
  2401. +#ifndef _ASM_UBICOM32_AUXVEC_H
  2402. +#define _ASM_UBICOM32_AUXVEC_H
  2403. +
  2404. +#endif /* _ASM_UBICOM32_AUXVEC_H */
  2405. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/bitops.h linux-2.6.28.10/arch/ubicom32/include/asm/bitops.h
  2406. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/bitops.h 1970-01-01 02:00:00.000000000 +0200
  2407. +++ linux-2.6.28.10/arch/ubicom32/include/asm/bitops.h 2009-08-06 10:31:02.000000000 +0300
  2408. @@ -0,0 +1,171 @@
  2409. +/*
  2410. + * arch/ubicom32/include/asm/bitops.h
  2411. + * Bit manipulation definitions for Ubicom32 architecture.
  2412. + *
  2413. + * (C) Copyright 2009, Ubicom, Inc.
  2414. + *
  2415. + * This file is part of the Ubicom32 Linux Kernel Port.
  2416. + *
  2417. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  2418. + * it and/or modify it under the terms of the GNU General Public License
  2419. + * as published by the Free Software Foundation, either version 2 of the
  2420. + * License, or (at your option) any later version.
  2421. + *
  2422. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  2423. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  2424. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  2425. + * the GNU General Public License for more details.
  2426. + *
  2427. + * You should have received a copy of the GNU General Public License
  2428. + * along with the Ubicom32 Linux Kernel Port. If not,
  2429. + * see <http://www.gnu.org/licenses/>.
  2430. + *
  2431. + * Ubicom32 implementation derived from (with many thanks):
  2432. + * arch/m68knommu
  2433. + * arch/blackfin
  2434. + * arch/parisc
  2435. + */
  2436. +#ifndef _ASM_UBICOM32_BITOPS_H
  2437. +#define _ASM_UBICOM32_BITOPS_H
  2438. +
  2439. +/*
  2440. + * Copyright 1992, Linus Torvalds.
  2441. + */
  2442. +
  2443. +#include <linux/compiler.h>
  2444. +#include <asm/byteorder.h> /* swab32 */
  2445. +
  2446. +#ifdef __KERNEL__
  2447. +
  2448. +#ifndef _LINUX_BITOPS_H
  2449. +#error only <linux/bitops.h> can be included directly
  2450. +#endif
  2451. +
  2452. +#include <asm-generic/bitops/ffs.h>
  2453. +#include <asm-generic/bitops/__ffs.h>
  2454. +
  2455. +#include <asm-generic/bitops/sched.h>
  2456. +#include <asm-generic/bitops/ffz.h>
  2457. +
  2458. +#include <asm/ubicom32-common.h>
  2459. +
  2460. +static inline void set_bit(int bit, volatile unsigned long *p)
  2461. +{
  2462. + unsigned long mask = 1UL << (bit & 31);
  2463. +
  2464. + p += bit >> 5;
  2465. +
  2466. + __atomic_lock_acquire();
  2467. + *p |= mask;
  2468. + __atomic_lock_release();
  2469. +}
  2470. +
  2471. +static inline void clear_bit(int bit, volatile unsigned long *p)
  2472. +{
  2473. + unsigned long mask = 1UL << (bit & 31);
  2474. +
  2475. + p += bit >> 5;
  2476. +
  2477. + __atomic_lock_acquire();
  2478. + *p &= ~mask;
  2479. + __atomic_lock_release();
  2480. +}
  2481. +
  2482. +/*
  2483. + * clear_bit() doesn't provide any barrier for the compiler.
  2484. + */
  2485. +#define smp_mb__before_clear_bit() barrier()
  2486. +#define smp_mb__after_clear_bit() barrier()
  2487. +
  2488. +static inline void change_bit(int bit, volatile unsigned long *p)
  2489. +{
  2490. + unsigned long mask = 1UL << (bit & 31);
  2491. +
  2492. + p += bit >> 5;
  2493. +
  2494. + __atomic_lock_acquire();
  2495. + *p ^= mask;
  2496. + __atomic_lock_release();
  2497. +}
  2498. +
  2499. +static inline int test_and_set_bit(int bit, volatile unsigned long *p)
  2500. +{
  2501. + unsigned int res;
  2502. + unsigned long mask = 1UL << (bit & 31);
  2503. +
  2504. + p += bit >> 5;
  2505. +
  2506. + __atomic_lock_acquire();
  2507. + res = *p;
  2508. + *p = res | mask;
  2509. + __atomic_lock_release();
  2510. +
  2511. + return res & mask;
  2512. +}
  2513. +
  2514. +static inline int test_and_clear_bit(int bit, volatile unsigned long *p)
  2515. +{
  2516. + unsigned int res;
  2517. + unsigned long mask = 1UL << (bit & 31);
  2518. +
  2519. + p += bit >> 5;
  2520. +
  2521. + __atomic_lock_acquire();
  2522. + res = *p;
  2523. + *p = res & ~mask;
  2524. + __atomic_lock_release();
  2525. +
  2526. + return res & mask;
  2527. +}
  2528. +
  2529. +static inline int test_and_change_bit(int bit, volatile unsigned long *p)
  2530. +{
  2531. + unsigned int res;
  2532. + unsigned long mask = 1UL << (bit & 31);
  2533. +
  2534. + p += bit >> 5;
  2535. +
  2536. + __atomic_lock_acquire();
  2537. + res = *p;
  2538. + *p = res ^ mask;
  2539. + __atomic_lock_release();
  2540. +
  2541. + return res & mask;
  2542. +}
  2543. +
  2544. +#include <asm-generic/bitops/non-atomic.h>
  2545. +
  2546. +/*
  2547. + * This routine doesn't need to be atomic.
  2548. + */
  2549. +static inline int __constant_test_bit(int nr, const volatile unsigned long *addr)
  2550. +{
  2551. + return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0;
  2552. +}
  2553. +
  2554. +static inline int __test_bit(int nr, const volatile unsigned long *addr)
  2555. +{
  2556. + int * a = (int *) addr;
  2557. + int mask;
  2558. +
  2559. + a += nr >> 5;
  2560. + mask = 1 << (nr & 0x1f);
  2561. + return ((mask & *a) != 0);
  2562. +}
  2563. +
  2564. +#define test_bit(nr,addr) (__builtin_constant_p(nr) ? __constant_test_bit((nr),(addr)) : __test_bit((nr),(addr)))
  2565. +
  2566. +#include <asm-generic/bitops/find.h>
  2567. +#include <asm-generic/bitops/hweight.h>
  2568. +#include <asm-generic/bitops/lock.h>
  2569. +
  2570. +#include <asm-generic/bitops/ext2-non-atomic.h>
  2571. +#include <asm-generic/bitops/ext2-atomic.h>
  2572. +#include <asm-generic/bitops/minix.h>
  2573. +
  2574. +#endif /* __KERNEL__ */
  2575. +
  2576. +#include <asm-generic/bitops/fls.h>
  2577. +#include <asm-generic/bitops/fls64.h>
  2578. +
  2579. +#endif /* _ASM_UBICOM32_BITOPS_H */
  2580. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/board.h linux-2.6.28.10/arch/ubicom32/include/asm/board.h
  2581. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/board.h 1970-01-01 02:00:00.000000000 +0200
  2582. +++ linux-2.6.28.10/arch/ubicom32/include/asm/board.h 2009-08-06 10:31:02.000000000 +0300
  2583. @@ -0,0 +1,34 @@
  2584. +/*
  2585. + * arch/ubicom32/include/asm/board.h
  2586. + * Board init and revision definitions for Ubicom32 architecture.
  2587. + *
  2588. + * (C) Copyright 2009, Ubicom, Inc.
  2589. + *
  2590. + * This file is part of the Ubicom32 Linux Kernel Port.
  2591. + *
  2592. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  2593. + * it and/or modify it under the terms of the GNU General Public License
  2594. + * as published by the Free Software Foundation, either version 2 of the
  2595. + * License, or (at your option) any later version.
  2596. + *
  2597. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  2598. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  2599. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  2600. + * the GNU General Public License for more details.
  2601. + *
  2602. + * You should have received a copy of the GNU General Public License
  2603. + * along with the Ubicom32 Linux Kernel Port. If not,
  2604. + * see <http://www.gnu.org/licenses/>.
  2605. + *
  2606. + * Ubicom32 implementation derived from (with many thanks):
  2607. + * arch/m68knommu
  2608. + * arch/blackfin
  2609. + * arch/parisc
  2610. + */
  2611. +#ifndef _ASM_UBICOM32_BOARD_H
  2612. +#define _ASM_UBICOM32_BOARD_H
  2613. +
  2614. +extern const char *board_get_revision(void);
  2615. +extern void __init board_init(void);
  2616. +
  2617. +#endif /* _ASM_UBICOM32_BOARD_H */
  2618. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/bootargs.h linux-2.6.28.10/arch/ubicom32/include/asm/bootargs.h
  2619. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/bootargs.h 1970-01-01 02:00:00.000000000 +0200
  2620. +++ linux-2.6.28.10/arch/ubicom32/include/asm/bootargs.h 2009-08-06 10:31:02.000000000 +0300
  2621. @@ -0,0 +1,34 @@
  2622. +/*
  2623. + * arch/ubicom32/include/asm/bootargs.h
  2624. + * Kernel command line via the devtree API.
  2625. + *
  2626. + * (C) Copyright 2009, Ubicom, Inc.
  2627. + *
  2628. + * This file is part of the Ubicom32 Linux Kernel Port.
  2629. + *
  2630. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  2631. + * it and/or modify it under the terms of the GNU General Public License
  2632. + * as published by the Free Software Foundation, either version 2 of the
  2633. + * License, or (at your option) any later version.
  2634. + *
  2635. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  2636. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  2637. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  2638. + * the GNU General Public License for more details.
  2639. + *
  2640. + * You should have received a copy of the GNU General Public License
  2641. + * along with the Ubicom32 Linux Kernel Port. If not,
  2642. + * see <http://www.gnu.org/licenses/>.
  2643. + *
  2644. + * Ubicom32 implementation derived from (with many thanks):
  2645. + * arch/m68knommu
  2646. + * arch/blackfin
  2647. + * arch/parisc
  2648. + */
  2649. +#ifndef _ASM_UBICOM32_BOOTARGS_H
  2650. +#define _ASM_UBICOM32_BOOTARGS_H
  2651. +
  2652. +extern const char *bootargs_get_cmdline(void);
  2653. +extern void __init bootargs_init(void);
  2654. +
  2655. +#endif /* _ASM_UBICOM32_BOOTARGS_H */
  2656. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/bootinfo.h linux-2.6.28.10/arch/ubicom32/include/asm/bootinfo.h
  2657. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/bootinfo.h 1970-01-01 02:00:00.000000000 +0200
  2658. +++ linux-2.6.28.10/arch/ubicom32/include/asm/bootinfo.h 2009-08-06 10:31:02.000000000 +0300
  2659. @@ -0,0 +1,34 @@
  2660. +/*
  2661. + * arch/ubicom32/include/asm/bootinfo.h
  2662. + * Definitions of firmware boot parameters passed to the kernel.
  2663. + *
  2664. + * (C) Copyright 2009, Ubicom, Inc.
  2665. + *
  2666. + * This file is part of the Ubicom32 Linux Kernel Port.
  2667. + *
  2668. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  2669. + * it and/or modify it under the terms of the GNU General Public License
  2670. + * as published by the Free Software Foundation, either version 2 of the
  2671. + * License, or (at your option) any later version.
  2672. + *
  2673. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  2674. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  2675. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  2676. + * the GNU General Public License for more details.
  2677. + *
  2678. + * You should have received a copy of the GNU General Public License
  2679. + * along with the Ubicom32 Linux Kernel Port. If not,
  2680. + * see <http://www.gnu.org/licenses/>.
  2681. + *
  2682. + * Ubicom32 implementation derived from (with many thanks):
  2683. + * arch/m68knommu
  2684. + * arch/blackfin
  2685. + * arch/parisc
  2686. + */
  2687. +
  2688. +#ifndef _ASM_UBICOM32_BOOTINFO_H
  2689. +#define _ASM_UBICOM32_BOOTINFO_H
  2690. +
  2691. +/* Nothing for ubicom32 */
  2692. +
  2693. +#endif /* _ASM_UBICOM32_BOOTINFO_H */
  2694. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/bug.h linux-2.6.28.10/arch/ubicom32/include/asm/bug.h
  2695. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/bug.h 1970-01-01 02:00:00.000000000 +0200
  2696. +++ linux-2.6.28.10/arch/ubicom32/include/asm/bug.h 2009-08-06 10:31:02.000000000 +0300
  2697. @@ -0,0 +1,53 @@
  2698. +/*
  2699. + * arch/ubicom32/include/asm/bug.h
  2700. + * Generic bug.h for Ubicom32 architecture.
  2701. + *
  2702. + * (C) Copyright 2009, Ubicom, Inc.
  2703. + *
  2704. + * This file is part of the Ubicom32 Linux Kernel Port.
  2705. + *
  2706. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  2707. + * it and/or modify it under the terms of the GNU General Public License
  2708. + * as published by the Free Software Foundation, either version 2 of the
  2709. + * License, or (at your option) any later version.
  2710. + *
  2711. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  2712. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  2713. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  2714. + * the GNU General Public License for more details.
  2715. + *
  2716. + * You should have received a copy of the GNU General Public License
  2717. + * along with the Ubicom32 Linux Kernel Port. If not,
  2718. + * see <http://www.gnu.org/licenses/>.
  2719. + *
  2720. + * Ubicom32 implementation derived from (with many thanks):
  2721. + * arch/m68knommu
  2722. + * arch/blackfin
  2723. + * arch/parisc
  2724. + */
  2725. +#ifndef _ASM_UBICOM32_BUG_H
  2726. +#define _ASM_UBICOM32_BUG_H
  2727. +
  2728. +#include <linux/kernel.h>
  2729. +#include <asm/thread.h>
  2730. +
  2731. +#if defined(CONFIG_STOP_ON_BUG)
  2732. +/*
  2733. + * __BUG_ON()
  2734. + * Stall all threads to enable debugging.
  2735. + */
  2736. +static inline void __BUG_ON(unsigned long c)
  2737. +{
  2738. + if (unlikely(c)) {
  2739. + THREAD_STALL;
  2740. + }
  2741. + return;
  2742. +}
  2743. +
  2744. +#define BUG_ON(c) __BUG_ON((unsigned long)(c))
  2745. +#define HAVE_ARCH_BUG_ON
  2746. +#endif
  2747. +
  2748. +#include <asm-generic/bug.h>
  2749. +
  2750. +#endif /* _ASM_UBICOM32_BUG_H */
  2751. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/bugs.h linux-2.6.28.10/arch/ubicom32/include/asm/bugs.h
  2752. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/bugs.h 1970-01-01 02:00:00.000000000 +0200
  2753. +++ linux-2.6.28.10/arch/ubicom32/include/asm/bugs.h 2009-08-06 10:31:02.000000000 +0300
  2754. @@ -0,0 +1,44 @@
  2755. +/*
  2756. + * arch/ubicom32/include/asm/bugs.h
  2757. + * Definition of check_bugs() for Ubicom32 architecture.
  2758. + *
  2759. + * (C) Copyright 2009, Ubicom, Inc.
  2760. + * Copyright (C) 1994 Linus Torvalds
  2761. + *
  2762. + * This file is part of the Ubicom32 Linux Kernel Port.
  2763. + *
  2764. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  2765. + * it and/or modify it under the terms of the GNU General Public License
  2766. + * as published by the Free Software Foundation, either version 2 of the
  2767. + * License, or (at your option) any later version.
  2768. + *
  2769. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  2770. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  2771. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  2772. + * the GNU General Public License for more details.
  2773. + *
  2774. + * You should have received a copy of the GNU General Public License
  2775. + * along with the Ubicom32 Linux Kernel Port. If not,
  2776. + * see <http://www.gnu.org/licenses/>.
  2777. + *
  2778. + * Ubicom32 implementation derived from (with many thanks):
  2779. + * arch/m68knommu
  2780. + * arch/blackfin
  2781. + * arch/parisc
  2782. + */
  2783. +
  2784. +/*
  2785. + * This is included by init/main.c to check for architecture-dependent bugs.
  2786. + *
  2787. + * Needs:
  2788. + * void check_bugs(void);
  2789. + */
  2790. +
  2791. +#ifndef _ASM_UBICOM32_BUGS_H
  2792. +#define _ASM_UBICOM32_BUGS_H
  2793. +
  2794. +static void check_bugs(void)
  2795. +{
  2796. +}
  2797. +
  2798. +#endif /* _ASM_UBICOM32_BUGS_H */
  2799. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/byteorder.h linux-2.6.28.10/arch/ubicom32/include/asm/byteorder.h
  2800. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/byteorder.h 1970-01-01 02:00:00.000000000 +0200
  2801. +++ linux-2.6.28.10/arch/ubicom32/include/asm/byteorder.h 2009-08-06 10:31:02.000000000 +0300
  2802. @@ -0,0 +1,48 @@
  2803. +/*
  2804. + * arch/ubicom32/include/asm/byteorder.h
  2805. + * Byte order swapping utility routines.
  2806. + *
  2807. + * (C) Copyright 2009, Ubicom, Inc.
  2808. + *
  2809. + * This file is part of the Ubicom32 Linux Kernel Port.
  2810. + *
  2811. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  2812. + * it and/or modify it under the terms of the GNU General Public License
  2813. + * as published by the Free Software Foundation, either version 2 of the
  2814. + * License, or (at your option) any later version.
  2815. + *
  2816. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  2817. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  2818. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  2819. + * the GNU General Public License for more details.
  2820. + *
  2821. + * You should have received a copy of the GNU General Public License
  2822. + * along with the Ubicom32 Linux Kernel Port. If not,
  2823. + * see <http://www.gnu.org/licenses/>.
  2824. + *
  2825. + * Ubicom32 implementation derived from (with many thanks):
  2826. + * arch/m68knommu
  2827. + * arch/blackfin
  2828. + * arch/parisc
  2829. + */
  2830. +#ifndef _ASM_UBICOM32_BYTEORDER_H
  2831. +#define _ASM_UBICOM32_BYTEORDER_H
  2832. +
  2833. +#include <linux/types.h>
  2834. +
  2835. +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
  2836. +# define __BYTEORDER_HAS_U64__
  2837. +# define __SWAB_64_THRU_32__
  2838. +#endif
  2839. +
  2840. +#if defined(IP7000) || defined(IP7000_REV2)
  2841. +
  2842. +#define __arch__swab16 __builtin_ubicom32_swapb_2
  2843. +#define __arch__swab32 __builtin_ubicom32_swapb_4
  2844. +
  2845. +#endif /* IP7000 */
  2846. +
  2847. +#include <linux/byteorder/big_endian.h>
  2848. +
  2849. +#endif /* _ASM_UBICOM32_BYTEORDER_H */
  2850. +
  2851. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/cachectl.h linux-2.6.28.10/arch/ubicom32/include/asm/cachectl.h
  2852. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/cachectl.h 1970-01-01 02:00:00.000000000 +0200
  2853. +++ linux-2.6.28.10/arch/ubicom32/include/asm/cachectl.h 2009-08-06 10:31:02.000000000 +0300
  2854. @@ -0,0 +1,39 @@
  2855. +/*
  2856. + * arch/ubicom32/include/asm/cachectl.h
  2857. + * Ubicom32 cache control definitions.
  2858. + *
  2859. + * (C) Copyright 2009, Ubicom, Inc.
  2860. + *
  2861. + * This file is part of the Ubicom32 Linux Kernel Port.
  2862. + *
  2863. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  2864. + * it and/or modify it under the terms of the GNU General Public License
  2865. + * as published by the Free Software Foundation, either version 2 of the
  2866. + * License, or (at your option) any later version.
  2867. + *
  2868. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  2869. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  2870. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  2871. + * the GNU General Public License for more details.
  2872. + *
  2873. + * You should have received a copy of the GNU General Public License
  2874. + * along with the Ubicom32 Linux Kernel Port. If not,
  2875. + * see <http://www.gnu.org/licenses/>.
  2876. + *
  2877. + * Ubicom32 implementation derived from (with many thanks):
  2878. + * arch/m68knommu
  2879. + * arch/blackfin
  2880. + * arch/parisc
  2881. + */
  2882. +#ifndef _ASM_UBICOM32_CACHECTL_H
  2883. +#define _ASM_UBICOM32_CACHECTL_H
  2884. +
  2885. +#include <asm/ip5000.h>
  2886. +
  2887. +/*
  2888. + * mem_cache_control()
  2889. + * Special cache control operation
  2890. + */
  2891. +extern void mem_cache_control(unsigned long cc, unsigned long begin_addr, unsigned long end_addr, unsigned long op);
  2892. +
  2893. +#endif /* _ASM_UBICOM32_CACHECTL_H */
  2894. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/cacheflush.h linux-2.6.28.10/arch/ubicom32/include/asm/cacheflush.h
  2895. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/cacheflush.h 1970-01-01 02:00:00.000000000 +0200
  2896. +++ linux-2.6.28.10/arch/ubicom32/include/asm/cacheflush.h 2009-08-06 10:31:02.000000000 +0300
  2897. @@ -0,0 +1,104 @@
  2898. +/*
  2899. + * arch/ubicom32/include/asm/cacheflush.h
  2900. + * Cache flushing definitions for Ubicom32 architecture.
  2901. + *
  2902. + * (C) Copyright 2009, Ubicom, Inc.
  2903. + *
  2904. + * This file is part of the Ubicom32 Linux Kernel Port.
  2905. + *
  2906. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  2907. + * it and/or modify it under the terms of the GNU General Public License
  2908. + * as published by the Free Software Foundation, either version 2 of the
  2909. + * License, or (at your option) any later version.
  2910. + *
  2911. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  2912. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  2913. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  2914. + * the GNU General Public License for more details.
  2915. + *
  2916. + * You should have received a copy of the GNU General Public License
  2917. + * along with the Ubicom32 Linux Kernel Port. If not,
  2918. + * see <http://www.gnu.org/licenses/>.
  2919. + *
  2920. + * Ubicom32 implementation derived from (with many thanks):
  2921. + * arch/m68knommu
  2922. + * arch/blackfin
  2923. + * arch/parisc
  2924. + */
  2925. +#ifndef _ASM_UBICOM32_CACHEFLUSH_H
  2926. +#define _ASM_UBICOM32_CACHEFLUSH_H
  2927. +
  2928. +/*
  2929. + * (C) Copyright 2000-2004, Greg Ungerer <[email protected]>
  2930. + */
  2931. +#include <linux/mm.h>
  2932. +#include <asm/cachectl.h>
  2933. +#include <asm/ip5000.h>
  2934. +
  2935. +#define flush_cache_all() __flush_cache_all()
  2936. +#define flush_cache_mm(mm) do { } while (0)
  2937. +#define flush_cache_dup_mm(mm) do { } while (0)
  2938. +#define flush_cache_range(vma, start, end) __flush_cache_all()
  2939. +#define flush_cache_page(vma, vmaddr) do { } while (0)
  2940. +#define flush_dcache_page(page) do { } while (0)
  2941. +#define flush_dcache_mmap_lock(mapping) do { } while (0)
  2942. +#define flush_dcache_mmap_unlock(mapping) do { } while (0)
  2943. +
  2944. +#define flush_dcache_range(start, end) \
  2945. +do { \
  2946. + /* Flush the data cache and invalidate the I cache. */ \
  2947. + local_irq_disable(); \
  2948. + mem_cache_control(DCCR_BASE, start, end, CCR_CTRL_FLUSH_ADDR); \
  2949. + mem_cache_control(ICCR_BASE, start, end, CCR_CTRL_INV_ADDR); \
  2950. + local_irq_enable(); \
  2951. +} while (0)
  2952. +
  2953. +#define flush_icache_range(start, end) \
  2954. +do { \
  2955. + /* Flush the data cache and invalidate the I cache. */ \
  2956. + local_irq_disable(); \
  2957. + mem_cache_control(DCCR_BASE, start, end, CCR_CTRL_FLUSH_ADDR); \
  2958. + mem_cache_control(ICCR_BASE, start, end, CCR_CTRL_INV_ADDR); \
  2959. + local_irq_enable(); \
  2960. +} while (0)
  2961. +
  2962. +#define flush_icache_page(vma,pg) do { } while (0)
  2963. +#define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
  2964. +#define flush_cache_vmap(start, end) do { } while (0)
  2965. +#define flush_cache_vunmap(start, end) do { } while (0)
  2966. +
  2967. +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
  2968. + memcpy(dst, src, len)
  2969. +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
  2970. + memcpy(dst, src, len)
  2971. +
  2972. +/*
  2973. + * Cache handling for IP5000
  2974. + */
  2975. +extern inline void mem_cache_invalidate_all(unsigned long cc)
  2976. +{
  2977. + asm volatile (
  2978. + " bset "D(CCR_CTRL)"(%0), "D(CCR_CTRL)"(%0), #"D(CCR_CTRL_RESET)" \n\t"
  2979. + " nop \n\t"
  2980. + " bclr "D(CCR_CTRL)"(%0), "D(CCR_CTRL)"(%0), #"D(CCR_CTRL_RESET)" \n\t"
  2981. + " pipe_flush 0 \n\t"
  2982. + :
  2983. + : "a"(cc)
  2984. + : "cc"
  2985. + );
  2986. +}
  2987. +
  2988. +static inline void __flush_cache_all(void)
  2989. +{
  2990. + /*
  2991. + * Flush Icache
  2992. + */
  2993. + mem_cache_invalidate_all(ICCR_BASE);
  2994. +
  2995. + /*
  2996. + * Flush Dcache
  2997. + */
  2998. + mem_cache_invalidate_all(DCCR_BASE);
  2999. +}
  3000. +
  3001. +#endif /* _ASM_UBICOM32_CACHEFLUSH_H */
  3002. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/cache.h linux-2.6.28.10/arch/ubicom32/include/asm/cache.h
  3003. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/cache.h 1970-01-01 02:00:00.000000000 +0200
  3004. +++ linux-2.6.28.10/arch/ubicom32/include/asm/cache.h 2009-08-06 10:31:02.000000000 +0300
  3005. @@ -0,0 +1,40 @@
  3006. +/*
  3007. + * arch/ubicom32/include/asm/cache.h
  3008. + * Cache line definitions for Ubicom32 architecture.
  3009. + *
  3010. + * (C) Copyright 2009, Ubicom, Inc.
  3011. + *
  3012. + * This file is part of the Ubicom32 Linux Kernel Port.
  3013. + *
  3014. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  3015. + * it and/or modify it under the terms of the GNU General Public License
  3016. + * as published by the Free Software Foundation, either version 2 of the
  3017. + * License, or (at your option) any later version.
  3018. + *
  3019. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  3020. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  3021. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  3022. + * the GNU General Public License for more details.
  3023. + *
  3024. + * You should have received a copy of the GNU General Public License
  3025. + * along with the Ubicom32 Linux Kernel Port. If not,
  3026. + * see <http://www.gnu.org/licenses/>.
  3027. + *
  3028. + * Ubicom32 implementation derived from (with many thanks):
  3029. + * arch/m68knommu
  3030. + * arch/blackfin
  3031. + * arch/parisc
  3032. + */
  3033. +#ifndef _ASM_UBICOM32_CACHE_H
  3034. +#define _ASM_UBICOM32_CACHE_H
  3035. +
  3036. +/*
  3037. + * bytes per L1 cache line
  3038. + */
  3039. +#define L1_CACHE_SHIFT 5
  3040. +#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
  3041. +
  3042. +#define __cacheline_aligned
  3043. +#define ____cacheline_aligned
  3044. +
  3045. +#endif /* _ASM_UBICOM32_CACHE_H */
  3046. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/checksum.h linux-2.6.28.10/arch/ubicom32/include/asm/checksum.h
  3047. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/checksum.h 1970-01-01 02:00:00.000000000 +0200
  3048. +++ linux-2.6.28.10/arch/ubicom32/include/asm/checksum.h 2009-08-06 10:31:02.000000000 +0300
  3049. @@ -0,0 +1,149 @@
  3050. +/*
  3051. + * arch/ubicom32/include/asm/checksum.h
  3052. + * Checksum utilities for Ubicom32 architecture.
  3053. + *
  3054. + * (C) Copyright 2009, Ubicom, Inc.
  3055. + *
  3056. + * This file is part of the Ubicom32 Linux Kernel Port.
  3057. + *
  3058. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  3059. + * it and/or modify it under the terms of the GNU General Public License
  3060. + * as published by the Free Software Foundation, either version 2 of the
  3061. + * License, or (at your option) any later version.
  3062. + *
  3063. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  3064. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  3065. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  3066. + * the GNU General Public License for more details.
  3067. + *
  3068. + * You should have received a copy of the GNU General Public License
  3069. + * along with the Ubicom32 Linux Kernel Port. If not,
  3070. + * see <http://www.gnu.org/licenses/>.
  3071. + *
  3072. + * Ubicom32 implementation derived from (with many thanks):
  3073. + * arch/m68knommu
  3074. + * arch/blackfin
  3075. + * arch/parisc
  3076. + */
  3077. +#ifndef _ASM_UBICOM32_CHECKSUM_H
  3078. +#define _ASM_UBICOM32_CHECKSUM_H
  3079. +
  3080. +#include <linux/in6.h>
  3081. +
  3082. +/*
  3083. + * computes the checksum of a memory block at buff, length len,
  3084. + * and adds in "sum" (32-bit)
  3085. + *
  3086. + * returns a 32-bit number suitable for feeding into itself
  3087. + * or csum_tcpudp_magic
  3088. + *
  3089. + * this function must be called with even lengths, except
  3090. + * for the last fragment, which may be odd
  3091. + *
  3092. + * it's best to have buff aligned on a 32-bit boundary
  3093. + */
  3094. +__wsum csum_partial(const void *buff, int len, __wsum sum);
  3095. +
  3096. +/*
  3097. + * the same as csum_partial, but copies from src while it
  3098. + * checksums
  3099. + *
  3100. + * here even more important to align src and dst on a 32-bit (or even
  3101. + * better 64-bit) boundary
  3102. + */
  3103. +
  3104. +__wsum csum_partial_copy_nocheck(const void *src, void *dst,
  3105. + int len, __wsum sum);
  3106. +
  3107. +
  3108. +/*
  3109. + * the same as csum_partial_copy, but copies from user space.
  3110. + *
  3111. + * here even more important to align src and dst on a 32-bit (or even
  3112. + * better 64-bit) boundary
  3113. + */
  3114. +
  3115. +extern __wsum csum_partial_copy_from_user(const void __user *src,
  3116. + void *dst, int len, __wsum sum, int *csum_err);
  3117. +
  3118. +__sum16 ip_fast_csum(const void *iph, unsigned int ihl);
  3119. +
  3120. +/*
  3121. + * Fold a partial checksum
  3122. + */
  3123. +
  3124. +static inline __sum16 csum_fold(__wsum sum)
  3125. +{
  3126. + asm volatile (
  3127. + " lsr.4 d15, %0, #16 \n\t"
  3128. + " bfextu %0, %0, #16 \n\t"
  3129. + " add.4 %0, d15, %0 \n\t"
  3130. + " lsr.4 d15, %0, #16 \n\t"
  3131. + " bfextu %0, %0, #16 \n\t"
  3132. + " add.4 %0, d15, %0 \n\t"
  3133. + : "=&d" (sum)
  3134. + : "0"(sum)
  3135. + : "d15"
  3136. + );
  3137. + return (__force __sum16)~sum;
  3138. +}
  3139. +
  3140. +
  3141. +/*
  3142. + * computes the checksum of the TCP/UDP pseudo-header
  3143. + * returns a 16-bit checksum, already complemented
  3144. + */
  3145. +
  3146. +static inline __wsum
  3147. +csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
  3148. + unsigned short proto, __wsum sum)
  3149. +{
  3150. + asm volatile (
  3151. + " add.4 %0, %2, %0 \n\t"
  3152. + " addc %0, %3, %0 \n\t"
  3153. + " addc %0, %4, %0 \n\t"
  3154. + " addc %0, %5, %0 \n\t"
  3155. + " addc %0, #0, %0 \n\t"
  3156. + : "=&d" (sum)
  3157. + : "0"(sum), "r" (saddr), "r" (daddr), "r" (len), "r"(proto)
  3158. + );
  3159. + return sum;
  3160. +}
  3161. +
  3162. +static inline __sum16
  3163. +csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
  3164. + unsigned short proto, __wsum sum)
  3165. +{
  3166. + return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
  3167. +}
  3168. +
  3169. +/*
  3170. + * this routine is used for miscellaneous IP-like checksums, mainly
  3171. + * in icmp.c
  3172. + */
  3173. +extern __sum16 ip_compute_csum(const void *buff, int len);
  3174. +
  3175. +#define _HAVE_ARCH_IPV6_CSUM
  3176. +
  3177. +static __inline__ __sum16
  3178. +csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr,
  3179. + __u32 len, unsigned short proto, __wsum sum)
  3180. +{
  3181. + asm volatile (
  3182. + " add.4 %0, 0(%2), %0 \n\t"
  3183. + " addc %0, 4(%2), %0 \n\t"
  3184. + " addc %0, 8(%2), %0 \n\t"
  3185. + " addc %0, 12(%2), %0 \n\t"
  3186. + " addc %0, 0(%3), %0 \n\t"
  3187. + " addc %0, 4(%3), %0 \n\t"
  3188. + " addc %0, 8(%3), %0 \n\t"
  3189. + " addc %0, 12(%3), %0 \n\t"
  3190. + " addc %0, %4, %0 \n\t"
  3191. + " addc %0, #0, %0 \n\t"
  3192. + : "=&d" (sum)
  3193. + : "0" (sum), "a" (saddr), "a" (daddr), "d" (len + proto)
  3194. + );
  3195. + return csum_fold(sum);
  3196. +}
  3197. +
  3198. +#endif /* _ASM_UBICOM32_CHECKSUM_H */
  3199. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/cpu.h linux-2.6.28.10/arch/ubicom32/include/asm/cpu.h
  3200. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/cpu.h 1970-01-01 02:00:00.000000000 +0200
  3201. +++ linux-2.6.28.10/arch/ubicom32/include/asm/cpu.h 2009-08-06 10:31:02.000000000 +0300
  3202. @@ -0,0 +1,45 @@
  3203. +/*
  3204. + * arch/ubicom32/include/asm/cpu.h
  3205. + * CPU definitions for Ubicom32 architecture.
  3206. + *
  3207. + * (C) Copyright 2009, Ubicom, Inc.
  3208. + * Copyright (C) 2004-2005 ARM Ltd.
  3209. + *
  3210. + * This file is part of the Ubicom32 Linux Kernel Port.
  3211. + *
  3212. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  3213. + * it and/or modify it under the terms of the GNU General Public License
  3214. + * as published by the Free Software Foundation, either version 2 of the
  3215. + * License, or (at your option) any later version.
  3216. + *
  3217. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  3218. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  3219. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  3220. + * the GNU General Public License for more details.
  3221. + *
  3222. + * You should have received a copy of the GNU General Public License
  3223. + * along with the Ubicom32 Linux Kernel Port. If not,
  3224. + * see <http://www.gnu.org/licenses/>.
  3225. + *
  3226. + * Ubicom32 implementation derived from (with many thanks):
  3227. + * arch/m68knommu
  3228. + * arch/blackfin
  3229. + * arch/parisc
  3230. + */
  3231. +#ifndef _ASM_UBICOM32_CPU_H
  3232. +#define _ASM_UBICOM32_CPU_H
  3233. +
  3234. +#include <linux/percpu.h>
  3235. +
  3236. +struct cpuinfo_ubicom32 {
  3237. + unsigned long tid; /* Hardware thread number */
  3238. +
  3239. +#ifdef CONFIG_SMP
  3240. + volatile unsigned long ipi_pending; /* Bit map of operations to execute */
  3241. + unsigned long ipi_count; /* Number of IPI(s) taken on this cpu */
  3242. +#endif
  3243. +};
  3244. +
  3245. +DECLARE_PER_CPU(struct cpuinfo_ubicom32, cpu_data);
  3246. +
  3247. +#endif /* _ASM_UBICOM32_CPU_H */
  3248. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/cputime.h linux-2.6.28.10/arch/ubicom32/include/asm/cputime.h
  3249. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/cputime.h 1970-01-01 02:00:00.000000000 +0200
  3250. +++ linux-2.6.28.10/arch/ubicom32/include/asm/cputime.h 2009-08-06 10:31:02.000000000 +0300
  3251. @@ -0,0 +1,33 @@
  3252. +/*
  3253. + * arch/ubicom32/include/asm/cputime.h
  3254. + * Generic cputime.h for Ubicom32 architecture.
  3255. + *
  3256. + * (C) Copyright 2009, Ubicom, Inc.
  3257. + *
  3258. + * This file is part of the Ubicom32 Linux Kernel Port.
  3259. + *
  3260. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  3261. + * it and/or modify it under the terms of the GNU General Public License
  3262. + * as published by the Free Software Foundation, either version 2 of the
  3263. + * License, or (at your option) any later version.
  3264. + *
  3265. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  3266. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  3267. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  3268. + * the GNU General Public License for more details.
  3269. + *
  3270. + * You should have received a copy of the GNU General Public License
  3271. + * along with the Ubicom32 Linux Kernel Port. If not,
  3272. + * see <http://www.gnu.org/licenses/>.
  3273. + *
  3274. + * Ubicom32 implementation derived from (with many thanks):
  3275. + * arch/m68knommu
  3276. + * arch/blackfin
  3277. + * arch/parisc
  3278. + */
  3279. +#ifndef _ASM_UBICOM32_CPUTIME_H
  3280. +#define _ASM_UBICOM32_CPUTIME_H
  3281. +
  3282. +#include <asm-generic/cputime.h>
  3283. +
  3284. +#endif /* _ASM_UBICOM32_CPUTIME_H */
  3285. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/current.h linux-2.6.28.10/arch/ubicom32/include/asm/current.h
  3286. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/current.h 1970-01-01 02:00:00.000000000 +0200
  3287. +++ linux-2.6.28.10/arch/ubicom32/include/asm/current.h 2009-08-06 10:31:02.000000000 +0300
  3288. @@ -0,0 +1,44 @@
  3289. +/*
  3290. + * arch/ubicom32/include/asm/current.h
  3291. + * Definition of get_current() for Ubicom32 architecture.
  3292. + *
  3293. + * (C) Copyright 2009, Ubicom, Inc.
  3294. + * (C) Copyright 2000, Lineo, David McCullough <[email protected]>
  3295. + * (C) Copyright 2002, Greg Ungerer ([email protected])
  3296. + *
  3297. + * This file is part of the Ubicom32 Linux Kernel Port.
  3298. + *
  3299. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  3300. + * it and/or modify it under the terms of the GNU General Public License
  3301. + * as published by the Free Software Foundation, either version 2 of the
  3302. + * License, or (at your option) any later version.
  3303. + *
  3304. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  3305. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  3306. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  3307. + * the GNU General Public License for more details.
  3308. + *
  3309. + * You should have received a copy of the GNU General Public License
  3310. + * along with the Ubicom32 Linux Kernel Port. If not,
  3311. + * see <http://www.gnu.org/licenses/>.
  3312. + *
  3313. + * Ubicom32 implementation derived from (with many thanks):
  3314. + * arch/m68knommu
  3315. + * arch/blackfin
  3316. + * arch/parisc
  3317. + */
  3318. +#ifndef _ASM_UBICOM32_CURRENT_H
  3319. +#define _ASM_UBICOM32_CURRENT_H
  3320. +
  3321. +#include <linux/thread_info.h>
  3322. +
  3323. +struct task_struct;
  3324. +
  3325. +static inline struct task_struct *get_current(void)
  3326. +{
  3327. + return(current_thread_info()->task);
  3328. +}
  3329. +
  3330. +#define current get_current()
  3331. +
  3332. +#endif /* _ASM_UBICOM32_CURRENT_H */
  3333. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/delay.h linux-2.6.28.10/arch/ubicom32/include/asm/delay.h
  3334. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/delay.h 1970-01-01 02:00:00.000000000 +0200
  3335. +++ linux-2.6.28.10/arch/ubicom32/include/asm/delay.h 2009-08-06 10:31:02.000000000 +0300
  3336. @@ -0,0 +1,75 @@
  3337. +/*
  3338. + * arch/ubicom32/include/asm/delay.h
  3339. + * Definition of delay routines for Ubicom32 architecture.
  3340. + *
  3341. + * (C) Copyright 2009, Ubicom, Inc.
  3342. + *
  3343. + * This file is part of the Ubicom32 Linux Kernel Port.
  3344. + *
  3345. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  3346. + * it and/or modify it under the terms of the GNU General Public License
  3347. + * as published by the Free Software Foundation, either version 2 of the
  3348. + * License, or (at your option) any later version.
  3349. + *
  3350. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  3351. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  3352. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  3353. + * the GNU General Public License for more details.
  3354. + *
  3355. + * You should have received a copy of the GNU General Public License
  3356. + * along with the Ubicom32 Linux Kernel Port. If not,
  3357. + * see <http://www.gnu.org/licenses/>.
  3358. + *
  3359. + * Ubicom32 implementation derived from (with many thanks):
  3360. + * arch/m68knommu
  3361. + * arch/blackfin
  3362. + * arch/parisc
  3363. + */
  3364. +#ifndef _ASM_UBICOM32_DELAY_H
  3365. +#define _ASM_UBICOM32_DELAY_H
  3366. +
  3367. +#include <asm/param.h>
  3368. +#include <asm/ip5000.h>
  3369. +
  3370. +static inline void __delay(unsigned long loops)
  3371. +{
  3372. + if (loops == 0) {
  3373. + return;
  3374. + }
  3375. +
  3376. + asm volatile (
  3377. + "1: add.4 %0, #-1, %0 \n\t"
  3378. + " jmpne.t 1b \n\t"
  3379. + : "+d" (loops)
  3380. + );
  3381. +}
  3382. +
  3383. +/*
  3384. + * Ubicom32 processor uses fixed 12MHz external OSC.
  3385. + * So we use that as reference to count 12 cycles/us
  3386. + */
  3387. +
  3388. +extern unsigned long loops_per_jiffy;
  3389. +
  3390. +static inline void _udelay(unsigned long usecs)
  3391. +{
  3392. +#if defined(CONFIG_UBICOM32_V4) || defined(CONFIG_UBICOM32_V3)
  3393. + asm volatile (
  3394. + " add.4 d15, 0(%0), %1 \n\t"
  3395. + " sub.4 #0, 0(%0), d15 \n\t"
  3396. + " jmpmi.w.f .-4 \n\t"
  3397. + :
  3398. + : "a"(TIMER_BASE + TIMER_MPTVAL), "d"(usecs * (12000000/1000000))
  3399. + : "d15"
  3400. + );
  3401. +#else
  3402. + BUG();
  3403. +#endif
  3404. +}
  3405. +
  3406. +/*
  3407. + * Moved the udelay() function into library code, no longer inlined.
  3408. + */
  3409. +extern void udelay(unsigned long usecs);
  3410. +
  3411. +#endif /* _ASM_UBICOM32_DELAY_H */
  3412. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/device.h linux-2.6.28.10/arch/ubicom32/include/asm/device.h
  3413. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/device.h 1970-01-01 02:00:00.000000000 +0200
  3414. +++ linux-2.6.28.10/arch/ubicom32/include/asm/device.h 2009-08-06 10:31:02.000000000 +0300
  3415. @@ -0,0 +1,35 @@
  3416. +/*
  3417. + * arch/ubicom32/include/asm/device.h
  3418. + * Generic device.h for Ubicom32 architecture.
  3419. + *
  3420. + * Used for arch specific extensions to struct device
  3421. + *
  3422. + * (C) Copyright 2009, Ubicom, Inc.
  3423. + *
  3424. + * This file is part of the Ubicom32 Linux Kernel Port.
  3425. + *
  3426. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  3427. + * it and/or modify it under the terms of the GNU General Public License
  3428. + * as published by the Free Software Foundation, either version 2 of the
  3429. + * License, or (at your option) any later version.
  3430. + *
  3431. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  3432. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  3433. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  3434. + * the GNU General Public License for more details.
  3435. + *
  3436. + * You should have received a copy of the GNU General Public License
  3437. + * along with the Ubicom32 Linux Kernel Port. If not,
  3438. + * see <http://www.gnu.org/licenses/>.
  3439. + *
  3440. + * Ubicom32 implementation derived from (with many thanks):
  3441. + * arch/m68knommu
  3442. + * arch/blackfin
  3443. + * arch/parisc
  3444. + */
  3445. +#ifndef _ASM_UBICOM32_DEVICE_H
  3446. +#define _ASM_UBICOM32_DEVICE_H
  3447. +
  3448. +#include <asm-generic/device.h>
  3449. +
  3450. +#endif /* _ASM_UBICOM32_DEVICE_H */
  3451. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/devtree.h linux-2.6.28.10/arch/ubicom32/include/asm/devtree.h
  3452. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/devtree.h 1970-01-01 02:00:00.000000000 +0200
  3453. +++ linux-2.6.28.10/arch/ubicom32/include/asm/devtree.h 2009-08-06 10:31:02.000000000 +0300
  3454. @@ -0,0 +1,52 @@
  3455. +/*
  3456. + * arch/ubicom32/include/asm/devtree.h
  3457. + * Device Tree Header File (Shared between ultra and the Host OS)
  3458. + *
  3459. + * (C) Copyright 2009, Ubicom, Inc.
  3460. + *
  3461. + * This file is part of the Ubicom32 Linux Kernel Port.
  3462. + *
  3463. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  3464. + * it and/or modify it under the terms of the GNU General Public License
  3465. + * as published by the Free Software Foundation, either version 2 of the
  3466. + * License, or (at your option) any later version.
  3467. + *
  3468. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  3469. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  3470. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  3471. + * the GNU General Public License for more details.
  3472. + *
  3473. + * You should have received a copy of the GNU General Public License
  3474. + * along with the Ubicom32 Linux Kernel Port. If not,
  3475. + * see <http://www.gnu.org/licenses/>.
  3476. + *
  3477. + * Ubicom32 implementation derived from (with many thanks):
  3478. + * arch/m68knommu
  3479. + * arch/blackfin
  3480. + * arch/parisc
  3481. + */
  3482. +
  3483. +#ifndef _ASM_UBICOM32_DEVTREE_H
  3484. +#define _ASM_UBICOM32_DEVTREE_H
  3485. +
  3486. +#define DEVTREE_MAX_NAME 32
  3487. +#define DEVTREE_IRQ_NONE 0xff
  3488. +#define DEVTREE_IRQ_DONTCARE 0xff
  3489. +#define DEVTREE_NODE_MAGIC 0x10203040
  3490. +
  3491. +struct devtree_node {
  3492. + struct devtree_node *next;
  3493. + unsigned char sendirq;
  3494. + unsigned char recvirq;
  3495. + char name[DEVTREE_MAX_NAME];
  3496. + unsigned int magic;
  3497. +};
  3498. +
  3499. +extern struct devtree_node *devtree;
  3500. +extern struct devtree_node *devtree_find_by_irq(uint8_t sendirq, uint8_t recvirq);
  3501. +extern struct devtree_node *devtree_find_node(const char *str);
  3502. +extern struct devtree_node *devtree_find_next(struct devtree_node **cur);
  3503. +extern int devtree_irq(struct devtree_node *dn, unsigned char *sendirq, unsigned char *recvirq);
  3504. +extern void devtree_print(void);
  3505. +
  3506. +#endif /* _ASM_UBICOM32_DEVTREE_H */
  3507. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/div64.h linux-2.6.28.10/arch/ubicom32/include/asm/div64.h
  3508. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/div64.h 1970-01-01 02:00:00.000000000 +0200
  3509. +++ linux-2.6.28.10/arch/ubicom32/include/asm/div64.h 2009-08-06 10:31:02.000000000 +0300
  3510. @@ -0,0 +1,33 @@
  3511. +/*
  3512. + * arch/ubicom32/include/asm/div64.h
  3513. + * Generic div64.h for Ubicom32 architecture.
  3514. + *
  3515. + * (C) Copyright 2009, Ubicom, Inc.
  3516. + *
  3517. + * This file is part of the Ubicom32 Linux Kernel Port.
  3518. + *
  3519. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  3520. + * it and/or modify it under the terms of the GNU General Public License
  3521. + * as published by the Free Software Foundation, either version 2 of the
  3522. + * License, or (at your option) any later version.
  3523. + *
  3524. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  3525. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  3526. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  3527. + * the GNU General Public License for more details.
  3528. + *
  3529. + * You should have received a copy of the GNU General Public License
  3530. + * along with the Ubicom32 Linux Kernel Port. If not,
  3531. + * see <http://www.gnu.org/licenses/>.
  3532. + *
  3533. + * Ubicom32 implementation derived from (with many thanks):
  3534. + * arch/m68knommu
  3535. + * arch/blackfin
  3536. + * arch/parisc
  3537. + */
  3538. +#ifndef _ASM_UBICOM32_DIV64_H
  3539. +#define _ASM_UBICOM32_DIV64_H
  3540. +
  3541. +#include <asm-generic/div64.h>
  3542. +
  3543. +#endif /* _ASM_UBICOM32_DIV64_H */
  3544. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/dma.h linux-2.6.28.10/arch/ubicom32/include/asm/dma.h
  3545. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/dma.h 1970-01-01 02:00:00.000000000 +0200
  3546. +++ linux-2.6.28.10/arch/ubicom32/include/asm/dma.h 2009-08-06 10:31:02.000000000 +0300
  3547. @@ -0,0 +1,34 @@
  3548. +/*
  3549. + * arch/ubicom32/include/asm/dma.h
  3550. + * DMA definitions for Ubicom32 architecture.
  3551. + *
  3552. + * (C) Copyright 2009, Ubicom, Inc.
  3553. + *
  3554. + * This file is part of the Ubicom32 Linux Kernel Port.
  3555. + *
  3556. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  3557. + * it and/or modify it under the terms of the GNU General Public License
  3558. + * as published by the Free Software Foundation, either version 2 of the
  3559. + * License, or (at your option) any later version.
  3560. + *
  3561. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  3562. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  3563. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  3564. + * the GNU General Public License for more details.
  3565. + *
  3566. + * You should have received a copy of the GNU General Public License
  3567. + * along with the Ubicom32 Linux Kernel Port. If not,
  3568. + * see <http://www.gnu.org/licenses/>.
  3569. + *
  3570. + * Ubicom32 implementation derived from (with many thanks):
  3571. + * arch/m68knommu
  3572. + * arch/blackfin
  3573. + * arch/parisc
  3574. + */
  3575. +#ifndef _ASM_UBICOM32_DMA_H
  3576. +#define _ASM_UBICOM32_DMA_H
  3577. +
  3578. +/* Nothing so far */
  3579. +#define MAX_DMA_ADDRESS 0x00 /* This is quite suspicious */
  3580. +
  3581. +#endif /* _ASM_UBICOM32_DMA_H */
  3582. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/dma-mapping.h linux-2.6.28.10/arch/ubicom32/include/asm/dma-mapping.h
  3583. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/dma-mapping.h 1970-01-01 02:00:00.000000000 +0200
  3584. +++ linux-2.6.28.10/arch/ubicom32/include/asm/dma-mapping.h 2009-08-06 10:31:02.000000000 +0300
  3585. @@ -0,0 +1,34 @@
  3586. +/*
  3587. + * arch/ubicom32/include/asm/dma-mapping.h
  3588. + * Generic dma-mapping.h for Ubicom32 architecture.
  3589. + *
  3590. + * (C) Copyright 2009, Ubicom, Inc.
  3591. + *
  3592. + * This file is part of the Ubicom32 Linux Kernel Port.
  3593. + *
  3594. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  3595. + * it and/or modify it under the terms of the GNU General Public License
  3596. + * as published by the Free Software Foundation, either version 2 of the
  3597. + * License, or (at your option) any later version.
  3598. + *
  3599. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  3600. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  3601. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  3602. + * the GNU General Public License for more details.
  3603. + *
  3604. + * You should have received a copy of the GNU General Public License
  3605. + * along with the Ubicom32 Linux Kernel Port. If not,
  3606. + * see <http://www.gnu.org/licenses/>.
  3607. + *
  3608. + * Ubicom32 implementation derived from (with many thanks):
  3609. + * arch/m68knommu
  3610. + * arch/blackfin
  3611. + * arch/parisc
  3612. + */
  3613. +#ifndef _ASM_UBICOM32_DMA_MAPPING_H
  3614. +#define _ASM_UBICOM32_DMA_MAPPING_H
  3615. +
  3616. +#include <linux/scatterlist.h>
  3617. +#include <asm-generic/dma-mapping.h>
  3618. +
  3619. +#endif /* _ASM_UBICOM32_DMA_MAPPING_H */
  3620. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/elf.h linux-2.6.28.10/arch/ubicom32/include/asm/elf.h
  3621. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/elf.h 1970-01-01 02:00:00.000000000 +0200
  3622. +++ linux-2.6.28.10/arch/ubicom32/include/asm/elf.h 2009-08-18 22:35:42.571202890 +0300
  3623. @@ -0,0 +1,167 @@
  3624. +/*
  3625. + * arch/ubicom32/include/asm/elf.h
  3626. + * Definitions for elf executable format for Ubicom32 architecture.
  3627. + *
  3628. + * (C) Copyright 2009, Ubicom, Inc.
  3629. + *
  3630. + * This file is part of the Ubicom32 Linux Kernel Port.
  3631. + *
  3632. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  3633. + * it and/or modify it under the terms of the GNU General Public License
  3634. + * as published by the Free Software Foundation, either version 2 of the
  3635. + * License, or (at your option) any later version.
  3636. + *
  3637. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  3638. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  3639. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  3640. + * the GNU General Public License for more details.
  3641. + *
  3642. + * You should have received a copy of the GNU General Public License
  3643. + * along with the Ubicom32 Linux Kernel Port. If not,
  3644. + * see <http://www.gnu.org/licenses/>.
  3645. + *
  3646. + * Ubicom32 implementation derived from (with many thanks):
  3647. + * arch/m68knommu
  3648. + * arch/blackfin
  3649. + * arch/parisc
  3650. + */
  3651. +#ifndef _ASM_UBICOM32_ELF_H
  3652. +#define _ASM_UBICOM32_ELF_H
  3653. +
  3654. +/*
  3655. + * ELF register definitions..
  3656. + */
  3657. +
  3658. +#include <asm/ptrace.h>
  3659. +#include <asm/user.h>
  3660. +
  3661. +/*
  3662. + * Processor specific flags for the ELF header e_flags field.
  3663. + */
  3664. +#define EF_UBICOM32_V3 0x00000001 /* -fmarch=ubicom32v3 */
  3665. +#define EF_UBICOM32_V4 0x00000002 /* -fmarch=ubicom32v4 */
  3666. +#define EF_UBICOM32_PIC 0x80000000 /* -fpic */
  3667. +#define EF_UBICOM32_FDPIC 0x40000000 /* -mfdpic */
  3668. +
  3669. +/*
  3670. + * Ubicom32 ELF relocation types
  3671. + */
  3672. +#define R_UBICOM32_NONE 0
  3673. +#define R_UBICOM32_16 1
  3674. +#define R_UBICOM32_32 2
  3675. +#define R_UBICOM32_LO16 3
  3676. +#define R_UBICOM32_HI16 4
  3677. +#define R_UBICOM32_21_PCREL 5
  3678. +#define R_UBICOM32_24_PCREL 6
  3679. +#define R_UBICOM32_HI24 7
  3680. +#define R_UBICOM32_LO7_S 8
  3681. +#define R_UBICOM32_LO7_2_S 9
  3682. +#define R_UBICOM32_LO7_4_S 10
  3683. +#define R_UBICOM32_LO7_D 11
  3684. +#define R_UBICOM32_LO7_2_D 12
  3685. +#define R_UBICOM32_LO7_4_D 13
  3686. +#define R_UBICOM32_32_HARVARD 14
  3687. +#define R_UBICOM32_LO7_CALLI 15
  3688. +#define R_UBICOM32_LO16_CALLI 16
  3689. +#define R_UBICOM32_GOT_HI24 17
  3690. +#define R_UBICOM32_GOT_LO7_S 18
  3691. +#define R_UBICOM32_GOT_LO7_2_S 19
  3692. +#define R_UBICOM32_GOT_LO7_4_S 20
  3693. +#define R_UBICOM32_GOT_LO7_D 21
  3694. +#define R_UBICOM32_GOT_LO7_2_D 22
  3695. +#define R_UBICOM32_GOT_LO7_4_D 23
  3696. +#define R_UBICOM32_FUNCDESC_GOT_HI24 24
  3697. +#define R_UBICOM32_FUNCDESC_GOT_LO7_S 25
  3698. +#define R_UBICOM32_FUNCDESC_GOT_LO7_2_S 26
  3699. +#define R_UBICOM32_FUNCDESC_GOT_LO7_4_S 27
  3700. +#define R_UBICOM32_FUNCDESC_GOT_LO7_D 28
  3701. +#define R_UBICOM32_FUNCDESC_GOT_LO7_2_D 29
  3702. +#define R_UBICOM32_FUNCDESC_GOT_LO7_4_D 30
  3703. +#define R_UBICOM32_GOT_LO7_CALLI 31
  3704. +#define R_UBICOM32_FUNCDESC_GOT_LO7_CALLI 32
  3705. +#define R_UBICOM32_FUNCDESC_VALUE 33
  3706. +#define R_UBICOM32_FUNCDESC 34
  3707. +#define R_UBICOM32_GOTOFFSET_LO 35
  3708. +#define R_UBICOM32_GOTOFFSET_HI 36
  3709. +#define R_UBICOM32_FUNCDESC_GOTOFFSET_LO 37
  3710. +#define R_UBICOM32_FUNCDESC_GOTOFFSET_HI 38
  3711. +#define R_UBICOM32_GNU_VTINHERIT 200
  3712. +#define R_UBICOM32_GNU_VTENTRY 201
  3713. +
  3714. +typedef unsigned long elf_greg_t;
  3715. +
  3716. +#define ELF_NGREG (sizeof(struct pt_regs) / sizeof(elf_greg_t))
  3717. +typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  3718. +
  3719. +typedef struct user_ubicom32fp_struct elf_fpregset_t;
  3720. +
  3721. +/*
  3722. + * This is used to ensure we don't load something for the wrong architecture.
  3723. + */
  3724. +#define elf_check_arch(x) ((x)->e_machine == EM_UBICOM32)
  3725. +
  3726. +#define elf_check_fdpic(x) ((x)->e_flags & EF_UBICOM32_FDPIC)
  3727. +
  3728. +#define elf_check_const_displacement(x) ((x)->e_flags & EF_UBICOM32_PIC)
  3729. +
  3730. +/*
  3731. + * These are used to set parameters in the core dumps.
  3732. + */
  3733. +#define ELF_CLASS ELFCLASS32
  3734. +#define ELF_DATA ELFDATA2MSB
  3735. +#define ELF_ARCH EM_UBICOM32
  3736. +
  3737. +/* For SVR4/m68k the function pointer to be registered with `atexit' is
  3738. + passed in %a1. Although my copy of the ABI has no such statement, it
  3739. + is actually used on ASV. */
  3740. +#define ELF_PLAT_INIT(_r, load_addr) _r->a1 = 0
  3741. +
  3742. +#define ELF_FDPIC_PLAT_INIT(_regs, _exec_map_addr, _interp_map_addr, \
  3743. + _dynamic_addr) \
  3744. + do { \
  3745. + _regs->dn[1] = _exec_map_addr; \
  3746. + _regs->dn[2] = _interp_map_addr; \
  3747. + _regs->dn[3] = _dynamic_addr; \
  3748. + _regs->an[1] = 0; /* dl_fini will be set by ldso */ \
  3749. + } while (0)
  3750. +
  3751. +#define USE_ELF_CORE_DUMP
  3752. +#define ELF_EXEC_PAGESIZE 4096
  3753. +
  3754. +#ifdef __KERNEL__
  3755. +#ifdef CONFIG_UBICOM32_V4
  3756. +#define ELF_FDPIC_CORE_EFLAGS (EF_UBICOM32_FDPIC | EF_UBICOM32_V4)
  3757. +#elif defined CONFIG_UBICOM32_V3
  3758. +#define ELF_FDPIC_CORE_EFLAGS (EF_UBICOM32_FDPIC | EF_UBICOM32_V3)
  3759. +#else
  3760. +#error Unknown/Unsupported ubicom32 architecture.
  3761. +#endif
  3762. +#endif
  3763. +
  3764. +/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
  3765. + use of this is to invoke "./ld.so someprog" to test out a new version of
  3766. + the loader. We need to make sure that it is out of the way of the program
  3767. + that it will "exec", and that there is sufficient room for the brk. */
  3768. +
  3769. +#define ELF_ET_DYN_BASE 0xD0000000UL
  3770. +
  3771. +/*
  3772. + * For Ubicom32, the elf_gregset_t and struct pt_regs are the same size
  3773. + * data structure so a copy is performed instead of providing the
  3774. + * ELF_CORE_COPY_REGS macro.
  3775. + */
  3776. +
  3777. +/* This yields a mask that user programs can use to figure out what
  3778. + instruction set this cpu supports. */
  3779. +
  3780. +#define ELF_HWCAP (0)
  3781. +
  3782. +/* This yields a string that ld.so will use to load implementation
  3783. + specific libraries for optimization. This is more specific in
  3784. + intent than poking at uname or /proc/cpuinfo. */
  3785. +
  3786. +#define ELF_PLATFORM (NULL)
  3787. +
  3788. +#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
  3789. +
  3790. +#endif /* _ASM_UBICOM32_ELF_H */
  3791. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/emergency-restart.h linux-2.6.28.10/arch/ubicom32/include/asm/emergency-restart.h
  3792. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/emergency-restart.h 1970-01-01 02:00:00.000000000 +0200
  3793. +++ linux-2.6.28.10/arch/ubicom32/include/asm/emergency-restart.h 2009-08-06 10:31:02.000000000 +0300
  3794. @@ -0,0 +1,33 @@
  3795. +/*
  3796. + * arch/ubicom32/include/asm/emergency-restart.h
  3797. + * Generic emergency-restart.h for Ubicom32 architecture.
  3798. + *
  3799. + * (C) Copyright 2009, Ubicom, Inc.
  3800. + *
  3801. + * This file is part of the Ubicom32 Linux Kernel Port.
  3802. + *
  3803. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  3804. + * it and/or modify it under the terms of the GNU General Public License
  3805. + * as published by the Free Software Foundation, either version 2 of the
  3806. + * License, or (at your option) any later version.
  3807. + *
  3808. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  3809. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  3810. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  3811. + * the GNU General Public License for more details.
  3812. + *
  3813. + * You should have received a copy of the GNU General Public License
  3814. + * along with the Ubicom32 Linux Kernel Port. If not,
  3815. + * see <http://www.gnu.org/licenses/>.
  3816. + *
  3817. + * Ubicom32 implementation derived from (with many thanks):
  3818. + * arch/m68knommu
  3819. + * arch/blackfin
  3820. + * arch/parisc
  3821. + */
  3822. +#ifndef _ASM_UBICOM32_EMERGENCY_RESTART_H
  3823. +#define _ASM_UBICOM32_EMERGENCY_RESTART_H
  3824. +
  3825. +#include <asm-generic/emergency-restart.h>
  3826. +
  3827. +#endif /* _ASM_UBICOM32_EMERGENCY_RESTART_H */
  3828. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/entry.h linux-2.6.28.10/arch/ubicom32/include/asm/entry.h
  3829. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/entry.h 1970-01-01 02:00:00.000000000 +0200
  3830. +++ linux-2.6.28.10/arch/ubicom32/include/asm/entry.h 2009-08-06 10:31:02.000000000 +0300
  3831. @@ -0,0 +1,34 @@
  3832. +/*
  3833. + * arch/ubicom32/include/asm/entry.h
  3834. + * Entry register/stack definitions for Ubicom32 architecture.
  3835. + *
  3836. + * (C) Copyright 2009, Ubicom, Inc.
  3837. + *
  3838. + * This file is part of the Ubicom32 Linux Kernel Port.
  3839. + *
  3840. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  3841. + * it and/or modify it under the terms of the GNU General Public License
  3842. + * as published by the Free Software Foundation, either version 2 of the
  3843. + * License, or (at your option) any later version.
  3844. + *
  3845. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  3846. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  3847. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  3848. + * the GNU General Public License for more details.
  3849. + *
  3850. + * You should have received a copy of the GNU General Public License
  3851. + * along with the Ubicom32 Linux Kernel Port. If not,
  3852. + * see <http://www.gnu.org/licenses/>.
  3853. + *
  3854. + * Ubicom32 implementation derived from (with many thanks):
  3855. + * arch/m68knommu
  3856. + * arch/blackfin
  3857. + * arch/parisc
  3858. + */
  3859. +#ifndef _ASM_UBICOM32_ENTRY_H
  3860. +#define _ASM_UBICOM32_ENTRY_H
  3861. +
  3862. +#include <asm/setup.h>
  3863. +#include <asm/page.h>
  3864. +
  3865. +#endif /* _ASM_UBICOM32_ENTRY_H */
  3866. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/errno.h linux-2.6.28.10/arch/ubicom32/include/asm/errno.h
  3867. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/errno.h 1970-01-01 02:00:00.000000000 +0200
  3868. +++ linux-2.6.28.10/arch/ubicom32/include/asm/errno.h 2009-08-06 10:31:02.000000000 +0300
  3869. @@ -0,0 +1,33 @@
  3870. +/*
  3871. + * arch/ubicom32/include/asm/errno.h
  3872. + * Generic errno.h for Ubicom32 architecture.
  3873. + *
  3874. + * (C) Copyright 2009, Ubicom, Inc.
  3875. + *
  3876. + * This file is part of the Ubicom32 Linux Kernel Port.
  3877. + *
  3878. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  3879. + * it and/or modify it under the terms of the GNU General Public License
  3880. + * as published by the Free Software Foundation, either version 2 of the
  3881. + * License, or (at your option) any later version.
  3882. + *
  3883. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  3884. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  3885. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  3886. + * the GNU General Public License for more details.
  3887. + *
  3888. + * You should have received a copy of the GNU General Public License
  3889. + * along with the Ubicom32 Linux Kernel Port. If not,
  3890. + * see <http://www.gnu.org/licenses/>.
  3891. + *
  3892. + * Ubicom32 implementation derived from (with many thanks):
  3893. + * arch/m68knommu
  3894. + * arch/blackfin
  3895. + * arch/parisc
  3896. + */
  3897. +#ifndef _ASM_UBICOM32_ERRNO_H
  3898. +#define _ASM_UBICOM32_ERRNO_H
  3899. +
  3900. +#include <asm-generic/errno.h>
  3901. +
  3902. +#endif /* _ASM_UBICOM32_ERRNO_H */
  3903. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/fb.h linux-2.6.28.10/arch/ubicom32/include/asm/fb.h
  3904. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/fb.h 1970-01-01 02:00:00.000000000 +0200
  3905. +++ linux-2.6.28.10/arch/ubicom32/include/asm/fb.h 2009-08-06 10:31:02.000000000 +0300
  3906. @@ -0,0 +1,39 @@
  3907. +/*
  3908. + * arch/ubicom32/include/asm/fb.h
  3909. + * Definition of fb_is_primary_device() for Ubicom32 architecture.
  3910. + *
  3911. + * (C) Copyright 2009, Ubicom, Inc.
  3912. + *
  3913. + * This file is part of the Ubicom32 Linux Kernel Port.
  3914. + *
  3915. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  3916. + * it and/or modify it under the terms of the GNU General Public License
  3917. + * as published by the Free Software Foundation, either version 2 of the
  3918. + * License, or (at your option) any later version.
  3919. + *
  3920. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  3921. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  3922. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  3923. + * the GNU General Public License for more details.
  3924. + *
  3925. + * You should have received a copy of the GNU General Public License
  3926. + * along with the Ubicom32 Linux Kernel Port. If not,
  3927. + * see <http://www.gnu.org/licenses/>.
  3928. + *
  3929. + * Ubicom32 implementation derived from (with many thanks):
  3930. + * arch/m68knommu
  3931. + * arch/blackfin
  3932. + * arch/parisc
  3933. + */
  3934. +#ifndef _ASM_UBICOM32_FB_H
  3935. +#define _ASM_UBICOM32_FB_H
  3936. +#include <linux/fb.h>
  3937. +
  3938. +#define fb_pgprotect(...) do {} while (0)
  3939. +
  3940. +static inline int fb_is_primary_device(struct fb_info *info)
  3941. +{
  3942. + return 0;
  3943. +}
  3944. +
  3945. +#endif /* _ASM_UBICOM32_FB_H */
  3946. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/fcntl.h linux-2.6.28.10/arch/ubicom32/include/asm/fcntl.h
  3947. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/fcntl.h 1970-01-01 02:00:00.000000000 +0200
  3948. +++ linux-2.6.28.10/arch/ubicom32/include/asm/fcntl.h 2009-08-06 10:31:02.000000000 +0300
  3949. @@ -0,0 +1,38 @@
  3950. +/*
  3951. + * arch/ubicom32/include/asm/fcntl.h
  3952. + * File control bit definitions for Ubicom32 architecture.
  3953. + *
  3954. + * (C) Copyright 2009, Ubicom, Inc.
  3955. + *
  3956. + * This file is part of the Ubicom32 Linux Kernel Port.
  3957. + *
  3958. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  3959. + * it and/or modify it under the terms of the GNU General Public License
  3960. + * as published by the Free Software Foundation, either version 2 of the
  3961. + * License, or (at your option) any later version.
  3962. + *
  3963. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  3964. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  3965. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  3966. + * the GNU General Public License for more details.
  3967. + *
  3968. + * You should have received a copy of the GNU General Public License
  3969. + * along with the Ubicom32 Linux Kernel Port. If not,
  3970. + * see <http://www.gnu.org/licenses/>.
  3971. + *
  3972. + * Ubicom32 implementation derived from (with many thanks):
  3973. + * arch/m68knommu
  3974. + * arch/blackfin
  3975. + * arch/parisc
  3976. + */
  3977. +#ifndef _ASM_UBICOM32_FCNTL_H
  3978. +#define _ASM_UBICOM32_FCNTL_H
  3979. +
  3980. +#define O_DIRECTORY 040000 /* must be a directory */
  3981. +#define O_NOFOLLOW 0100000 /* don't follow links */
  3982. +#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
  3983. +#define O_LARGEFILE 0400000
  3984. +
  3985. +#include <asm-generic/fcntl.h>
  3986. +
  3987. +#endif /* _ASM_UBICOM32_FCNTL_H */
  3988. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/flat.h linux-2.6.28.10/arch/ubicom32/include/asm/flat.h
  3989. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/flat.h 1970-01-01 02:00:00.000000000 +0200
  3990. +++ linux-2.6.28.10/arch/ubicom32/include/asm/flat.h 2009-08-06 10:31:02.000000000 +0300
  3991. @@ -0,0 +1,73 @@
  3992. +/*
  3993. + * arch/ubicom32/include/asm/flat.h
  3994. + * Definitions to support flat-format executables.
  3995. + *
  3996. + * (C) Copyright 2009, Ubicom, Inc.
  3997. + *
  3998. + * This file is part of the Ubicom32 Linux Kernel Port.
  3999. + *
  4000. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  4001. + * it and/or modify it under the terms of the GNU General Public License
  4002. + * as published by the Free Software Foundation, either version 2 of the
  4003. + * License, or (at your option) any later version.
  4004. + *
  4005. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  4006. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  4007. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  4008. + * the GNU General Public License for more details.
  4009. + *
  4010. + * You should have received a copy of the GNU General Public License
  4011. + * along with the Ubicom32 Linux Kernel Port. If not,
  4012. + * see <http://www.gnu.org/licenses/>.
  4013. + *
  4014. + * Ubicom32 implementation derived from (with many thanks):
  4015. + * arch/m68knommu
  4016. + * arch/blackfin
  4017. + * arch/parisc
  4018. + */
  4019. +
  4020. +#ifndef _ASM_UBICOM32_FLAT_H
  4021. +#define _ASM_UBICOM32_FLAT_H
  4022. +
  4023. +#define ARCH_FLAT_ALIGN 0x80
  4024. +#define ARCH_FLAT_ALIGN_TEXT 1
  4025. +
  4026. +#define R_UBICOM32_32 2
  4027. +#define R_UBICOM32_HI24 7
  4028. +#define R_UBICOM32_LO7_S 8
  4029. +#define R_UBICOM32_LO7_2_S 9
  4030. +#define R_UBICOM32_LO7_4_S 10
  4031. +#define R_UBICOM32_LO7_D 11
  4032. +#define R_UBICOM32_LO7_2_D 12
  4033. +#define R_UBICOM32_LO7_4_D 13
  4034. +#define R_UBICOM32_LO7_CALLI 15
  4035. +#define R_UBICOM32_LO16_CALLI 16
  4036. +
  4037. +extern void ubicom32_flat_put_addr_at_rp(unsigned long *rp, u32_t val, u32_t rval, unsigned long *p);
  4038. +extern unsigned long ubicom32_flat_get_addr_from_rp(unsigned long *rp, u32_t relval, u32_t flags, unsigned long *p);
  4039. +
  4040. +#define flat_stack_align(sp) /* nothing needed */
  4041. +#define flat_argvp_envp_on_stack() 1
  4042. +#define flat_old_ram_flag(flags) (flags)
  4043. +#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
  4044. +#define flat_get_addr_from_rp(rp, relval, flags, p) (ubicom32_flat_get_addr_from_rp(rp, relval,flags, p))
  4045. +#define flat_put_addr_at_rp(rp, val, relval) do {ubicom32_flat_put_addr_at_rp(rp, val, relval, &persistent);} while(0)
  4046. +#define flat_get_relocate_addr(rel) ((persistent) ? (persistent & 0x07ffffff) : (rel & 0x07ffffff))
  4047. +
  4048. +static inline int flat_set_persistent(unsigned int relval, unsigned long *p)
  4049. +{
  4050. + if (*p) {
  4051. + return 0;
  4052. + } else {
  4053. + if ((relval >> 27) != R_UBICOM32_32) {
  4054. + /*
  4055. + * Something other than UBICOM32_32. The next entry has the relocation.
  4056. + */
  4057. + *p = relval;
  4058. + return 1;
  4059. + }
  4060. + }
  4061. + return 0;
  4062. +}
  4063. +
  4064. +#endif /* _ASM_UBICOM32_FLAT_H */
  4065. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/fpu.h linux-2.6.28.10/arch/ubicom32/include/asm/fpu.h
  4066. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/fpu.h 1970-01-01 02:00:00.000000000 +0200
  4067. +++ linux-2.6.28.10/arch/ubicom32/include/asm/fpu.h 2009-08-06 10:31:02.000000000 +0300
  4068. @@ -0,0 +1,37 @@
  4069. +/*
  4070. + * arch/ubicom32/include/asm/fpu.h
  4071. + * Floating point state definitions for Ubicom32 architecture.
  4072. + *
  4073. + * (C) Copyright 2009, Ubicom, Inc.
  4074. + *
  4075. + * This file is part of the Ubicom32 Linux Kernel Port.
  4076. + *
  4077. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  4078. + * it and/or modify it under the terms of the GNU General Public License
  4079. + * as published by the Free Software Foundation, either version 2 of the
  4080. + * License, or (at your option) any later version.
  4081. + *
  4082. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  4083. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  4084. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  4085. + * the GNU General Public License for more details.
  4086. + *
  4087. + * You should have received a copy of the GNU General Public License
  4088. + * along with the Ubicom32 Linux Kernel Port. If not,
  4089. + * see <http://www.gnu.org/licenses/>.
  4090. + *
  4091. + * Ubicom32 implementation derived from (with many thanks):
  4092. + * arch/m68knommu
  4093. + * arch/blackfin
  4094. + * arch/parisc
  4095. + */
  4096. +#ifndef _ASM_UBICOM32_FPU_H
  4097. +#define _ASM_UBICOM32_FPU_H
  4098. +
  4099. +/*
  4100. + * MAX floating point unit state size (FSAVE/FRESTORE)
  4101. + */
  4102. +/* No FP unit present then... */
  4103. +#define FPSTATESIZE (2) /* dummy size */
  4104. +
  4105. +#endif /* _ASM_UBICOM32_FPU_H */
  4106. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/futex.h linux-2.6.28.10/arch/ubicom32/include/asm/futex.h
  4107. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/futex.h 1970-01-01 02:00:00.000000000 +0200
  4108. +++ linux-2.6.28.10/arch/ubicom32/include/asm/futex.h 2009-08-06 10:31:02.000000000 +0300
  4109. @@ -0,0 +1,33 @@
  4110. +/*
  4111. + * arch/ubicom32/include/asm/futex.h
  4112. + * Generic futex.h for Ubicom32 architecture.
  4113. + *
  4114. + * (C) Copyright 2009, Ubicom, Inc.
  4115. + *
  4116. + * This file is part of the Ubicom32 Linux Kernel Port.
  4117. + *
  4118. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  4119. + * it and/or modify it under the terms of the GNU General Public License
  4120. + * as published by the Free Software Foundation, either version 2 of the
  4121. + * License, or (at your option) any later version.
  4122. + *
  4123. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  4124. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  4125. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  4126. + * the GNU General Public License for more details.
  4127. + *
  4128. + * You should have received a copy of the GNU General Public License
  4129. + * along with the Ubicom32 Linux Kernel Port. If not,
  4130. + * see <http://www.gnu.org/licenses/>.
  4131. + *
  4132. + * Ubicom32 implementation derived from (with many thanks):
  4133. + * arch/m68knommu
  4134. + * arch/blackfin
  4135. + * arch/parisc
  4136. + */
  4137. +#ifndef _ASM_UBICOM32_FUTEX_H
  4138. +#define _ASM_UBICOM32_FUTEX_H
  4139. +
  4140. +#include <asm-generic/futex.h>
  4141. +
  4142. +#endif /* _ASM_UBICOM32_FUTEX_H */
  4143. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/gpio.h linux-2.6.28.10/arch/ubicom32/include/asm/gpio.h
  4144. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/gpio.h 1970-01-01 02:00:00.000000000 +0200
  4145. +++ linux-2.6.28.10/arch/ubicom32/include/asm/gpio.h 2009-08-12 13:08:37.000000000 +0300
  4146. @@ -0,0 +1,451 @@
  4147. +/*
  4148. + * arch/ubicom32/include/asm/gpio.h
  4149. + * Definitions for GPIO operations on Ubicom32 architecture.
  4150. + *
  4151. + * (C) Copyright 2009, Ubicom, Inc.
  4152. + *
  4153. + * This file is part of the Ubicom32 Linux Kernel Port.
  4154. + *
  4155. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  4156. + * it and/or modify it under the terms of the GNU General Public License
  4157. + * as published by the Free Software Foundation, either version 2 of the
  4158. + * License, or (at your option) any later version.
  4159. + *
  4160. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  4161. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  4162. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  4163. + * the GNU General Public License for more details.
  4164. + *
  4165. + * You should have received a copy of the GNU General Public License
  4166. + * along with the Ubicom32 Linux Kernel Port. If not,
  4167. + * see <http://www.gnu.org/licenses/>.
  4168. + *
  4169. + * Ubicom32 implementation derived from (with many thanks):
  4170. + * arch/m68knommu
  4171. + * arch/blackfin
  4172. + * arch/parisc
  4173. + */
  4174. +#ifndef _ASM_UBICOM32_GPIO_H
  4175. +#define _ASM_UBICOM32_GPIO_H
  4176. +
  4177. +#include <linux/compiler.h>
  4178. +#include <asm/irq.h>
  4179. +
  4180. +#include <asm/ip5000.h>
  4181. +
  4182. +#define ARCH_NR_GPIOS 512
  4183. +#define MAX_UBICOM_ONCHIP_GPIO (9 * 32)
  4184. +
  4185. +/*
  4186. + * Macros for manipulating GPIO numbers
  4187. + */
  4188. +#define gpio_bit(gn) (1 << (gn & 0x1f))
  4189. +#define gpio_bank(gn) (gn >> 5)
  4190. +
  4191. +#define gpio_pin_index(gn) (gn & 0x1f)
  4192. +#define gpio_port_index(gn) (gn >> 5)
  4193. +
  4194. +#define GPIO_RA_0 ((32 * 0) + 0)
  4195. +#define GPIO_RA_1 ((32 * 0) + 1)
  4196. +#define GPIO_RA_2 ((32 * 0) + 2)
  4197. +#define GPIO_RA_3 ((32 * 0) + 3)
  4198. +#define GPIO_RA_4 ((32 * 0) + 4)
  4199. +#define GPIO_RA_5 ((32 * 0) + 5)
  4200. +#define GPIO_RA_6 ((32 * 0) + 6)
  4201. +#define GPIO_RA_7 ((32 * 0) + 7)
  4202. +
  4203. +#define GPIO_RB_0 ((32 * 1) + 0)
  4204. +#define GPIO_RB_1 ((32 * 1) + 1)
  4205. +#define GPIO_RB_2 ((32 * 1) + 2)
  4206. +#define GPIO_RB_3 ((32 * 1) + 3)
  4207. +#define GPIO_RB_4 ((32 * 1) + 4)
  4208. +#define GPIO_RB_5 ((32 * 1) + 5)
  4209. +#define GPIO_RB_6 ((32 * 1) + 6)
  4210. +#define GPIO_RB_7 ((32 * 1) + 7)
  4211. +#define GPIO_RB_8 ((32 * 1) + 8)
  4212. +#define GPIO_RB_9 ((32 * 1) + 9)
  4213. +#define GPIO_RB_10 ((32 * 1) + 10)
  4214. +#define GPIO_RB_11 ((32 * 1) + 11)
  4215. +#define GPIO_RB_12 ((32 * 1) + 12)
  4216. +#define GPIO_RB_13 ((32 * 1) + 13)
  4217. +#define GPIO_RB_14 ((32 * 1) + 14)
  4218. +#define GPIO_RB_15 ((32 * 1) + 15)
  4219. +#define GPIO_RB_16 ((32 * 1) + 16)
  4220. +#define GPIO_RB_17 ((32 * 1) + 17)
  4221. +#define GPIO_RB_18 ((32 * 1) + 18)
  4222. +#define GPIO_RB_19 ((32 * 1) + 19)
  4223. +
  4224. +#define GPIO_RC_0 ((32 * 2) + 0)
  4225. +#define GPIO_RC_1 ((32 * 2) + 1)
  4226. +#define GPIO_RC_2 ((32 * 2) + 2)
  4227. +#define GPIO_RC_3 ((32 * 2) + 3)
  4228. +#define GPIO_RC_4 ((32 * 2) + 4)
  4229. +#define GPIO_RC_5 ((32 * 2) + 5)
  4230. +#define GPIO_RC_6 ((32 * 2) + 6)
  4231. +#define GPIO_RC_7 ((32 * 2) + 7)
  4232. +#define GPIO_RC_8 ((32 * 2) + 8)
  4233. +#define GPIO_RC_9 ((32 * 2) + 9)
  4234. +#define GPIO_RC_10 ((32 * 2) + 10)
  4235. +#define GPIO_RC_11 ((32 * 2) + 11)
  4236. +#define GPIO_RC_12 ((32 * 2) + 12)
  4237. +#define GPIO_RC_13 ((32 * 2) + 13)
  4238. +#define GPIO_RC_14 ((32 * 2) + 14)
  4239. +#define GPIO_RC_15 ((32 * 2) + 15)
  4240. +#define GPIO_RC_16 ((32 * 2) + 16)
  4241. +#define GPIO_RC_17 ((32 * 2) + 17)
  4242. +#define GPIO_RC_18 ((32 * 2) + 18)
  4243. +#define GPIO_RC_19 ((32 * 2) + 19)
  4244. +#define GPIO_RC_20 ((32 * 2) + 20)
  4245. +#define GPIO_RC_21 ((32 * 2) + 21)
  4246. +#define GPIO_RC_22 ((32 * 2) + 22)
  4247. +#define GPIO_RC_23 ((32 * 2) + 23)
  4248. +#define GPIO_RC_24 ((32 * 2) + 24)
  4249. +#define GPIO_RC_25 ((32 * 2) + 25)
  4250. +#define GPIO_RC_26 ((32 * 2) + 26)
  4251. +#define GPIO_RC_27 ((32 * 2) + 27)
  4252. +#define GPIO_RC_28 ((32 * 2) + 28)
  4253. +#define GPIO_RC_29 ((32 * 2) + 29)
  4254. +#define GPIO_RC_30 ((32 * 2) + 30)
  4255. +#define GPIO_RC_31 ((32 * 2) + 31)
  4256. +
  4257. +#define GPIO_RD_0 ((32 * 3) + 0)
  4258. +#define GPIO_RD_1 ((32 * 3) + 1)
  4259. +#define GPIO_RD_2 ((32 * 3) + 2)
  4260. +#define GPIO_RD_3 ((32 * 3) + 3)
  4261. +#define GPIO_RD_4 ((32 * 3) + 4)
  4262. +#define GPIO_RD_5 ((32 * 3) + 5)
  4263. +#define GPIO_RD_6 ((32 * 3) + 6)
  4264. +#define GPIO_RD_7 ((32 * 3) + 7)
  4265. +#define GPIO_RD_8 ((32 * 3) + 8)
  4266. +#define GPIO_RD_9 ((32 * 3) + 9)
  4267. +#define GPIO_RD_10 ((32 * 3) + 10)
  4268. +#define GPIO_RD_11 ((32 * 3) + 11)
  4269. +
  4270. +#define GPIO_RE_0 ((32 * 4) + 0)
  4271. +#define GPIO_RE_1 ((32 * 4) + 1)
  4272. +#define GPIO_RE_2 ((32 * 4) + 2)
  4273. +#define GPIO_RE_3 ((32 * 4) + 3)
  4274. +#define GPIO_RE_4 ((32 * 4) + 4)
  4275. +#define GPIO_RE_5 ((32 * 4) + 5)
  4276. +#define GPIO_RE_6 ((32 * 4) + 6)
  4277. +#define GPIO_RE_7 ((32 * 4) + 7)
  4278. +
  4279. +#define GPIO_RF_0 ((32 * 5) + 0)
  4280. +#define GPIO_RF_1 ((32 * 5) + 1)
  4281. +#define GPIO_RF_2 ((32 * 5) + 2)
  4282. +#define GPIO_RF_3 ((32 * 5) + 3)
  4283. +#define GPIO_RF_4 ((32 * 5) + 4)
  4284. +#define GPIO_RF_5 ((32 * 5) + 5)
  4285. +#define GPIO_RF_6 ((32 * 5) + 6)
  4286. +#define GPIO_RF_7 ((32 * 5) + 7)
  4287. +#define GPIO_RF_8 ((32 * 5) + 8)
  4288. +#define GPIO_RF_9 ((32 * 5) + 9)
  4289. +#define GPIO_RF_10 ((32 * 5) + 10)
  4290. +#define GPIO_RF_11 ((32 * 5) + 11)
  4291. +#define GPIO_RF_12 ((32 * 5) + 12)
  4292. +#define GPIO_RF_13 ((32 * 5) + 13)
  4293. +#define GPIO_RF_14 ((32 * 5) + 14)
  4294. +#define GPIO_RF_15 ((32 * 5) + 15)
  4295. +
  4296. +#define GPIO_RG_0 ((32 * 6) + 0)
  4297. +#define GPIO_RG_1 ((32 * 6) + 1)
  4298. +#define GPIO_RG_2 ((32 * 6) + 2)
  4299. +#define GPIO_RG_3 ((32 * 6) + 3)
  4300. +#define GPIO_RG_4 ((32 * 6) + 4)
  4301. +#define GPIO_RG_5 ((32 * 6) + 5)
  4302. +#define GPIO_RG_6 ((32 * 6) + 6)
  4303. +#define GPIO_RG_7 ((32 * 6) + 7)
  4304. +#define GPIO_RG_8 ((32 * 6) + 8)
  4305. +#define GPIO_RG_9 ((32 * 6) + 9)
  4306. +#define GPIO_RG_10 ((32 * 6) + 10)
  4307. +#define GPIO_RG_11 ((32 * 6) + 11)
  4308. +#define GPIO_RG_12 ((32 * 6) + 12)
  4309. +#define GPIO_RG_13 ((32 * 6) + 13)
  4310. +#define GPIO_RG_14 ((32 * 6) + 14)
  4311. +#define GPIO_RG_15 ((32 * 6) + 15)
  4312. +#define GPIO_RG_16 ((32 * 6) + 16)
  4313. +#define GPIO_RG_17 ((32 * 6) + 17)
  4314. +#define GPIO_RG_18 ((32 * 6) + 18)
  4315. +#define GPIO_RG_19 ((32 * 6) + 19)
  4316. +#define GPIO_RG_20 ((32 * 6) + 20)
  4317. +#define GPIO_RG_21 ((32 * 6) + 21)
  4318. +#define GPIO_RG_22 ((32 * 6) + 22)
  4319. +#define GPIO_RG_23 ((32 * 6) + 23)
  4320. +#define GPIO_RG_24 ((32 * 6) + 24)
  4321. +#define GPIO_RG_25 ((32 * 6) + 25)
  4322. +#define GPIO_RG_26 ((32 * 6) + 26)
  4323. +#define GPIO_RG_27 ((32 * 6) + 27)
  4324. +#define GPIO_RG_28 ((32 * 6) + 28)
  4325. +#define GPIO_RG_29 ((32 * 6) + 29)
  4326. +#define GPIO_RG_30 ((32 * 6) + 30)
  4327. +#define GPIO_RG_31 ((32 * 6) + 31)
  4328. +
  4329. +#define GPIO_RH_0 ((32 * 7) + 0)
  4330. +#define GPIO_RH_1 ((32 * 7) + 1)
  4331. +#define GPIO_RH_2 ((32 * 7) + 2)
  4332. +#define GPIO_RH_3 ((32 * 7) + 3)
  4333. +#define GPIO_RH_4 ((32 * 7) + 4)
  4334. +#define GPIO_RH_5 ((32 * 7) + 5)
  4335. +#define GPIO_RH_6 ((32 * 7) + 6)
  4336. +#define GPIO_RH_7 ((32 * 7) + 7)
  4337. +#define GPIO_RH_8 ((32 * 7) + 8)
  4338. +#define GPIO_RH_9 ((32 * 7) + 9)
  4339. +
  4340. +#define GPIO_RI_0 ((32 * 8) + 0)
  4341. +#define GPIO_RI_1 ((32 * 8) + 1)
  4342. +#define GPIO_RI_2 ((32 * 8) + 2)
  4343. +#define GPIO_RI_3 ((32 * 8) + 3)
  4344. +#define GPIO_RI_4 ((32 * 8) + 4)
  4345. +#define GPIO_RI_5 ((32 * 8) + 5)
  4346. +#define GPIO_RI_6 ((32 * 8) + 6)
  4347. +#define GPIO_RI_7 ((32 * 8) + 7)
  4348. +#define GPIO_RI_8 ((32 * 8) + 8)
  4349. +#define GPIO_RI_9 ((32 * 8) + 9)
  4350. +#define GPIO_RI_10 ((32 * 8) + 10)
  4351. +#define GPIO_RI_11 ((32 * 8) + 11)
  4352. +#define GPIO_RI_12 ((32 * 8) + 12)
  4353. +#define GPIO_RI_13 ((32 * 8) + 13)
  4354. +
  4355. +/*
  4356. + * The following section defines extra GPIO available to some boards.
  4357. + * These GPIO are generally external to the processor (i.e. SPI/I2C
  4358. + * expander chips).
  4359. + *
  4360. + * Note that these defines show all possible GPIO available, however,
  4361. + * depending on the actual board configuration, some GPIO are not
  4362. + * available for use.
  4363. + */
  4364. +#ifdef CONFIG_IP7500MEDIA
  4365. +/*
  4366. + * U15
  4367. + */
  4368. +#define IP7500MEDIA_U15_BASE (32 * 10)
  4369. +#define IP7500MEDIA_IO0 (IP7500MEDIA_U15_BASE + 0)
  4370. +#define IP7500MEDIA_IO1 (IP7500MEDIA_U15_BASE + 1)
  4371. +#define IP7500MEDIA_IO2 (IP7500MEDIA_U15_BASE + 2)
  4372. +#define IP7500MEDIA_IO3 (IP7500MEDIA_U15_BASE + 3)
  4373. +#define IP7500MEDIA_IO4 (IP7500MEDIA_U15_BASE + 4)
  4374. +#define IP7500MEDIA_IO5 (IP7500MEDIA_U15_BASE + 5)
  4375. +#define IP7500MEDIA_IO6 (IP7500MEDIA_U15_BASE + 6)
  4376. +#define IP7500MEDIA_IO7 (IP7500MEDIA_U15_BASE + 7)
  4377. +
  4378. +/*
  4379. + * U16
  4380. + */
  4381. +#define IP7500MEDIA_U16_BASE (32 * 11)
  4382. +#define IP7500MEDIA_IO8 (IP7500MEDIA_U16_BASE + 0)
  4383. +#define IP7500MEDIA_IO9 (IP7500MEDIA_U16_BASE + 1)
  4384. +#define IP7500MEDIA_IO10 (IP7500MEDIA_U16_BASE + 2)
  4385. +#define IP7500MEDIA_IO11 (IP7500MEDIA_U16_BASE + 3)
  4386. +#define IP7500MEDIA_IO12 (IP7500MEDIA_U16_BASE + 4)
  4387. +#define IP7500MEDIA_IO13 (IP7500MEDIA_U16_BASE + 5)
  4388. +#define IP7500MEDIA_IO14 (IP7500MEDIA_U16_BASE + 6)
  4389. +#define IP7500MEDIA_IO15 (IP7500MEDIA_U16_BASE + 7)
  4390. +
  4391. +/*
  4392. + * U17
  4393. + */
  4394. +#define IP7500MEDIA_U17_BASE (32 * 12)
  4395. +#define IP7500MEDIA_IO16 (IP7500MEDIA_U17_BASE + 0)
  4396. +#define IP7500MEDIA_IO17 (IP7500MEDIA_U17_BASE + 1)
  4397. +#define IP7500MEDIA_IO18 (IP7500MEDIA_U17_BASE + 2)
  4398. +#define IP7500MEDIA_IO19 (IP7500MEDIA_U17_BASE + 3)
  4399. +#define IP7500MEDIA_IO20 (IP7500MEDIA_U17_BASE + 4)
  4400. +#define IP7500MEDIA_IO21 (IP7500MEDIA_U17_BASE + 5)
  4401. +#define IP7500MEDIA_IO22 (IP7500MEDIA_U17_BASE + 6)
  4402. +#define IP7500MEDIA_IO23 (IP7500MEDIA_U17_BASE + 7)
  4403. +
  4404. +/*
  4405. + * U18
  4406. + */
  4407. +#define IP7500MEDIA_U18_BASE (32 * 13)
  4408. +#define IP7500MEDIA_IO24 (IP7500MEDIA_U18_BASE + 0)
  4409. +#define IP7500MEDIA_IO25 (IP7500MEDIA_U18_BASE + 1)
  4410. +#define IP7500MEDIA_IO26 (IP7500MEDIA_U18_BASE + 2)
  4411. +#define IP7500MEDIA_IO27 (IP7500MEDIA_U18_BASE + 3)
  4412. +#define IP7500MEDIA_IO28 (IP7500MEDIA_U18_BASE + 4)
  4413. +#define IP7500MEDIA_IO29 (IP7500MEDIA_U18_BASE + 5)
  4414. +#define IP7500MEDIA_IO30 (IP7500MEDIA_U18_BASE + 6)
  4415. +#define IP7500MEDIA_IO31 (IP7500MEDIA_U18_BASE + 7)
  4416. +#endif
  4417. +
  4418. +#ifdef CONFIG_IP7145DPF
  4419. +/*
  4420. + * U48
  4421. + */
  4422. +#define IP7145DPF_U48_BASE (32 * 10)
  4423. +#define IP7145DPF_IO0 (IP7145DPF_U48_BASE + 0)
  4424. +#define IP7145DPF_IO1 (IP7145DPF_U48_BASE + 1)
  4425. +#define IP7145DPF_IO2 (IP7145DPF_U48_BASE + 2)
  4426. +#define IP7145DPF_IO3 (IP7145DPF_U48_BASE + 3)
  4427. +#define IP7145DPF_IO4 (IP7145DPF_U48_BASE + 4)
  4428. +#define IP7145DPF_IO5 (IP7145DPF_U48_BASE + 5)
  4429. +#define IP7145DPF_IO6 (IP7145DPF_U48_BASE + 6)
  4430. +#define IP7145DPF_IO7 (IP7145DPF_U48_BASE + 7)
  4431. +
  4432. +/*
  4433. + * U72
  4434. + */
  4435. +#define IP7145DPF_U72_BASE (32 * 11)
  4436. +#define IP7145DPF_IOB0 (IP7145DPF_U72_BASE + 0)
  4437. +#define IP7145DPF_IOB1 (IP7145DPF_U72_BASE + 1)
  4438. +#define IP7145DPF_IOB2 (IP7145DPF_U72_BASE + 2)
  4439. +#define IP7145DPF_IOB3 (IP7145DPF_U72_BASE + 3)
  4440. +#define IP7145DPF_IOB4 (IP7145DPF_U72_BASE + 4)
  4441. +#define IP7145DPF_IOB5 (IP7145DPF_U72_BASE + 5)
  4442. +#define IP7145DPF_IOB6 (IP7145DPF_U72_BASE + 6)
  4443. +#define IP7145DPF_IOB7 (IP7145DPF_U72_BASE + 7)
  4444. +#endif
  4445. +
  4446. +#include <asm-generic/gpio.h>
  4447. +
  4448. +/*
  4449. + * The following macros bypass gpiolib to generate direct references
  4450. + * to the port registers. These assume, minimally, that either
  4451. + * gpio_direction_input() or gpio_direction_output() have already been
  4452. + * called to setup the pin direction and to enable the pin function to
  4453. + * be gpio. These macros generate the hardware port address based on
  4454. + * the assumption that all ports are 32 bits wide (even though we know
  4455. + * they are not). This is so we can efficiently turn pin numbers into
  4456. + * port addresses without a lookup.
  4457. + *
  4458. + * These operations must be done in one instruction to prevent clobbering
  4459. + * other thread's accesses to the same port.
  4460. + */
  4461. +#define UBICOM32_GPIO_ENABLE(pin) \
  4462. + do { \
  4463. + asm volatile ("or.4 (%[port]), (%[port]), %[mask]\n\t" \
  4464. + : \
  4465. + : [port] "a" (&UBICOM32_IO_PORT(IO_BASE + (gpio_bank(pin) << 12))->gpio_mask), \
  4466. + [mask] "d" (gpio_bit(pin)) \
  4467. + : "cc", "memory" \
  4468. + ); \
  4469. + } while (0);
  4470. +
  4471. +#define UBICOM32_GPIO_DISABLE(pin) \
  4472. + do { \
  4473. + asm volatile ("and.4 (%[port]), (%[port]), %[mask]\n\t" \
  4474. + : \
  4475. + : [port] "a" (&UBICOM32_IO_PORT(IO_BASE + (gpio_bank(pin) << 12))->gpio_mask), \
  4476. + [mask] "d" (~gpio_bit(pin)) \
  4477. + : "cc", "memory" \
  4478. + ); \
  4479. + } while (0);
  4480. +
  4481. +#define UBICOM32_GPIO_SET_PIN_INPUT(pin) \
  4482. + do { \
  4483. + asm volatile ("and.4 (%[port]), (%[port]), %[mask]\n\t" \
  4484. + : \
  4485. + : [port] "a" (&UBICOM32_IO_PORT(IO_BASE + (gpio_bank(pin) << 12))->gpio_ctl), \
  4486. + [mask] "d" (~gpio_bit(pin)) \
  4487. + : "cc", "memory" \
  4488. + ); \
  4489. + } while (0);
  4490. +
  4491. +#define UBICOM32_GPIO_SET_PIN_OUTPUT(pin) \
  4492. + do { \
  4493. + asm volatile ("or.4 (%[port]), (%[port]), %[mask]\n\t" \
  4494. + : \
  4495. + : [port] "a" (&UBICOM32_IO_PORT(IO_BASE + (gpio_bank(pin) << 12))->gpio_ctl), \
  4496. + [mask] "d" (gpio_bit(pin)) \
  4497. + : "cc", "memory" \
  4498. + ); \
  4499. + } while (0);
  4500. +
  4501. +#define UBICOM32_GPIO_SET_PIN_TOGGLE(pin) \
  4502. + do { \
  4503. + asm volatile ("xor.4 (%[port]), (%[port]), %[mask]\n\t" \
  4504. + : \
  4505. + : [port] "a" (&UBICOM32_IO_PORT(IO_BASE + (gpio_bank(pin) << 12))->gpio_out), \
  4506. + [mask] "d" (gpio_bit(pin)) \
  4507. + : "cc", "memory" \
  4508. + ); \
  4509. + } while (0);
  4510. +
  4511. +#define UBICOM32_GPIO_SET_PIN_HIGH(pin) \
  4512. + do { \
  4513. + asm volatile ("or.4 (%[port]), (%[port]), %[mask]\n\t" \
  4514. + : \
  4515. + : [port] "a" (&UBICOM32_IO_PORT(IO_BASE + (gpio_bank(pin) << 12))->gpio_out), \
  4516. + [mask] "d" (gpio_bit(pin)) \
  4517. + : "cc", "memory" \
  4518. + ); \
  4519. + } while (0);
  4520. +
  4521. +#define UBICOM32_GPIO_SET_PIN_LOW(pin) \
  4522. + do { \
  4523. + asm volatile ("and.4 (%[port]), (%[port]), %[mask]\n\t" \
  4524. + : \
  4525. + : [port] "a" (&UBICOM32_IO_PORT(IO_BASE + (gpio_bank(pin) << 12))->gpio_out), \
  4526. + [mask] "d" (~gpio_bit(pin)) \
  4527. + : "cc", "memory" \
  4528. + ); \
  4529. + } while (0);
  4530. +
  4531. +#define UBICOM32_GPIO_SET_PIN(pin, val) \
  4532. + if ( val ) { \
  4533. + UBICOM32_GPIO_SET_PIN_HIGH(pin); \
  4534. + } else { \
  4535. + UBICOM32_GPIO_SET_PIN_LOW(pin); \
  4536. + }
  4537. +
  4538. +#define UBICOM32_GPIO_GET_PIN(pin) \
  4539. + (0 != (UBICOM32_IO_PORT(IO_BASE + (gpio_bank(pin) << 12))->gpio_in \
  4540. + & gpio_bit(pin)))
  4541. +
  4542. +
  4543. +static inline int gpio_get_value(unsigned gpio)
  4544. +{
  4545. + if (gpio <= MAX_UBICOM_ONCHIP_GPIO)
  4546. + return UBICOM32_GPIO_GET_PIN(gpio);
  4547. + else
  4548. + return __gpio_get_value(gpio);
  4549. +}
  4550. +
  4551. +static inline void gpio_set_value(unsigned gpio, int value)
  4552. +{
  4553. + if (gpio <= MAX_UBICOM_ONCHIP_GPIO)
  4554. + {
  4555. + UBICOM32_GPIO_SET_PIN(gpio, value);
  4556. + }
  4557. + else
  4558. + {
  4559. + __gpio_set_value(gpio, value);
  4560. + }
  4561. +}
  4562. +
  4563. +static inline int gpio_cansleep(unsigned gpio)
  4564. +{
  4565. + return __gpio_cansleep(gpio);
  4566. +}
  4567. +
  4568. +static inline int gpio_to_irq(unsigned gpio)
  4569. +{
  4570. +#if defined(IP5000) || defined(IP5000_REV2)
  4571. + if ((gpio >= GPIO_RA_4) && (gpio <= GPIO_RA_6))
  4572. + return 25;
  4573. + else
  4574. + return -ENXIO;
  4575. +
  4576. +#elif defined(IP7000) || defined(IP7000_REV2)
  4577. + if ((gpio >= GPIO_RA_4) && (gpio <= GPIO_RA_6))
  4578. + return 44 + (gpio - GPIO_RA_4);
  4579. + else
  4580. + return -ENXIO;
  4581. +
  4582. +#else
  4583. + return -ENXIO;
  4584. +
  4585. +#endif
  4586. +}
  4587. +
  4588. +static inline int irq_to_gpio(unsigned gpio)
  4589. +{
  4590. + return -ENXIO;
  4591. +}
  4592. +
  4593. +extern struct ubicom32_io_port *ubi_gpio_get_port(unsigned gpio);
  4594. +
  4595. +extern int __init ubi_gpio_init(void);
  4596. +
  4597. +#endif /* _ASM_UBICOM32_GPIO_H */
  4598. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/hardirq.h linux-2.6.28.10/arch/ubicom32/include/asm/hardirq.h
  4599. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/hardirq.h 1970-01-01 02:00:00.000000000 +0200
  4600. +++ linux-2.6.28.10/arch/ubicom32/include/asm/hardirq.h 2009-08-06 10:31:02.000000000 +0300
  4601. @@ -0,0 +1,55 @@
  4602. +/*
  4603. + * arch/ubicom32/include/asm/hardirq.h
  4604. + * Definition of ack_bad_irq() for Ubicom32 architecture.
  4605. + *
  4606. + * (C) Copyright 2009, Ubicom, Inc.
  4607. + * Copyright (C) 1997, 98, 99, 2000, 01, 05 Ralf Baechle ([email protected])
  4608. + * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  4609. + * Copyright (C) 2001 MIPS Technologies, Inc.
  4610. + *
  4611. + * This file is part of the Ubicom32 Linux Kernel Port.
  4612. + *
  4613. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  4614. + * it and/or modify it under the terms of the GNU General Public License
  4615. + * as published by the Free Software Foundation, either version 2 of the
  4616. + * License, or (at your option) any later version.
  4617. + *
  4618. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  4619. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  4620. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  4621. + * the GNU General Public License for more details.
  4622. + *
  4623. + * You should have received a copy of the GNU General Public License
  4624. + * along with the Ubicom32 Linux Kernel Port. If not,
  4625. + * see <http://www.gnu.org/licenses/>.
  4626. + *
  4627. + * Ubicom32 implementation derived from (with many thanks):
  4628. + * arch/m68knommu
  4629. + * arch/blackfin
  4630. + * arch/parisc
  4631. + */
  4632. +#ifndef _ASM_UBICOM32_HARDIRQ_H
  4633. +#define _ASM_UBICOM32_HARDIRQ_H
  4634. +
  4635. +#include <linux/threads.h>
  4636. +#include <linux/irq.h>
  4637. +
  4638. +/*
  4639. + * The hardirq mask has to be large enough to have space
  4640. + * for potentially all IRQ sources in the system nesting
  4641. + * on a single CPU. For Ubicom32, we have 64 IRQ sources.
  4642. + */
  4643. +#define HARDIRQ_BITS 6
  4644. +#if (1 << HARDIRQ_BITS) < NR_IRQS
  4645. +# error HARDIRQ_BITS is too low!
  4646. +#endif
  4647. +
  4648. +typedef struct {
  4649. + unsigned int __softirq_pending;
  4650. +} ____cacheline_aligned irq_cpustat_t;
  4651. +
  4652. +#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
  4653. +
  4654. +extern void ack_bad_irq(unsigned int irq);
  4655. +
  4656. +#endif /* _ASM_UBICOM32_HARDIRQ_H */
  4657. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/hw_irq.h linux-2.6.28.10/arch/ubicom32/include/asm/hw_irq.h
  4658. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/hw_irq.h 1970-01-01 02:00:00.000000000 +0200
  4659. +++ linux-2.6.28.10/arch/ubicom32/include/asm/hw_irq.h 2009-08-06 10:31:02.000000000 +0300
  4660. @@ -0,0 +1,31 @@
  4661. +/*
  4662. + * arch/ubicom32/include/asm/hw_irq.h
  4663. + * Ubicom32 architecture APIC support.
  4664. + *
  4665. + * (C) Copyright 2009, Ubicom, Inc.
  4666. + *
  4667. + * This file is part of the Ubicom32 Linux Kernel Port.
  4668. + *
  4669. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  4670. + * it and/or modify it under the terms of the GNU General Public License
  4671. + * as published by the Free Software Foundation, either version 2 of the
  4672. + * License, or (at your option) any later version.
  4673. + *
  4674. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  4675. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  4676. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  4677. + * the GNU General Public License for more details.
  4678. + *
  4679. + * You should have received a copy of the GNU General Public License
  4680. + * along with the Ubicom32 Linux Kernel Port. If not,
  4681. + * see <http://www.gnu.org/licenses/>.
  4682. + *
  4683. + * Ubicom32 implementation derived from (with many thanks):
  4684. + * arch/m68knommu
  4685. + * arch/blackfin
  4686. + * arch/parisc
  4687. + */
  4688. +#ifndef _ASM_UBICOM32_HW_IRQ_H
  4689. +#define _ASM_UBICOM32_HW_IRQ_H
  4690. +
  4691. +#endif /* _ASM_UBICOM32_HW_IRQ_H */
  4692. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/ioctl.h linux-2.6.28.10/arch/ubicom32/include/asm/ioctl.h
  4693. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/ioctl.h 1970-01-01 02:00:00.000000000 +0200
  4694. +++ linux-2.6.28.10/arch/ubicom32/include/asm/ioctl.h 2009-08-06 10:31:02.000000000 +0300
  4695. @@ -0,0 +1,33 @@
  4696. +/*
  4697. + * arch/ubicom32/include/asm/ioctl.h
  4698. + * Generic ioctl.h for Ubicom32 architecture.
  4699. + *
  4700. + * (C) Copyright 2009, Ubicom, Inc.
  4701. + *
  4702. + * This file is part of the Ubicom32 Linux Kernel Port.
  4703. + *
  4704. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  4705. + * it and/or modify it under the terms of the GNU General Public License
  4706. + * as published by the Free Software Foundation, either version 2 of the
  4707. + * License, or (at your option) any later version.
  4708. + *
  4709. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  4710. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  4711. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  4712. + * the GNU General Public License for more details.
  4713. + *
  4714. + * You should have received a copy of the GNU General Public License
  4715. + * along with the Ubicom32 Linux Kernel Port. If not,
  4716. + * see <http://www.gnu.org/licenses/>.
  4717. + *
  4718. + * Ubicom32 implementation derived from (with many thanks):
  4719. + * arch/m68knommu
  4720. + * arch/blackfin
  4721. + * arch/parisc
  4722. + */
  4723. +#ifndef _ASM_UBICOM32_IOCTL_H
  4724. +#define _ASM_UBICOM32_IOCTL_H
  4725. +
  4726. +#include <asm-generic/ioctl.h>
  4727. +
  4728. +#endif /* _ASM_UBICOM32_IOCTL_H */
  4729. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/ioctls.h linux-2.6.28.10/arch/ubicom32/include/asm/ioctls.h
  4730. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/ioctls.h 1970-01-01 02:00:00.000000000 +0200
  4731. +++ linux-2.6.28.10/arch/ubicom32/include/asm/ioctls.h 2009-08-06 10:31:02.000000000 +0300
  4732. @@ -0,0 +1,111 @@
  4733. +/*
  4734. + * arch/ubicom32/include/asm/ioctls.h
  4735. + * Definitions of ioctls for Ubicom32 architecture.
  4736. + *
  4737. + * (C) Copyright 2009, Ubicom, Inc.
  4738. + *
  4739. + * This file is part of the Ubicom32 Linux Kernel Port.
  4740. + *
  4741. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  4742. + * it and/or modify it under the terms of the GNU General Public License
  4743. + * as published by the Free Software Foundation, either version 2 of the
  4744. + * License, or (at your option) any later version.
  4745. + *
  4746. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  4747. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  4748. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  4749. + * the GNU General Public License for more details.
  4750. + *
  4751. + * You should have received a copy of the GNU General Public License
  4752. + * along with the Ubicom32 Linux Kernel Port. If not,
  4753. + * see <http://www.gnu.org/licenses/>.
  4754. + *
  4755. + * Ubicom32 implementation derived from (with many thanks):
  4756. + * arch/m68knommu
  4757. + * arch/blackfin
  4758. + * arch/parisc
  4759. + */
  4760. +#ifndef _ASM_UBICOM32_IOCTLS_H
  4761. +#define _ASM_UBICOM32_IOCTLS_H
  4762. +
  4763. +#include <asm/ioctl.h>
  4764. +
  4765. +/* 0x54 is just a magic number to make these relatively unique ('T') */
  4766. +
  4767. +#define TCGETS 0x5401
  4768. +#define TCSETS 0x5402
  4769. +#define TCSETSW 0x5403
  4770. +#define TCSETSF 0x5404
  4771. +#define TCGETA 0x5405
  4772. +#define TCSETA 0x5406
  4773. +#define TCSETAW 0x5407
  4774. +#define TCSETAF 0x5408
  4775. +#define TCSBRK 0x5409
  4776. +#define TCXONC 0x540A
  4777. +#define TCFLSH 0x540B
  4778. +#define TIOCEXCL 0x540C
  4779. +#define TIOCNXCL 0x540D
  4780. +#define TIOCSCTTY 0x540E
  4781. +#define TIOCGPGRP 0x540F
  4782. +#define TIOCSPGRP 0x5410
  4783. +#define TIOCOUTQ 0x5411
  4784. +#define TIOCSTI 0x5412
  4785. +#define TIOCGWINSZ 0x5413
  4786. +#define TIOCSWINSZ 0x5414
  4787. +#define TIOCMGET 0x5415
  4788. +#define TIOCMBIS 0x5416
  4789. +#define TIOCMBIC 0x5417
  4790. +#define TIOCMSET 0x5418
  4791. +#define TIOCGSOFTCAR 0x5419
  4792. +#define TIOCSSOFTCAR 0x541A
  4793. +#define FIONREAD 0x541B
  4794. +#define TIOCINQ FIONREAD
  4795. +#define TIOCLINUX 0x541C
  4796. +#define TIOCCONS 0x541D
  4797. +#define TIOCGSERIAL 0x541E
  4798. +#define TIOCSSERIAL 0x541F
  4799. +#define TIOCPKT 0x5420
  4800. +#define FIONBIO 0x5421
  4801. +#define TIOCNOTTY 0x5422
  4802. +#define TIOCSETD 0x5423
  4803. +#define TIOCGETD 0x5424
  4804. +#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
  4805. +#define TIOCSBRK 0x5427 /* BSD compatibility */
  4806. +#define TIOCCBRK 0x5428 /* BSD compatibility */
  4807. +#define TIOCGSID 0x5429 /* Return the session ID of FD */
  4808. +#define TCGETS2 _IOR('T',0x2A, struct termios2)
  4809. +#define TCSETS2 _IOW('T',0x2B, struct termios2)
  4810. +#define TCSETSW2 _IOW('T',0x2C, struct termios2)
  4811. +#define TCSETSF2 _IOW('T',0x2D, struct termios2)
  4812. +#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
  4813. +#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
  4814. +
  4815. +#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
  4816. +#define FIOCLEX 0x5451
  4817. +#define FIOASYNC 0x5452
  4818. +#define TIOCSERCONFIG 0x5453
  4819. +#define TIOCSERGWILD 0x5454
  4820. +#define TIOCSERSWILD 0x5455
  4821. +#define TIOCGLCKTRMIOS 0x5456
  4822. +#define TIOCSLCKTRMIOS 0x5457
  4823. +#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
  4824. +#define TIOCSERGETLSR 0x5459 /* Get line status register */
  4825. +#define TIOCSERGETMULTI 0x545A /* Get multiport config */
  4826. +#define TIOCSERSETMULTI 0x545B /* Set multiport config */
  4827. +
  4828. +#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
  4829. +#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
  4830. +#define FIOQSIZE 0x545E
  4831. +
  4832. +/* Used for packet mode */
  4833. +#define TIOCPKT_DATA 0
  4834. +#define TIOCPKT_FLUSHREAD 1
  4835. +#define TIOCPKT_FLUSHWRITE 2
  4836. +#define TIOCPKT_STOP 4
  4837. +#define TIOCPKT_START 8
  4838. +#define TIOCPKT_NOSTOP 16
  4839. +#define TIOCPKT_DOSTOP 32
  4840. +
  4841. +#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
  4842. +
  4843. +#endif /* _ASM_UBICOM32_IOCTLS_H */
  4844. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/io.h linux-2.6.28.10/arch/ubicom32/include/asm/io.h
  4845. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/io.h 1970-01-01 02:00:00.000000000 +0200
  4846. +++ linux-2.6.28.10/arch/ubicom32/include/asm/io.h 2009-08-06 10:31:02.000000000 +0300
  4847. @@ -0,0 +1,313 @@
  4848. +/*
  4849. + * arch/ubicom32/include/asm/io.h
  4850. + * I/O memory accessor functions for Ubicom32 architecture.
  4851. + *
  4852. + * (C) Copyright 2009, Ubicom, Inc.
  4853. + *
  4854. + * This file is part of the Ubicom32 Linux Kernel Port.
  4855. + *
  4856. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  4857. + * it and/or modify it under the terms of the GNU General Public License
  4858. + * as published by the Free Software Foundation, either version 2 of the
  4859. + * License, or (at your option) any later version.
  4860. + *
  4861. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  4862. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  4863. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  4864. + * the GNU General Public License for more details.
  4865. + *
  4866. + * You should have received a copy of the GNU General Public License
  4867. + * along with the Ubicom32 Linux Kernel Port. If not,
  4868. + * see <http://www.gnu.org/licenses/>.
  4869. + *
  4870. + * Ubicom32 implementation derived from (with many thanks):
  4871. + * arch/m68knommu
  4872. + * arch/blackfin
  4873. + * arch/parisc
  4874. + */
  4875. +#ifndef _ASM_UBICOM32_IO_H
  4876. +#define _ASM_UBICOM32_IO_H
  4877. +
  4878. +#ifdef __KERNEL__
  4879. +#include <linux/string.h>
  4880. +#include <linux/compiler.h>
  4881. +
  4882. +static inline unsigned short _swapw(volatile unsigned short v)
  4883. +{
  4884. + return ((v << 8) | (v >> 8));
  4885. +}
  4886. +
  4887. +static inline unsigned int _swapl(volatile unsigned long v)
  4888. +{
  4889. + return ((v << 24) | ((v & 0xff00) << 8) | ((v & 0xff0000) >> 8) | (v >> 24));
  4890. +}
  4891. +
  4892. +#ifndef CONFIG_PCI
  4893. +#define readb(addr) \
  4894. + ({ unsigned char __v = (*(volatile unsigned char *) (addr)); __v; })
  4895. +#define readw(addr) \
  4896. + ({ unsigned short __v = (*(volatile unsigned short *) (addr)); __v; })
  4897. +#define readl(addr) \
  4898. + ({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; })
  4899. +
  4900. +#define writeb(b,addr) (void)((*(volatile unsigned char *) (addr)) = (b))
  4901. +#define writew(b,addr) (void)((*(volatile unsigned short *) (addr)) = (b))
  4902. +#define writel(b,addr) (void)((*(volatile unsigned int *) (addr)) = (b))
  4903. +#else /*CONFIG_PCI */
  4904. +
  4905. +#define PCI_CPU_REG_BASE (0x00000000UL) /* taking lower 2GB space */
  4906. +#define PCI_DEV_REG_BASE (0x80000000UL)
  4907. +
  4908. +#if PCI_CPU_REG_BASE > PCI_DEV_REG_BASE
  4909. +#define IS_PCI_ADDRESS(x) (((unsigned int)(x)&(PCI_CPU_REG_BASE)) == 0)
  4910. +#else
  4911. +#define IS_PCI_ADDRESS(x) ((unsigned int)(x)&(PCI_DEV_REG_BASE))
  4912. +#endif
  4913. +
  4914. +extern unsigned int ubi32_pci_read_u32(const volatile void __iomem *addr);
  4915. +extern unsigned short ubi32_pci_read_u16(const volatile void __iomem *addr);
  4916. +extern unsigned char ubi32_pci_read_u8(const volatile void __iomem *addr);
  4917. +extern void ubi32_pci_write_u32(unsigned int val, const volatile void __iomem *addr);
  4918. +extern void ubi32_pci_write_u16(unsigned short val, const volatile void __iomem *addr);
  4919. +extern void ubi32_pci_write_u8(unsigned char val, const volatile void __iomem *addr);
  4920. +
  4921. +static inline unsigned char readb(const volatile void __iomem *addr)
  4922. +{
  4923. + if (IS_PCI_ADDRESS(addr))
  4924. + return ubi32_pci_read_u8(addr);
  4925. + else
  4926. + return (unsigned char)(*(volatile unsigned char *)addr);
  4927. +}
  4928. +static inline unsigned short readw(const volatile void __iomem *addr)
  4929. +{
  4930. + if (IS_PCI_ADDRESS(addr))
  4931. + return ubi32_pci_read_u16(addr);
  4932. + else
  4933. + return (unsigned short)(*(volatile unsigned short *)addr);
  4934. +}
  4935. +
  4936. +static inline unsigned int readl(const volatile void __iomem *addr)
  4937. +{
  4938. + if (IS_PCI_ADDRESS(addr))
  4939. + return ubi32_pci_read_u32(addr);
  4940. + else
  4941. + return (unsigned int)(*(volatile unsigned int *)addr);
  4942. +}
  4943. +
  4944. +static inline void writel(unsigned int val, volatile void __iomem *addr)
  4945. +{
  4946. + if (IS_PCI_ADDRESS(addr))
  4947. + ubi32_pci_write_u32(val, addr);
  4948. + else
  4949. + *(volatile unsigned int *)addr = val;
  4950. +}
  4951. +
  4952. +static inline void writew(unsigned short val, volatile void __iomem *addr)
  4953. +{
  4954. + if (IS_PCI_ADDRESS(addr))
  4955. + ubi32_pci_write_u16(val, addr);
  4956. + else
  4957. + *(volatile unsigned short *)addr = val;
  4958. +}
  4959. +
  4960. +static inline void writeb(unsigned char val, volatile void __iomem *addr)
  4961. +{
  4962. + if (IS_PCI_ADDRESS(addr))
  4963. + ubi32_pci_write_u8(val, addr);
  4964. + else
  4965. + *(volatile unsigned char *)addr = val;
  4966. +}
  4967. +#endif
  4968. +
  4969. +#define readb_relaxed(addr) readb(addr)
  4970. +#define readw_relaxed(addr) readw(addr)
  4971. +#define readl_relaxed(addr) readl(addr)
  4972. +
  4973. +
  4974. +#define __raw_readb readb
  4975. +#define __raw_readw readw
  4976. +#define __raw_readl readl
  4977. +#define __raw_writeb writeb
  4978. +#define __raw_writew writew
  4979. +#define __raw_writel writel
  4980. +
  4981. +static inline void io_outsb(unsigned int addr, const void *buf, int len)
  4982. +{
  4983. + volatile unsigned char *ap = (volatile unsigned char *) addr;
  4984. + unsigned char *bp = (unsigned char *) buf;
  4985. + while (len--)
  4986. + *ap = *bp++;
  4987. +}
  4988. +
  4989. +static inline void io_outsw(unsigned int addr, const void *buf, int len)
  4990. +{
  4991. + volatile unsigned short *ap = (volatile unsigned short *) addr;
  4992. + unsigned short *bp = (unsigned short *) buf;
  4993. + while (len--)
  4994. + *ap = _swapw(*bp++);
  4995. +}
  4996. +
  4997. +static inline void io_outsl(unsigned int addr, const void *buf, int len)
  4998. +{
  4999. + volatile unsigned int *ap = (volatile unsigned int *) addr;
  5000. + unsigned int *bp = (unsigned int *) buf;
  5001. + while (len--)
  5002. + *ap = _swapl(*bp++);
  5003. +}
  5004. +
  5005. +static inline void io_insb(unsigned int addr, void *buf, int len)
  5006. +{
  5007. + volatile unsigned char *ap = (volatile unsigned char *) addr;
  5008. + unsigned char *bp = (unsigned char *) buf;
  5009. + while (len--)
  5010. + *bp++ = *ap;
  5011. +}
  5012. +
  5013. +static inline void io_insw(unsigned int addr, void *buf, int len)
  5014. +{
  5015. + volatile unsigned short *ap = (volatile unsigned short *) addr;
  5016. + unsigned short *bp = (unsigned short *) buf;
  5017. + while (len--)
  5018. + *bp++ = _swapw(*ap);
  5019. +}
  5020. +
  5021. +static inline void io_insl(unsigned int addr, void *buf, int len)
  5022. +{
  5023. + volatile unsigned int *ap = (volatile unsigned int *) addr;
  5024. + unsigned int *bp = (unsigned int *) buf;
  5025. + while (len--)
  5026. + *bp++ = _swapl(*ap);
  5027. +}
  5028. +
  5029. +#define mmiowb()
  5030. +
  5031. +/*
  5032. + * make the short names macros so specific devices
  5033. + * can override them as required
  5034. + */
  5035. +#ifndef CONFIG_PCI
  5036. +#define memset_io(a,b,c) memset((void *)(a),(b),(c))
  5037. +#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
  5038. +#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
  5039. +#else
  5040. +extern void memcpy_fromio(void *to, const volatile void __iomem *from, unsigned len);
  5041. +extern void memcpy_toio(volatile void __iomem *to, const void *from, unsigned len);
  5042. +extern void memset_io(volatile void __iomem *addr, int val, size_t count);
  5043. +#endif
  5044. +
  5045. +#define inb(addr) readb(addr)
  5046. +#define inw(addr) readw(addr)
  5047. +#define inl(addr) readl(addr)
  5048. +#define outb(x,addr) ((void) writeb(x,addr))
  5049. +#define outw(x,addr) ((void) writew(x,addr))
  5050. +#define outl(x,addr) ((void) writel(x,addr))
  5051. +
  5052. +#define inb_p(addr) inb(addr)
  5053. +#define inw_p(addr) inw(addr)
  5054. +#define inl_p(addr) inl(addr)
  5055. +#define outb_p(x,addr) outb(x,addr)
  5056. +#define outw_p(x,addr) outw(x,addr)
  5057. +#define outl_p(x,addr) outl(x,addr)
  5058. +
  5059. +#define outsb(a,b,l) io_outsb(a,b,l)
  5060. +#define outsw(a,b,l) io_outsw(a,b,l)
  5061. +#define outsl(a,b,l) io_outsl(a,b,l)
  5062. +
  5063. +#define insb(a,b,l) io_insb(a,b,l)
  5064. +#define insw(a,b,l) io_insw(a,b,l)
  5065. +#define insl(a,b,l) io_insl(a,b,l)
  5066. +
  5067. +#ifndef CONFIG_PCI
  5068. +#define ioread8_rep(a,d,c) insb(a,d,c)
  5069. +#define ioread16_rep(a,d,c) insw(a,d,c)
  5070. +#define ioread32_rep(a,d,c) insl(a,d,c)
  5071. +#define iowrite8_rep(a,s,c) outsb(a,s,c)
  5072. +#define iowrite16_rep(a,s,c) outsw(a,s,c)
  5073. +#define iowrite32_rep(a,s,c) outsl(a,s,c)
  5074. +#else
  5075. +extern void ioread8_rep(void __iomem *port, void *buf, unsigned long count);
  5076. +extern void ioread16_rep(void __iomem *port, void *buf, unsigned long count);
  5077. +extern void ioread32_rep(void __iomem *port, void *buf, unsigned long count);
  5078. +extern void iowrite8_rep(void __iomem *port, const void *buf, unsigned long count);
  5079. +extern void iowrite16_rep(void __iomem *port, const void *buf, unsigned long count);
  5080. +extern void iowrite32_rep(void __iomem *port, const void *buf, unsigned long count);
  5081. +#endif
  5082. +
  5083. +
  5084. +#ifndef CONFIG_PCI
  5085. +#define ioread8(X) readb(X)
  5086. +#define ioread16(X) readw(X)
  5087. +#define ioread32(X) readl(X)
  5088. +#define iowrite8(val,X) writeb(val,X)
  5089. +#define iowrite16(val,X) writew(val,X)
  5090. +#define iowrite32(val,X) writel(val,X)
  5091. +#else /*CONFIG_PCI */
  5092. +extern unsigned char ioread8(void __iomem *addr);
  5093. +extern unsigned short ioread16(void __iomem *addr);
  5094. +extern unsigned int ioread32(void __iomem *addr);
  5095. +extern void iowrite8(unsigned char val, void __iomem *addr);
  5096. +extern void iowrite16(unsigned short val, void __iomem *addr);
  5097. +extern void iowrite32(unsigned int val, void __iomem *addr);
  5098. +#endif /* CONFIG_PCI */
  5099. +
  5100. +#define IO_SPACE_LIMIT 0xffff
  5101. +
  5102. +/* Values for nocacheflag and cmode */
  5103. +#define IOMAP_FULL_CACHING 0
  5104. +#define IOMAP_NOCACHE_SER 1
  5105. +#define IOMAP_NOCACHE_NONSER 2
  5106. +#define IOMAP_WRITETHROUGH 3
  5107. +
  5108. +extern void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag);
  5109. +extern void __iounmap(void *addr, unsigned long size);
  5110. +
  5111. +static inline void *ioremap(unsigned long physaddr, unsigned long size)
  5112. +{
  5113. + return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
  5114. +}
  5115. +static inline void *ioremap_nocache(unsigned long physaddr, unsigned long size)
  5116. +{
  5117. + return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
  5118. +}
  5119. +static inline void *ioremap_writethrough(unsigned long physaddr, unsigned long size)
  5120. +{
  5121. + return __ioremap(physaddr, size, IOMAP_WRITETHROUGH);
  5122. +}
  5123. +static inline void *ioremap_fullcache(unsigned long physaddr, unsigned long size)
  5124. +{
  5125. + return __ioremap(physaddr, size, IOMAP_FULL_CACHING);
  5126. +}
  5127. +
  5128. +extern void iounmap(void *addr);
  5129. +
  5130. +#define ioport_map(port, nr) ((void __iomem*)(port))
  5131. +#define ioport_unmap(addr)
  5132. +
  5133. +
  5134. +/* Pages to physical address... */
  5135. +#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT)
  5136. +#define page_to_bus(page) ((page - mem_map) << PAGE_SHIFT)
  5137. +
  5138. +/*
  5139. + * Macros used for converting between virtual and physical mappings.
  5140. + */
  5141. +#define phys_to_virt(vaddr) ((void *) (vaddr))
  5142. +#define virt_to_phys(vaddr) ((unsigned long) (vaddr))
  5143. +
  5144. +#define virt_to_bus virt_to_phys
  5145. +#define bus_to_virt phys_to_virt
  5146. +
  5147. +/*
  5148. + * Convert a physical pointer to a virtual kernel pointer for /dev/mem
  5149. + * access
  5150. + */
  5151. +#define xlate_dev_mem_ptr(p) __va(p)
  5152. +
  5153. +/*
  5154. + * Convert a virtual cached pointer to an uncached pointer
  5155. + */
  5156. +#define xlate_dev_kmem_ptr(p) p
  5157. +
  5158. +#endif /* __KERNEL__ */
  5159. +
  5160. +#endif /* _ASM_UBICOM32_IO_H */
  5161. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/ip5000-asm.h linux-2.6.28.10/arch/ubicom32/include/asm/ip5000-asm.h
  5162. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/ip5000-asm.h 1970-01-01 02:00:00.000000000 +0200
  5163. +++ linux-2.6.28.10/arch/ubicom32/include/asm/ip5000-asm.h 2009-08-12 13:08:37.000000000 +0300
  5164. @@ -0,0 +1,156 @@
  5165. +/*
  5166. + * arch/ubicom32/include/asm/ip5000-asm.h
  5167. + * Instruction macros for the IP5000.
  5168. + *
  5169. + * (C) Copyright 2009, Ubicom, Inc.
  5170. + *
  5171. + * This file is part of the Ubicom32 Linux Kernel Port.
  5172. + *
  5173. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  5174. + * it and/or modify it under the terms of the GNU General Public License
  5175. + * as published by the Free Software Foundation, either version 2 of the
  5176. + * License, or (at your option) any later version.
  5177. + *
  5178. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  5179. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  5180. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  5181. + * the GNU General Public License for more details.
  5182. + *
  5183. + * You should have received a copy of the GNU General Public License
  5184. + * along with the Ubicom32 Linux Kernel Port. If not,
  5185. + * see <http://www.gnu.org/licenses/>.
  5186. + *
  5187. + * Ubicom32 implementation derived from (with many thanks):
  5188. + * arch/m68knommu
  5189. + * arch/blackfin
  5190. + * arch/parisc
  5191. + */
  5192. +
  5193. +#ifndef _ASM_UBICOM32_IP5000_ASM_H
  5194. +#define _ASM_UBICOM32_IP5000_ASM_H
  5195. +
  5196. +#if !defined(__LINKER__)
  5197. +
  5198. +#if defined(__ASSEMBLY__)
  5199. +.macro cycles quant
  5200. +.if (\quant) == 1
  5201. + nop
  5202. +.else
  5203. +.if (((\quant) + 3) / 8) > 0
  5204. +.rept (((\quant) + 3) / 8)
  5205. + jmpt.f .+4
  5206. +.endr
  5207. +.endif
  5208. +.if ((((\quant) + 3) % 8) / 4) > 0
  5209. + jmpt.t .+4
  5210. +.endif
  5211. +.endif
  5212. +.endm
  5213. +#else
  5214. +/*
  5215. + * Same macro as above just in C inline asm
  5216. + */
  5217. +asm (" \n\
  5218. +.macro cycles quant \n\
  5219. +.if (\\quant) == 1 \n\
  5220. + nop \n\
  5221. +.else \n\
  5222. +.if (((\\quant) + 3) / 8) > 0 \n\
  5223. +.rept (((\\quant) + 3) / 8) \n\
  5224. + jmpt.f .+4 \n\
  5225. +.endr \n\
  5226. +.endif \n\
  5227. +.if ((((\\quant) + 3) % 8) / 4) > 0 \n\
  5228. + jmpt.t .+4 \n\
  5229. +.endif \n\
  5230. +.endif \n\
  5231. +.endm \n\
  5232. +");
  5233. +#endif
  5234. +
  5235. +
  5236. +#if defined(__ASSEMBLY__)
  5237. +.macro pipe_flush cyc
  5238. + cycles 11 - (\cyc)
  5239. +.endm
  5240. +#else
  5241. +/*
  5242. + * Same macro as above just in C inline asm
  5243. + */
  5244. +asm (" \n\
  5245. +.macro pipe_flush cyc \n\
  5246. + cycles 11 - (\\cyc) \n\
  5247. +.endm \n\
  5248. +");
  5249. +
  5250. +#endif
  5251. +
  5252. +#if defined(__ASSEMBLY__)
  5253. +.macro setcsr_flush cyc
  5254. + cycles 5 - (\cyc)
  5255. +.endm
  5256. +#else
  5257. +/*
  5258. + * Same macro as above just in C inline asm
  5259. + */
  5260. +asm (" \n\
  5261. +.macro setcsr_flush cyc \n\
  5262. + cycles 5 - (\\cyc) \n\
  5263. +.endm \n\
  5264. +");
  5265. +#endif
  5266. +
  5267. +/*
  5268. + * Macros for prefetch (using miss-aligned memory write)
  5269. + */
  5270. +#if defined(__ASSEMBLY__)
  5271. +
  5272. +.macro pre_fetch_macro thread_num, Ascratch, Aaddress length
  5273. + bclr MT_TRAP_EN, MT_TRAP_EN, #(\thread_num)
  5274. + bset \Ascratch, \Aaddress, #0 ; force a miss-aligned address
  5275. + jmpt.t .+4 ; delay for both address setup and trap disable
  5276. + move.4 (\Ascratch), #0
  5277. + .if (\length > 32)
  5278. + move.4 32(\Ascratch), #0
  5279. + .endif
  5280. + .if (\length > 64)
  5281. + move.4 64(\Ascratch), #0
  5282. + .endif
  5283. + .if (\length > 96)
  5284. + move.4 96(\Ascratch), #0
  5285. + .endif
  5286. + .if (\length > 128)
  5287. + invalid_instruction ; maximum pre-fetch size is 4 cache lines
  5288. + .endif
  5289. + bset MT_TRAP_EN, MT_TRAP_EN, #(\thread_num)
  5290. +.endm
  5291. +
  5292. +#else
  5293. +/*
  5294. + * Same macro as above just in C inline asm
  5295. + */
  5296. +asm (" \n\
  5297. +.macro pre_fetch_macro thread_num, Ascratch, Aaddress length \n\
  5298. + bclr MT_TRAP_EN, MT_TRAP_EN, #(\thread_num) \n\
  5299. + bset \\Ascratch, \\Aaddress, #0 ; force a miss-aligned address \n\
  5300. + jmpt.t .+4 ; delay for both address setup and trap disable \n\
  5301. + move.4 (\\Ascratch), #0 \n\
  5302. + .if (\\length > 32) \n\
  5303. + move.4 32(\\Ascratch), #0 \n\
  5304. + .endif \n\
  5305. + .if (\\length > 64) \n\
  5306. + move.4 64(\\Ascratch), #0 \n\
  5307. + .endif \n\
  5308. + .if (\\length > 96) \n\
  5309. + move.4 96(\\Ascratch), #0 \n\
  5310. + .endif \n\
  5311. + .if (\\length > 128) \n\
  5312. + invalid_instruction ; maximum pre-fetch size is 4 cache lines \n\
  5313. + .endif \n\
  5314. + bset MT_TRAP_EN, MT_TRAP_EN, #(\\thread_num) \n\
  5315. +.endm \n\
  5316. +");
  5317. +#endif
  5318. +
  5319. +#endif /* !defined(__LINKER__) */
  5320. +#endif /* defined _ASM_UBICOM32_IP5000_ASM_H */
  5321. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/ip5000.h linux-2.6.28.10/arch/ubicom32/include/asm/ip5000.h
  5322. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/ip5000.h 1970-01-01 02:00:00.000000000 +0200
  5323. +++ linux-2.6.28.10/arch/ubicom32/include/asm/ip5000.h 2009-08-12 13:08:37.000000000 +0300
  5324. @@ -0,0 +1,860 @@
  5325. +/*
  5326. + * arch/ubicom32/include/asm/ip5000.h
  5327. + * Specific details for the Ubicom IP5000 processor.
  5328. + *
  5329. + * (C) Copyright 2009, Ubicom, Inc.
  5330. + *
  5331. + * This file is part of the Ubicom32 Linux Kernel Port.
  5332. + *
  5333. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  5334. + * it and/or modify it under the terms of the GNU General Public License
  5335. + * as published by the Free Software Foundation, either version 2 of the
  5336. + * License, or (at your option) any later version.
  5337. + *
  5338. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  5339. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  5340. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  5341. + * the GNU General Public License for more details.
  5342. + *
  5343. + * You should have received a copy of the GNU General Public License
  5344. + * along with the Ubicom32 Linux Kernel Port. If not,
  5345. + * see <http://www.gnu.org/licenses/>.
  5346. + *
  5347. + * Ubicom32 implementation derived from (with many thanks):
  5348. + * arch/m68knommu
  5349. + * arch/blackfin
  5350. + * arch/parisc
  5351. + */
  5352. +
  5353. +#ifndef _ASM_UBICOM32_IP5000_H
  5354. +#define _ASM_UBICOM32_IP5000_H
  5355. +
  5356. +/*
  5357. + * Inline assembly define
  5358. + */
  5359. +#define S(arg) #arg
  5360. +#define D(arg) S(arg)
  5361. +
  5362. +/*
  5363. + * Assembler include file
  5364. + */
  5365. +#include <asm/ip5000-asm.h>
  5366. +
  5367. +/*
  5368. + * Timing
  5369. + */
  5370. +#define JMPT_PENALTY 3
  5371. +#define JMPF_PENALTY 7
  5372. +#define RET_PENALTY 7
  5373. +
  5374. +/*
  5375. + * Threads
  5376. + */
  5377. +#if defined(IP5000) || defined(IP5000_REV2)
  5378. +#define THREAD_COUNT 10
  5379. +#elif defined(IP7000) || defined(IP7000_REV2)
  5380. +#define THREAD_COUNT 12
  5381. +#else
  5382. +#error "Unknown IP5K silicon"
  5383. +#endif
  5384. +
  5385. +/*
  5386. + * Arch
  5387. + */
  5388. +#if defined(IP5000) || defined(IP5000_REV2)
  5389. +#define UBICOM32_ARCH_VERSION 3
  5390. +#elif defined(IP7000) || defined(IP7000_REV2)
  5391. +#define UBICOM32_ARCH_VERSION 4
  5392. +#else
  5393. +#error "Unknown IP5K silicon"
  5394. +#endif
  5395. +
  5396. +/*
  5397. + * Memory Size
  5398. + */
  5399. +#define OCM_SECTOR_SIZE 0x00008000 /* 32K */
  5400. +
  5401. +#if defined(IP5000) || defined(IP5000_REV2)
  5402. +#define OCMSIZE 0x00030000 /* 192K on-chip RAM for both program and data */
  5403. +#elif defined(IP7000) || defined(IP7000_REV2)
  5404. +#define OCMSIZE 0x0003C000 /* 240K on-chip RAM for both program and data */
  5405. +#else
  5406. +#error "Unknown IP5K silicon"
  5407. +#endif
  5408. +
  5409. +#define OCMSTART 0x3ffc0000 /* alias from 0x03000000 for easy jump to/from SDRAM */
  5410. +#define OCMEND (OCMSTART + OCMSIZE)
  5411. +#define SDRAMSTART 0x40000000
  5412. +#define FLASHSTART 0x60000000
  5413. +
  5414. +/*
  5415. + * Registers
  5416. + */
  5417. +#define ROSR_INT (1 << 0)
  5418. +
  5419. +/* Interrupts */
  5420. +#define INT_CHIP(reg, bit) (((reg) << 5) | (bit))
  5421. +#define INT_REG(interrupt) (((interrupt) >> 5) * 4)
  5422. +#define INT_SET(interrupt) 0x0114 + INT_REG(interrupt)
  5423. +#define INT_CLR(interrupt) 0x0124 + INT_REG(interrupt)
  5424. +#define INT_STAT(interrupt) 0x0104 + INT_REG(interrupt)
  5425. +#define INT_MASK(interrupt) 0x00C0 + INT_REG(interrupt)
  5426. +#define INT_BIT(interrupt) ((interrupt) & 0x1F)
  5427. +#define INT_BIT_MASK(interrupt) (1 << INT_BIT(interrupt))
  5428. +
  5429. +/*
  5430. + * The LOCK_INT and THREAD_INT are used to wake up corresponding thread. They are sharing
  5431. + * the same set of SW interrupt resource.
  5432. + *
  5433. + * LOCK_INT(n): One SW INT per NRT thread that can participate lock operation.
  5434. + * The threads that can participate lock are application threads and DSR thread.
  5435. + * (Lock locks - numbers are hard-coded in lock.h)
  5436. + * THREAD_INT(n): One SW INT per HRT thread for wake up trigger.
  5437. + */
  5438. +#define LOCK_INT(thread) INT_CHIP(0, (thread))
  5439. +#define THREAD_INT(thread) INT_CHIP(0, (thread))
  5440. +
  5441. +/*
  5442. + * The SYSTEM_INT and DSR_INT are sharing the same set of SW interrupt resource.
  5443. + *
  5444. + * SYSTEM_INT(n): One SW INT per NRT threads (application threads) as system queue interrupt,
  5445. + * and for DSR as self-trigger interrupt.
  5446. + * (The application threads include at least thread 0)
  5447. + * DSR_INT(n): One SW INT per HRT thread to request DSR service.
  5448. + */
  5449. +#define SYSTEM_INT(thread) INT_CHIP(0, THREAD_COUNT + (thread))
  5450. +#define DSR_INT(thread) INT_CHIP(0, THREAD_COUNT + (thread))
  5451. +
  5452. +/* GLOBAL_CTRL */
  5453. +#define GLOBAL_CTRL_TRAP_RST_EN (1 << 9)
  5454. +#define GLOBAL_CTRL_AERROR_RST_EN (1 << 8)
  5455. +#define GLOBAL_CTRL_MT_MIN_DELAY(x) ((x) << 3)
  5456. +#define GLOBAL_CTRL_HRT_BANK_SELECT (1 << 2)
  5457. +#define GLOBAL_CTRL_INT_EN (1 << 0)
  5458. +
  5459. +/*
  5460. + * HRT Tables
  5461. + */
  5462. +#define HRT_TABLE0_BASE 0x0800
  5463. +#define HRT_TABLE1_BASE 0x0900
  5464. +#define HRT_TABLE_SIZE 64
  5465. +
  5466. +/*
  5467. + * Break Point Trap Register
  5468. + */
  5469. +#define ASYNCERROR_INT INT_CHIP(0, 31)
  5470. +#define BREAKPOINT_INT INT_CHIP(1, 31)
  5471. +
  5472. +/*
  5473. + * Port interrupts
  5474. + * The non-existing FIFO INTs are mapped to INT2 for the ports.
  5475. + */
  5476. +#define IO_PORT_PTR_TO_NUM(port) (((port) & 0x0000ffff) >> 12)
  5477. +#define RX_FIFO_INT(port) \
  5478. + ((IO_PORT_PTR_TO_NUM(port) == 0) ? INT_CHIP(0, 25) : \
  5479. + ((IO_PORT_PTR_TO_NUM(port) == 1) ? INT_CHIP(0, 26) : \
  5480. + ((IO_PORT_PTR_TO_NUM(port) == 2) ? INT_CHIP(0, 29) : \
  5481. + ((IO_PORT_PTR_TO_NUM(port) == 3) ? INT_CHIP(1, 24) : \
  5482. + ((IO_PORT_PTR_TO_NUM(port) == 4) ? INT_CHIP(1, 27) : \
  5483. + ((IO_PORT_PTR_TO_NUM(port) == 5) ? INT_CHIP(1, 16) : \
  5484. + ((IO_PORT_PTR_TO_NUM(port) == 6) ? INT_CHIP(1, 19) : \
  5485. + ((IO_PORT_PTR_TO_NUM(port) == 7) ? INT_CHIP(1, 20) : \
  5486. + ((IO_PORT_PTR_TO_NUM(port) == 8) ? INT_CHIP(1, 21) : \
  5487. + INT_CHIP(1, 15))))))))))
  5488. +#define TX_FIFO_INT(port) \
  5489. + ((IO_PORT_PTR_TO_NUM(port) == 0) ? INT_CHIP(0, 24) : \
  5490. + ((IO_PORT_PTR_TO_NUM(port) == 1) ? INT_CHIP(0, 27) : \
  5491. + ((IO_PORT_PTR_TO_NUM(port) == 2) ? INT_CHIP(0, 29) : \
  5492. + ((IO_PORT_PTR_TO_NUM(port) == 3) ? INT_CHIP(1, 25) : \
  5493. + ((IO_PORT_PTR_TO_NUM(port) == 4) ? INT_CHIP(1, 28) : \
  5494. + ((IO_PORT_PTR_TO_NUM(port) == 5) ? INT_CHIP(1, 17) : \
  5495. + ((IO_PORT_PTR_TO_NUM(port) == 6) ? INT_CHIP(1, 19) : \
  5496. + ((IO_PORT_PTR_TO_NUM(port) == 7) ? INT_CHIP(1, 20) : \
  5497. + ((IO_PORT_PTR_TO_NUM(port) == 8) ? INT_CHIP(1, 22) : \
  5498. + INT_CHIP(1, 15))))))))))
  5499. +#define PORT_OTHER_INT(port) \
  5500. + ((IO_PORT_PTR_TO_NUM(port) == 0) ? INT_CHIP(0, 25) : \
  5501. + ((IO_PORT_PTR_TO_NUM(port) == 1) ? INT_CHIP(0, 28) : \
  5502. + ((IO_PORT_PTR_TO_NUM(port) == 2) ? INT_CHIP(0, 29) : \
  5503. + ((IO_PORT_PTR_TO_NUM(port) == 3) ? INT_CHIP(1, 26) : \
  5504. + ((IO_PORT_PTR_TO_NUM(port) == 4) ? INT_CHIP(1, 29) : \
  5505. + ((IO_PORT_PTR_TO_NUM(port) == 5) ? INT_CHIP(1, 18) : \
  5506. + ((IO_PORT_PTR_TO_NUM(port) == 6) ? INT_CHIP(1, 19) : \
  5507. + ((IO_PORT_PTR_TO_NUM(port) == 7) ? INT_CHIP(1, 20) : \
  5508. + ((IO_PORT_PTR_TO_NUM(port) == 8) ? INT_CHIP(1, 23) : \
  5509. + INT_CHIP(1, 15))))))))))
  5510. +
  5511. +/*
  5512. + * On Chip Peripherals Base.
  5513. + */
  5514. +#define OCP_BASE 0x01000000
  5515. +#define OCP_GENERAL 0x000
  5516. +#define OCP_TIMERS 0x100
  5517. +#define OCP_TRNG 0x200 /* True Random Number Generator Control Reigsters */
  5518. +#define OCP_DEBUG 0x300
  5519. +#define OCP_SECURITY 0x400
  5520. +#define OCP_ICCR 0x500 /* I-Cache Control Registers */
  5521. +#define OCP_DCCR 0x600 /* D-Cache Control Registers */
  5522. +#define OCP_OCMC 0x700 /* On Chip Memory Control Registers */
  5523. +#define OCP_STATISTICS 0x800 /* Statistics Counters */
  5524. +#define OCP_MTEST 0x900 /* Memory Test Registers */
  5525. +#define OCP_MCFG 0xa00 /* Memory Configuration Registers -- IP7000 only */
  5526. +#define OCP_DEBUG_INST 0x000 /* Up to 16M */
  5527. +
  5528. +/*
  5529. + * General Configuration Registers (PLL)
  5530. + */
  5531. +#define GENERAL_CFG_BASE (OCP_BASE + OCP_GENERAL)
  5532. +#define GEN_CLK_CORE_CFG 0x00
  5533. +#define GEN_CLK_IO_CFG 0x04
  5534. +#define GEN_CLK_DDR_CFG 0x08
  5535. +#define GEN_CLK_DDRDS_CFG 0x0c
  5536. +#define GEN_CLK_SLIP_CLR 0x10
  5537. +#define GEN_CLK_SLIP_START 0x14
  5538. +#define GEN_CLK_SERDES_SEL 0x18 /* IP7000 only */
  5539. +#define GEN_CLK_DDR_CFG2 0x1c /* IP7000 only */
  5540. +#define GEN_DDR_CAL_CTRL 0x30 /* IP5000 only */
  5541. +#define GEN_DDR_CAL_STAT 0x34 /* IP5000 only */
  5542. +#define GEN_USB_DFT_CTRL 0x38 /* IP5000 only */
  5543. +#define GEN_USB_DFT_STAT 0x3c /* IP5000 only */
  5544. +#define GEN_USB_PHY_CFG 0x40 /* IP7000 only */
  5545. +#define GEN_USB_PHY_TEST 0x44 /* IP7000 only */
  5546. +#define GEN_USB_PHY_STAT 0x48 /* IP7000 only */
  5547. +#define GEN_SW_RESET 0x80
  5548. +#define GEN_RESET_REASON 0x84
  5549. +#define GEN_BOND_CFG 0x88
  5550. +#define GEN_IO_PU_CFG 0x8c
  5551. +#define GEN_MEM_RM_CFG 0x90
  5552. +#define GEN_IO_CONFIG 0x94
  5553. +
  5554. +#define GEN_CLK_PLL_SECURITY_BIT_NO 31
  5555. +#define GEN_CLK_PLL_SECURITY (1 << GEN_CLK_PLL_SECURITY_BIT_NO)
  5556. +#define GEN_CLK_PLL_ENSAT (1 << 30)
  5557. +#define GEN_CLK_PLL_FASTEN (1 << 29)
  5558. +#define GEN_CLK_PLL_NR(v) (((v) - 1) << 23)
  5559. +#define GEN_CLK_PLL_NF(v) (((v) - 1) << 11)
  5560. +#define GEN_CLK_PLL_OD(v) (((v) - 1) << 8)
  5561. +#define GEN_CLK_PLL_RESET (1 << 7)
  5562. +#define GEN_CLK_PLL_BYPASS (1 << 6)
  5563. +#define GEN_CLK_PLL_POWERDOWN (1 << 5)
  5564. +#define GEN_CLK_PLL_SELECT (1 << 4)
  5565. +
  5566. +#define GEN_GET_CLK_PLL_NR(v) ((((v) >> 23) & 0x003f) + 1)
  5567. +#define GEN_GET_CLK_PLL_NF(v) ((((v) >> 11) & 0x0fff) + 1)
  5568. +#define GEN_GET_CLK_PLL_OD(v) ((((v) >> 8) & 0x7) + 1)
  5569. +
  5570. +
  5571. +#define RESET_FLAG_DST_MEM_ERROR (1 << 18)
  5572. +#define RESET_FLAG_SRC1_MEM_ERROR (1 << 17)
  5573. +#define RESET_FLAG_WRITE_ADDR (1 << 16)
  5574. +#define RESET_FLAG_DST_SYNC_ERROR (1 << 15)
  5575. +#define RESET_FLAG_SRC1_SYNC_ERROR (1 << 14)
  5576. +#define RESET_FLAG_DST_ALGN_ERROR (1 << 13)
  5577. +#define RESET_FLAG_SRC1_ALGN_ERROR (1 << 12)
  5578. +#define RESET_FLAG_DST_ADDR_ERROR (1 << 11)
  5579. +#define RESET_FLAG_SRC1_ADDR_ERROR (1 << 10)
  5580. +#define RESET_FLAG_ILLEGAL_INST (1 << 9)
  5581. +#define RESET_FLAG_INST_SYNC_ERROR (1 << 8)
  5582. +#define RESET_FLAG_INST_ADDR_ERROR (1 << 7)
  5583. +#define RESET_FLAG_DATA_PORT_ERROR (1 << 6)
  5584. +#define RESET_FLAG_INST_PORT_ERROR (1 << 5)
  5585. +#define RESET_FLAG_SW_RESET (1 << 4)
  5586. +#define RESET_FLAG_DEBUG (1 << 3)
  5587. +#define RESET_FLAG_WATCHDOG (1 << 2)
  5588. +#define RESET_FLAG_POWER_ON (1 << 1)
  5589. +#define RESET_FLAG_EXTERNAL (1 << 0)
  5590. +
  5591. +/*
  5592. + * Timer block
  5593. + */
  5594. +#define TIMER_BASE (OCP_BASE + OCP_TIMERS)
  5595. +#define TIMER_MPTVAL 0x00
  5596. +#define TIMER_RTCOM 0x04
  5597. +#define TIMER_TKEY 0x08
  5598. +#define TIMER_WDCOM 0x0c
  5599. +#define TIMER_WDCFG 0x10
  5600. +#define TIMER_SYSVAL 0x14
  5601. +#define TIMER_SYSCOM(tmr) (0x18 + (tmr) * 4)
  5602. +#define TIMER_TRN_CFG 0x100
  5603. +#define TIMER_TRN 0x104
  5604. +
  5605. +#define TIMER_COUNT 10
  5606. +#define TIMER_INT(tmr) INT_CHIP(1, (tmr))
  5607. +#define TIMER_TKEYVAL 0xa1b2c3d4
  5608. +#define TIMER_WATCHDOG_DISABLE 0x4d3c2b1a
  5609. +#define TIMER_TRN_CFG_ENABLE_OSC 0x00000007
  5610. +
  5611. +#ifndef __ASSEMBLY__
  5612. +/*
  5613. + * ubicom32_io_timer
  5614. + */
  5615. +struct ubicom32_io_timer {
  5616. + volatile u32_t mptval;
  5617. + volatile u32_t rtcom;
  5618. + volatile u32_t tkey;
  5619. + volatile u32_t wdcom;
  5620. + volatile u32_t wdcfg;
  5621. + volatile u32_t sysval;
  5622. + volatile u32_t syscom[TIMER_COUNT];
  5623. + volatile u32_t reserved[64 - 6 - TIMER_COUNT]; // skip all the way to OCP-TRNG section
  5624. + volatile u32_t rsgcfg;
  5625. + volatile u32_t trn;
  5626. +};
  5627. +
  5628. +#define UBICOM32_IO_TIMER ((struct ubicom32_io_timer *)TIMER_BASE)
  5629. +#endif
  5630. +
  5631. +#define UBICOM32_VECTOR_TO_TIMER_INDEX(vector) (vector - TIMER_INT(0))
  5632. +
  5633. +/*
  5634. + * OCP-Debug Module (Mailbox)
  5635. + */
  5636. +#define ISD_MAILBOX_BASE (OCP_BASE + OCP_DEBUG)
  5637. +#define ISD_MAILBOX_IN 0x00
  5638. +#define ISD_MAILBOX_OUT 0x04
  5639. +#define ISD_MAILBOX_STATUS 0x08
  5640. +
  5641. +#define ISD_MAILBOX_INT INT_CHIP(1, 30)
  5642. +
  5643. +#define ISD_MAILBOX_STATUS_IN_FULL (1 << 31)
  5644. +#define ISD_MAILBOX_STATUS_IN_EMPTY (1 << 30)
  5645. +#define ISD_MAILBOX_STATUS_OUT_FULL (1 << 29)
  5646. +#define ISD_MAILBOX_STATUS_OUT_EMPTY (1 << 28)
  5647. +
  5648. +/*
  5649. + * OCP-Security
  5650. + */
  5651. +#define SECURITY_BASE (OCP_BASE + OCP_SECURITY)
  5652. +#define SECURITY_BASE_EFFECTIVE_ADDRESS (SECURITY_BASE >> 7) // To load the base address in a single instruction
  5653. +#define SECURITY_CTRL 0x00
  5654. +#define SECURITY_CTRL_BYTE_OFFSET(x) ((x) << 16)
  5655. +#define SECURITY_CTRL_KEY_SIZE(x) ((x) << 8)
  5656. +#define SECURITY_CTRL_HASH_ALG_NONE (0 << 4)
  5657. +#define SECURITY_CTRL_HASH_ALG_MD5 (1 << 4)
  5658. +#define SECURITY_CTRL_HASH_ALG_SHA1 (2 << 4)
  5659. +#define SECURITY_CTRL_CBC (1 << 3)
  5660. +#define SECURITY_CTRL_CIPHER_ALG_AES (0 << 1)
  5661. +#define SECURITY_CTRL_CIPHER_ALG_NONE (1 << 1)
  5662. +#define SECURITY_CTRL_CIPHER_ALG_DES (2 << 1)
  5663. +#define SECURITY_CTRL_CIPHER_ALG_3DES (3 << 1)
  5664. +#define SECURITY_CTRL_ENCIPHER (1 << 0)
  5665. +#define SECURITY_CTRL_DECIPHER (0 << 0)
  5666. +#define SECURITY_STAT 0x04
  5667. +#define SECURITY_STAT_BUSY (1 << 0)
  5668. +#define SECURITY_KEY_VALUE(x) (0x10 + (x) * 4)
  5669. +#define SECURITY_KEY_IN(x) (0x30 + (x) * 4)
  5670. +#define SECURITY_KEY_OUT(x) (0x50 + (x) * 4)
  5671. +#define SECURITY_KEY_HASH(x) (0x70 + (x) * 4)
  5672. +
  5673. +/*
  5674. + * OCP-ICCR
  5675. + */
  5676. +#define ICCR_BASE (OCP_BASE + OCP_ICCR)
  5677. +#define ICACHE_TOTAL_SIZE 16384 /* in bytes */
  5678. +
  5679. +/*
  5680. + * OCP-DCCR
  5681. + */
  5682. +#define DCCR_BASE (OCP_BASE + OCP_DCCR)
  5683. +#if defined(IP5000) || defined(IP5000_REV2)
  5684. +#define DCACHE_TOTAL_SIZE 8192 /* in bytes */
  5685. +#elif defined(IP7000) || defined(IP7000_REV2)
  5686. +#define DCACHE_TOTAL_SIZE 16384 /* in bytes */
  5687. +#endif
  5688. +
  5689. +#if defined(IP5000) || defined(IP5000_REV2) || defined(IP7000) || defined(IP7000_REV2)
  5690. +#define DCACHE_WRITE_QUEUE_LENGTH 6
  5691. +#else
  5692. +#error "Unknown IP5K silicon"
  5693. +#endif
  5694. +
  5695. +#define CACHE_LINE_SIZE 32 /* in bytes */
  5696. +
  5697. +#define CCR_ADDR 0x00
  5698. +#define CCR_RDD 0x04
  5699. +#define CCR_WRD 0x08
  5700. +#define CCR_STAT 0x0c
  5701. +#define CCR_CTRL 0x10
  5702. +
  5703. +#define CCR_STAT_MCBE 0
  5704. +#define CCR_STAT_WIDEL 1 /* D-cache only */
  5705. +
  5706. +#define CCR_CTRL_DONE 0
  5707. +#define CCR_CTRL_RESET 2
  5708. +#define CCR_CTRL_VALID 3
  5709. +#define CCR_CTRL_RD_DATA (1 << 4)
  5710. +#define CCR_CTRL_RD_TAG (2 << 4)
  5711. +#define CCR_CTRL_WR_DATA (3 << 4)
  5712. +#define CCR_CTRL_WR_TAG (4 << 4)
  5713. +#define CCR_CTRL_INV_INDEX (5 << 4)
  5714. +#define CCR_CTRL_INV_ADDR (6 << 4)
  5715. +#define CCR_CTRL_FLUSH_INDEX (7 << 4) /* D-cache only */
  5716. +#define CCR_CTRL_FLUSH_INV_INDEX (8 << 4) /* D-cache only */
  5717. +#define CCR_CTRL_FLUSH_ADDR (9 << 4) /* D-cache only */
  5718. +#define CCR_CTRL_FLUSH_INV_ADDR (10 << 4) /* D-cache only */
  5719. +
  5720. +/*
  5721. + * OCP-OCMC
  5722. + */
  5723. +#define OCMC_BASE (OCP_BASE + OCP_OCMC)
  5724. +#define OCMC_BANK_MASK 0x00
  5725. +#define OCMC_BIST_CNTL 0x04 /* IP5000 only */
  5726. +#define OCMC_BIST_STAT 0x08 /* IP5000 only */
  5727. +
  5728. +#define OCMC_BANK_PROG(n) ((1<<(n))-1)
  5729. +
  5730. +#define OCMC_BIST_WRCK (1 << 7)
  5731. +#define OCMC_BIST_RESET (1 << 5)
  5732. +#define OCMC_BIST_SMART (1 << 4)
  5733. +#define OCMC_BIST_RUN (1 << 3)
  5734. +#define OCMC_BIST_REPAIR (1 << 2)
  5735. +
  5736. +#define OCMC_BIST_READY (1 << 3)
  5737. +#define OCMC_BIST_FAIL (1 << 2)
  5738. +
  5739. +/*
  5740. + * OCP-STATISTICS
  5741. + */
  5742. +#define STATISTICS_BASE (OCP_BASE + OCP_STATISTICS)
  5743. +#define STAT_COUNTER_CTRL(n) ((n)*8)
  5744. +#define STAT_COUNTER(n) ((n)*8 + 4)
  5745. +
  5746. +#define STAT_EVENT_MP_INST 0
  5747. +#define STAT_EVENT_OCM_ACCESS 4
  5748. +#define STAT_EVENT_OCM_REQ 5
  5749. +#define STAT_EVENT_IC_REQ_INVAL 13
  5750. +#define STAT_EVENT_IC_MISS_INVAL 14
  5751. +#define STAT_EVENT_IC_REQ_INVAL_NACK 15
  5752. +#define STAT_EVENT_IC_REQ_VAL 16
  5753. +#define STAT_EVENT_IC_MISS_VAL 17
  5754. +#define STAT_EVENT_IC_REQ_VAL_NACK 18
  5755. +#define STAT_EVENT_IC_MISS_Q 19
  5756. +#define STAT_EVENT_DC_RD_REQ 20
  5757. +#define STAT_EVENT_DC_RD_MISS 21
  5758. +#define STAT_EVENT_DC_WR_REQ 22
  5759. +#define STAT_EVENT_DC_WR_MISS 23
  5760. +#define STAT_EVENT_DC_MISS_Q 24
  5761. +#define STAT_EVENT_DC_WB_FULL 25
  5762. +#define STAT_EVENT_DC_REQ_NACK 26
  5763. +#define STAT_EVENT_DC_CORE_REQ 27
  5764. +#define STAT_EVENT_DC_MISS 28
  5765. +#define STAT_EVENT_DC_EVICT 29
  5766. +#define STAT_EVENT_TRUE 30
  5767. +#define STAT_EVENT_FALSE 31
  5768. +
  5769. +/*
  5770. + * OCP_MTEST
  5771. + */
  5772. +#define MTEST_BASE (OCP_BASE + OCP_MTEST)
  5773. +#define MTEST_ADDR 0x00
  5774. +#define MTEST_WR 0x04
  5775. +#define MTEST_RD 0x08
  5776. +#define MTEST_CTRL 0x0c
  5777. +
  5778. +/*
  5779. + * OCP_MCFG (IP7000 only)
  5780. + */
  5781. +#define MCFG_BASE (OCP_BASE + OCP_MCFG)
  5782. +#define MCFG_CTRL 0x00
  5783. +#define MCFG_WCFG 0x04
  5784. +#define MCFG_RCFG 0x08
  5785. +
  5786. +/*
  5787. + * Port registers
  5788. + */
  5789. +#define IO_BASE 0x02000000
  5790. +#define RA (IO_BASE + 0x00000000)
  5791. +#define RB (IO_BASE + 0x00001000)
  5792. +#define RC (IO_BASE + 0x00002000)
  5793. +#define RD (IO_BASE + 0x00003000)
  5794. +#define RE (IO_BASE + 0x00004000)
  5795. +#define RF (IO_BASE + 0x00005000)
  5796. +#define RG (IO_BASE + 0x00006000)
  5797. +#define RH (IO_BASE + 0x00007000)
  5798. +#define RI (IO_BASE + 0x00008000)
  5799. +#define RJ (IO_BASE + 0x00009000)
  5800. +#define RLATCH (IO_BASE + 0x00ff0000) // For latched output only
  5801. +#define IO_PORT_BR_OFFSET 0x00000800
  5802. +
  5803. +/*
  5804. + * General I/O Register Map (per port)
  5805. + */
  5806. +#define IO_FUNC 0x00
  5807. +#define IO_GPIO_CTL 0x04
  5808. +#define IO_GPIO_OUT 0x08
  5809. +#define IO_GPIO_IN 0x0C
  5810. +#define IO_INT_STATUS 0x10
  5811. +#define IO_INT_MASK 0x14
  5812. +#define IO_INT_SET 0x18
  5813. +#define IO_INT_CLR 0x1C
  5814. +#define IO_TX_FIFO 0x20
  5815. +#define IO_TX_FIFO_HI 0x24
  5816. +#define IO_RX_FIFO 0x28
  5817. +#define IO_RX_FIFO_HI 0x2c
  5818. +#define IO_CTL0 0x30
  5819. +#define IO_CTL1 0x34
  5820. +#define IO_CTL2 0x38
  5821. +#define IO_STATUS0 0x3c
  5822. +#define IO_STATUS1 0x40
  5823. +#define IO_STATUS2 0x44
  5824. +#define IO_FIFO_WATER 0x48
  5825. +#define IO_FIFO_LEVEL 0x4c
  5826. +#define IO_GPIO_MASK 0x50
  5827. +
  5828. +#define IO_FUNC_FUNCTION_RESET(func) ((1 << ((func) - 1)) << 4) /* Function 0 doesn't need reset */
  5829. +#define IO_FUNC_RX_FIFO (1 << 3)
  5830. +#define IO_FUNC_SELECT(func) ((func) << 0)
  5831. +
  5832. +/*
  5833. + * External interrupt pins.
  5834. + */
  5835. +#define EXT_INT_IO_BIT(pin) ((pin) + 5) // Interrupt pin number -> I/O INT bit
  5836. +#define EXT_INT_RISING_EDGE(pin) (0x2 << (2*(pin) + 7))
  5837. +#define EXT_INT_FALLING_EDGE(pin) (0x1 << (2*(pin) + 7))
  5838. +
  5839. +/*
  5840. + * Flash
  5841. + */
  5842. +#define IO_XFL_BASE RA
  5843. +
  5844. +#define IO_XFL_INT_START (1 << 16)
  5845. +#define IO_XFL_INT_ERR (1 << 8)
  5846. +#define IO_XFL_INT_DONE (1 << 0)
  5847. +
  5848. +#define IO_XFL_CTL0_MASK (0xffe07fff)
  5849. +#define IO_XFL_CTL0_RD_CMD(cmd) (((cmd) & 0xff) << 24)
  5850. +#define IO_XFL_CTL0_RD_DUMMY(n) (((n) & 0x7) << 21)
  5851. +#define IO_XFL_CTL0_CLK_WIDTH(core_cycles) ((((core_cycles) + 1) & 0x7e) << 8) /* must be even number */
  5852. +#define IO_XFL_CTL0_CE_WAIT(spi_cycles) (((spi_cycles) & 0x3f) << 2)
  5853. +#define IO_XFL_CTL0_MCB_LOCK (1 << 1)
  5854. +#define IO_XFL_CTL0_ENABLE (1 << 0)
  5855. +#define IO_XFL_CTL0_FAST_VALUE(div, wait) (IO_XFL_CTL0_RD_CMD(0xb) | IO_XFL_CTL0_RD_DUMMY(1) | IO_XFL_CTL0_CLK_WIDTH(div) | IO_XFL_CTL0_CE_WAIT(wait) | IO_XFL_CTL0_ENABLE)
  5856. +#define IO_XFL_CTL0_VALUE(div, wait) (IO_XFL_CTL0_RD_CMD(3) | IO_XFL_CTL0_CLK_WIDTH(div) | IO_XFL_CTL0_CE_WAIT(wait) | IO_XFL_CTL0_ENABLE)
  5857. +
  5858. +#define IO_XFL_CTL1_MASK (0xc0003fff)
  5859. +#define IO_XFL_CTL1_FC_INST(inst) (((inst) & 0x3) << 30)
  5860. +#define IO_XFL_CTL1_FC_DATA(n) (((n) & 0x3ff) << 4)
  5861. +#define IO_XFL_CTL1_FC_DUMMY(n) (((n) & 0x7) << 1)
  5862. +#define IO_XFL_CTL1_FC_ADDR (1 << 0)
  5863. +
  5864. +#define IO_XFL_CTL2_FC_CMD(cmd) (((cmd) & 0xff) << 24)
  5865. +#define IO_XFL_CTL2_FC_ADDR(addr) ((addr) & 0x00ffffff) /* Only up to 24 bits */
  5866. +
  5867. +#define IO_XFL_STATUS0_MCB_ACTIVE (1 << 0)
  5868. +#define IO_XFL_STATUS0_IOPCS_ACTIVE (1 << 1)
  5869. +
  5870. +/*
  5871. + * SDRAM
  5872. + */
  5873. +#define IO_SDRAM_DATA_BASE RG
  5874. +#define IO_SDRAM_CNTL_BASE RH
  5875. +
  5876. +#define IO_SDRAM_CTRL0_EN_REF (1 << 0)
  5877. +
  5878. +/*
  5879. + * Port function code (common fucntion codes for all I/O ports)
  5880. + */
  5881. +#define IO_PORTX_FUNC_GPIO 0x00
  5882. +#define IO_PORTX_FUNC_XFL 0x01
  5883. +#define IO_PORTX_FUNC_PCI 0x01
  5884. +#define IO_PORTX_FUNC_SERDES 0x01
  5885. +#define IO_PORTX_FUNC_GMII 0x01
  5886. +#define IO_PORTX_FUNC_DDR 0x01
  5887. +#define IO_PORTX_FUNC_PCIX 0x01
  5888. +#define IO_PORTX_FUNC_USB2_0 0x01
  5889. +#define IO_PORTX_FUNC_GPIO_INT_CLK 0x02
  5890. +#define IO_PORTX_FUNC_PLIO 0x02
  5891. +#define IO_PORTX_FUNC_GPIO_INT 0x03
  5892. +#define IO_PORTX_FUNC_MII 0x03
  5893. +
  5894. +/*
  5895. + * Port 0
  5896. + */
  5897. +#define IO_PORT0_FUNC_GPIO IO_PORTX_FUNC_GPIO
  5898. +#define IO_PORT0_FUNC_XFL_INT_CLK IO_PORTX_FUNC_XFL // Default mode after reset
  5899. +#define IO_PORT0_FUNC_GPIO_INT_CLK IO_PORTX_FUNC_GPIO_INT_CLK
  5900. +#define IO_PORT0_FUNC_GPIO_INT IO_PORTX_FUNC_GPIO_INT
  5901. +
  5902. +/*
  5903. + * Port 1
  5904. + */
  5905. +#define IO_PORT1_FUNC_GPIO IO_PORTX_FUNC_GPIO
  5906. +#define IO_PORT1_FUNC_PCI IO_PORTX_FUNC_PCI // PCI control
  5907. +#define IO_PORT1_FUNC_MII IO_PORTX_FUNC_MII // port 4 MII extension
  5908. +
  5909. +/*
  5910. + * Port 2
  5911. + */
  5912. +#define IO_PORT2_FUNC_GPIO IO_PORTX_FUNC_GPIO
  5913. +#define IO_PORT2_FUNC_PCI IO_PORTX_FUNC_PCI // PCI data I/O
  5914. +#define IO_PORT2_FUNC_PLIO IO_PORTX_FUNC_PLIO // Extended LM
  5915. +
  5916. +/*
  5917. + * Port 3
  5918. + */
  5919. +#define IO_PORT3_FUNC_GPIO IO_PORTX_FUNC_GPIO
  5920. +#define IO_PORT3_FUNC_SERDES IO_PORTX_FUNC_SERDES
  5921. +#define IO_PORT3_FUNC_PLIO IO_PORTX_FUNC_PLIO
  5922. +
  5923. +/*
  5924. + * Port 4
  5925. + */
  5926. +#define IO_PORT4_FUNC_GPIO IO_PORTX_FUNC_GPIO
  5927. +#define IO_PORT4_FUNC_SERDES IO_PORTX_FUNC_SERDES
  5928. +#define IO_PORT4_FUNC_PLIO IO_PORTX_FUNC_PLIO // Extended LM
  5929. +#define IO_PORT4_FUNC_MII IO_PORTX_FUNC_MII
  5930. +
  5931. +/*
  5932. + * Port 5
  5933. + */
  5934. +#define IO_PORT5_FUNC_GPIO IO_PORTX_FUNC_GPIO
  5935. +#define IO_PORT5_FUNC_GMII IO_PORTX_FUNC_GMII
  5936. +
  5937. +/*
  5938. + * Port 6
  5939. + */
  5940. +#define IO_PORT6_FUNC_GPIO IO_PORTX_FUNC_GPIO
  5941. +#define IO_PORT6_FUNC_DDR IO_PORTX_FUNC_DDR
  5942. +
  5943. +/*
  5944. + * Port 7
  5945. + */
  5946. +#define IO_PORT7_FUNC_GPIO IO_PORTX_FUNC_GPIO
  5947. +#define IO_PORT7_FUNC_DDR IO_PORTX_FUNC_DDR
  5948. +
  5949. +/*
  5950. + * Port 8
  5951. + */
  5952. +#define IO_PORT8_FUNC_GPIO IO_PORTX_FUNC_GPIO
  5953. +#define IO_PORT8_FUNC_PCIX IO_PORTX_FUNC_PCIX
  5954. +#define IO_PORT8_FUNC_PLIO IO_PORTX_FUNC_PLIO // Extended LM
  5955. +#define IO_PORT8_FUNC_MII IO_PORTX_FUNC_MII // port 4 MII extension
  5956. +
  5957. +/*
  5958. + * Port 9
  5959. + */
  5960. +#define IO_PORT9_FUNC_USB2_0 IO_PORTX_FUNC_USB2_0
  5961. +
  5962. +/*
  5963. + * FIFO
  5964. + */
  5965. +#define IO_PORTX_INT_FIFO_TX_RESET (1 << 31)
  5966. +#define IO_PORTX_INT_FIFO_RX_RESET (1 << 30)
  5967. +#define IO_PORTX_INT_FIFO_TX_UF (1 << 15)
  5968. +#define IO_PORTX_INT_FIFO_TX_WM (1 << 14)
  5969. +#define IO_PORTX_INT_FIFO_RX_OF (1 << 13)
  5970. +#define IO_PORTX_INT_FIFO_RX_WM (1 << 12)
  5971. +
  5972. +#define IO_PORTX_FUNC_FIFO_TX_WM(n) ((n) << 16)
  5973. +#define IO_PORTX_FUNC_FIFO_RX_WM(n) ((n) << 0)
  5974. +
  5975. +/*
  5976. + * MII
  5977. + */
  5978. +#define IO_PORTX_INT_MII_TX_ERR_SEND (1 << 18)
  5979. +#define IO_PORTX_INT_MII_TX_HALT (1 << 17)
  5980. +#define IO_PORTX_INT_MII_TX_START (1 << 16)
  5981. +#define IO_PORTX_INT_MII_THRESHOLD (1 << 8)
  5982. +#define IO_PORTX_INT_MII_RX_EOP (1 << 7)
  5983. +#define IO_PORTX_INT_MII_RX_SFD (1 << 6)
  5984. +#define IO_PORTX_INT_MII_RX_ERR (1 << 5)
  5985. +#define IO_PORTX_INT_MII_TX_EOP (1 << 4)
  5986. +#define IO_PORTX_INT_MII_COL (1 << 3)
  5987. +#define IO_PORTX_INT_MII_CRS (1 << 2)
  5988. +#define IO_PORTX_INT_MII_ODD_NIB_ERR (1 << 1)
  5989. +#define IO_PORTX_INT_MII_FALSE_CARRIER (1 << 0)
  5990. +
  5991. +/*
  5992. + * SerDes
  5993. + */
  5994. +#define IO_PORTX_INT_SERDES_TXBUF_VALID (1 << 16)
  5995. +#define IO_PORTX_INT_SERDES_RXERR (1 << 7)
  5996. +#define IO_PORTX_INT_SERDES_RXEOP (1 << 6)
  5997. +#define IO_PORTX_INT_SERDES_SYND (1 << 5)
  5998. +#define IO_PORTX_INT_SERDES_TXBE (1 << 4)
  5999. +#define IO_PORTX_INT_SERDES_TXEOP (1 << 3)
  6000. +#define IO_PORTX_INT_SERDES_SXLP (1 << 2)
  6001. +#define IO_PORTX_INT_SERDES_RXBF (1 << 1)
  6002. +#define IO_PORTX_INT_SERDES_RXCRS (1 << 0)
  6003. +
  6004. +#ifndef __ASSEMBLY__
  6005. +struct ubicom32_io_port {
  6006. + volatile u32_t function;
  6007. + volatile u32_t gpio_ctl;
  6008. + volatile u32_t gpio_out;
  6009. + volatile u32_t gpio_in;
  6010. + volatile u32_t int_status;
  6011. + volatile u32_t int_mask;
  6012. + volatile u32_t int_set;
  6013. + volatile u32_t int_clr;
  6014. + volatile u32_t tx_fifo;
  6015. + volatile u32_t tx_fifo_hi;
  6016. + volatile u32_t rx_fifo;
  6017. + volatile u32_t rx_fifo_hi;
  6018. + volatile u32_t ctl0;
  6019. + volatile u32_t ctl1;
  6020. + volatile u32_t ctl2;
  6021. + volatile u32_t status0;
  6022. + volatile u32_t status1;
  6023. + volatile u32_t status2;
  6024. + volatile u32_t fifo_watermark;
  6025. + volatile u32_t fifo_level;
  6026. + volatile u32_t gpio_mask;
  6027. +};
  6028. +
  6029. +#define UBICOM32_IO_PORT(port) ((struct ubicom32_io_port *)((port)))
  6030. +#endif
  6031. +
  6032. +#ifndef __ASSEMBLY__
  6033. +/*
  6034. + * ubicom32_set_interrupt()
  6035. + */
  6036. +extern inline void ubicom32_set_interrupt(u8_t interrupt)
  6037. +{
  6038. + u32_t ibit = INT_BIT_MASK(interrupt);
  6039. +
  6040. + if (INT_REG(interrupt) == INT_REG(INT_CHIP(0, 0))) {
  6041. + asm volatile (
  6042. + "move.4 "D(INT_SET(INT_CHIP(0, 0)))", %0\n\t"
  6043. + :
  6044. + : "r" (ibit)
  6045. + );
  6046. +
  6047. + return;
  6048. + }
  6049. +
  6050. + asm volatile (
  6051. + "move.4 "D(INT_SET(INT_CHIP(1, 0)))", %0\n\t"
  6052. + :
  6053. + : "r" (ibit)
  6054. + );
  6055. +}
  6056. +
  6057. +/*
  6058. + * ubicom32_clear_interrupt()
  6059. + */
  6060. +extern inline void ubicom32_clear_interrupt(u8_t interrupt)
  6061. +{
  6062. + u32_t ibit = INT_BIT_MASK(interrupt);
  6063. +
  6064. + if (INT_REG(interrupt) == INT_REG(INT_CHIP(0, 0))) {
  6065. + asm volatile (
  6066. + "move.4 "D(INT_CLR(INT_CHIP(0, 0)))", %0\n\t"
  6067. + :
  6068. + : "r" (ibit)
  6069. + );
  6070. +
  6071. + return;
  6072. + }
  6073. +
  6074. + asm volatile (
  6075. + "move.4 "D(INT_CLR(INT_CHIP(1, 0)))", %0\n\t"
  6076. + :
  6077. + : "r" (ibit)
  6078. + );
  6079. +}
  6080. +
  6081. +/*
  6082. + * ubicom32_enable_interrupt()
  6083. + */
  6084. +extern inline void ubicom32_enable_interrupt(u8_t interrupt)
  6085. +{
  6086. + u32_t ibit = INT_BIT_MASK(interrupt);
  6087. +
  6088. + if (INT_REG(interrupt) == INT_REG(INT_CHIP(0, 0))) {
  6089. + asm volatile (
  6090. + "or.4 "D(INT_MASK(INT_CHIP(0, 0)))", "D(INT_MASK(INT_CHIP(0, 0)))", %0\n\t"
  6091. + :
  6092. + : "d" (ibit)
  6093. + );
  6094. +
  6095. + return;
  6096. + }
  6097. +
  6098. + asm volatile (
  6099. + "or.4 "D(INT_MASK(INT_CHIP(1, 0)))", "D(INT_MASK(INT_CHIP(1, 0)))", %0\n\t"
  6100. + :
  6101. + : "d" (ibit)
  6102. + );
  6103. +}
  6104. +
  6105. +/*
  6106. + * ubicom32_disable_interrupt()
  6107. + */
  6108. +extern inline void ubicom32_disable_interrupt(u8_t interrupt)
  6109. +{
  6110. + u32_t ibit = ~INT_BIT_MASK(interrupt);
  6111. +
  6112. + if (INT_REG(interrupt) == INT_REG(INT_CHIP(0, 0))) {
  6113. + asm volatile (
  6114. + "and.4 "D(INT_MASK(INT_CHIP(0, 0)))", "D(INT_MASK(INT_CHIP(0, 0)))", %0\n\t"
  6115. + :
  6116. + : "d" (ibit)
  6117. + );
  6118. +
  6119. + return;
  6120. + }
  6121. +
  6122. + asm volatile (
  6123. + "and.4 "D(INT_MASK(INT_CHIP(1, 0)))", "D(INT_MASK(INT_CHIP(1, 0)))", %0\n\t"
  6124. + :
  6125. + : "d" (ibit)
  6126. + );
  6127. +}
  6128. +
  6129. +/*
  6130. + * ubicom32_enable_global_interrupts()
  6131. + */
  6132. +extern inline void ubicom32_enable_global_interrupts(void)
  6133. +{
  6134. + asm volatile(
  6135. + "bset GLOBAL_CTRL, GLOBAL_CTRL, #%bit("D(GLOBAL_CTRL_INT_EN)")"
  6136. + );
  6137. +}
  6138. +
  6139. +/*
  6140. + * ubicom32_disable_global_interrupts()
  6141. + */
  6142. +extern inline void ubicom32_disable_global_interrupts(void)
  6143. +{
  6144. + asm volatile(
  6145. + "bclr GLOBAL_CTRL, GLOBAL_CTRL, #%bit("D(GLOBAL_CTRL_INT_EN)")"
  6146. + );
  6147. +}
  6148. +
  6149. +/*
  6150. + * ubicom32_get_reset_reason()
  6151. + */
  6152. +extern inline u32_t ubicom32_get_reset_reason(void)
  6153. +{
  6154. + return *(u32_t *)(GENERAL_CFG_BASE + GEN_RESET_REASON);
  6155. +}
  6156. +
  6157. +/*
  6158. + * ubicom32_read_reg()
  6159. + */
  6160. +extern inline u32_t ubicom32_read_reg(volatile void *reg)
  6161. +{
  6162. + u32_t v;
  6163. + asm volatile (
  6164. + "move.4 %[dest], %[src] \n\t"
  6165. + : [dest] "=r" (v)
  6166. + : [src] "m" (*(u32_t *)reg)
  6167. + );
  6168. + return v;
  6169. +}
  6170. +
  6171. +/*
  6172. + * ubicom32_write_reg()
  6173. + */
  6174. +extern inline void ubicom32_write_reg(volatile void *reg, u32_t v)
  6175. +{
  6176. + asm volatile (
  6177. + "move.4 %[dest], %[src] \n\t"
  6178. + :
  6179. + : [src] "r" (v), [dest] "m" (*(u32_t *)reg)
  6180. + );
  6181. +}
  6182. +
  6183. +#endif /* __ASSEMBLY__ */
  6184. +#endif /* _ASM_UBICOM32_IP5000_H */
  6185. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/ipcbuf.h linux-2.6.28.10/arch/ubicom32/include/asm/ipcbuf.h
  6186. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/ipcbuf.h 1970-01-01 02:00:00.000000000 +0200
  6187. +++ linux-2.6.28.10/arch/ubicom32/include/asm/ipcbuf.h 2009-08-06 10:31:02.000000000 +0300
  6188. @@ -0,0 +1,55 @@
  6189. +/*
  6190. + * arch/ubicom32/include/asm/ipcbuf.h
  6191. + * Definition of ipc64_perm struct for Ubicom32 architecture.
  6192. + *
  6193. + * (C) Copyright 2009, Ubicom, Inc.
  6194. + *
  6195. + * This file is part of the Ubicom32 Linux Kernel Port.
  6196. + *
  6197. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  6198. + * it and/or modify it under the terms of the GNU General Public License
  6199. + * as published by the Free Software Foundation, either version 2 of the
  6200. + * License, or (at your option) any later version.
  6201. + *
  6202. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  6203. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  6204. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  6205. + * the GNU General Public License for more details.
  6206. + *
  6207. + * You should have received a copy of the GNU General Public License
  6208. + * along with the Ubicom32 Linux Kernel Port. If not,
  6209. + * see <http://www.gnu.org/licenses/>.
  6210. + *
  6211. + * Ubicom32 implementation derived from (with many thanks):
  6212. + * arch/m68knommu
  6213. + * arch/blackfin
  6214. + * arch/parisc
  6215. + */
  6216. +#ifndef _ASM_UBICOM32_IPCBUF_H
  6217. +#define _ASM_UBICOM32_IPCBUF_H
  6218. +
  6219. +/*
  6220. + * The user_ipc_perm structure for m68k architecture.
  6221. + * Note extra padding because this structure is passed back and forth
  6222. + * between kernel and user space.
  6223. + *
  6224. + * Pad space is left for:
  6225. + * - 32-bit mode_t and seq
  6226. + * - 2 miscellaneous 32-bit values
  6227. + */
  6228. +struct ipc64_perm
  6229. +{
  6230. + __kernel_key_t key;
  6231. + __kernel_uid32_t uid;
  6232. + __kernel_gid32_t gid;
  6233. + __kernel_uid32_t cuid;
  6234. + __kernel_gid32_t cgid;
  6235. + __kernel_mode_t mode;
  6236. + unsigned short __pad1;
  6237. + unsigned short seq;
  6238. + unsigned short __pad2;
  6239. + unsigned long __unused1;
  6240. + unsigned long __unused2;
  6241. +};
  6242. +
  6243. +#endif /* _ASM_UBICOM32_IPCBUF_H */
  6244. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/irqflags.h linux-2.6.28.10/arch/ubicom32/include/asm/irqflags.h
  6245. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/irqflags.h 1970-01-01 02:00:00.000000000 +0200
  6246. +++ linux-2.6.28.10/arch/ubicom32/include/asm/irqflags.h 2009-08-06 10:31:02.000000000 +0300
  6247. @@ -0,0 +1,94 @@
  6248. +/*
  6249. + * arch/ubicom32/include/asm/irqflags.h
  6250. + * Raw implementation of local IRQ functions.
  6251. + *
  6252. + * (C) Copyright 2009, Ubicom, Inc.
  6253. + *
  6254. + * This file is part of the Ubicom32 Linux Kernel Port.
  6255. + *
  6256. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  6257. + * it and/or modify it under the terms of the GNU General Public License
  6258. + * as published by the Free Software Foundation, either version 2 of the
  6259. + * License, or (at your option) any later version.
  6260. + *
  6261. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  6262. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  6263. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  6264. + * the GNU General Public License for more details.
  6265. + *
  6266. + * You should have received a copy of the GNU General Public License
  6267. + * along with the Ubicom32 Linux Kernel Port. If not,
  6268. + * see <http://www.gnu.org/licenses/>.
  6269. + *
  6270. + * Ubicom32 implementation derived from (with many thanks):
  6271. + * arch/m68knommu
  6272. + * arch/blackfin
  6273. + * arch/parisc
  6274. + */
  6275. +#ifndef _ASM_UBICOM32_IRQFLAGS_H
  6276. +#define _ASM_UBICOM32_IRQFLAGS_H
  6277. +
  6278. +#include <linux/thread_info.h>
  6279. +#include <asm/ubicom32-common.h>
  6280. +#include <asm/smp.h>
  6281. +#include <asm/ldsr.h>
  6282. +
  6283. +#if defined(CONFIG_PREEMPT)
  6284. +#error Not supported by Ubicom32 irq handling, yet!
  6285. +#endif
  6286. +
  6287. +/*
  6288. + * raw_local_irq_enable()
  6289. + * Enable interrupts for this thread.
  6290. + */
  6291. +static inline void raw_local_irq_enable(void)
  6292. +{
  6293. + ldsr_local_irq_enable();
  6294. +}
  6295. +
  6296. +/*
  6297. + * raw_local_irq_disable()
  6298. + * Disable interrupts for this thread.
  6299. + */
  6300. +static inline void raw_local_irq_disable(void)
  6301. +{
  6302. + ldsr_local_irq_disable();
  6303. +}
  6304. +
  6305. +/*
  6306. + * raw_local_save_flags()
  6307. + * Get the current IRQ state.
  6308. + */
  6309. +#define raw_local_save_flags(flags) \
  6310. +do { \
  6311. + (flags) = ldsr_local_irq_is_disabled(); \
  6312. +} while (0)
  6313. +
  6314. +/*
  6315. + * raw_local_irq_save()
  6316. + * Save the current interrupt state and disable interrupts.
  6317. + */
  6318. +#define raw_local_irq_save(flags) \
  6319. +do { \
  6320. + (flags) = ldsr_local_irq_save(); \
  6321. +} while (0)
  6322. +
  6323. +/*
  6324. + * raw_local_irq_restore()
  6325. + * Restore the IRQ state back to flags.
  6326. + */
  6327. +static inline void raw_local_irq_restore(unsigned long flags)
  6328. +{
  6329. + ldsr_local_irq_restore(flags);
  6330. +}
  6331. +
  6332. +/*
  6333. + * raw_irqs_disabled_flags()
  6334. + * Return true if the flags indicate that IRQ(s) are disabled.
  6335. + */
  6336. +static inline int raw_irqs_disabled_flags(unsigned long flags)
  6337. +{
  6338. + return (flags);
  6339. +}
  6340. +
  6341. +#endif /* _ASM_UBICOM32_IRQFLAGS_H */
  6342. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/irq.h linux-2.6.28.10/arch/ubicom32/include/asm/irq.h
  6343. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/irq.h 1970-01-01 02:00:00.000000000 +0200
  6344. +++ linux-2.6.28.10/arch/ubicom32/include/asm/irq.h 2009-08-06 10:31:02.000000000 +0300
  6345. @@ -0,0 +1,45 @@
  6346. +/*
  6347. + * arch/ubicom32/include/asm/irq.h
  6348. + * IRQ definitions for Ubicom32 architecture.
  6349. + *
  6350. + * (C) Copyright 2009, Ubicom, Inc.
  6351. + *
  6352. + * This file is part of the Ubicom32 Linux Kernel Port.
  6353. + *
  6354. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  6355. + * it and/or modify it under the terms of the GNU General Public License
  6356. + * as published by the Free Software Foundation, either version 2 of the
  6357. + * License, or (at your option) any later version.
  6358. + *
  6359. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  6360. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  6361. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  6362. + * the GNU General Public License for more details.
  6363. + *
  6364. + * You should have received a copy of the GNU General Public License
  6365. + * along with the Ubicom32 Linux Kernel Port. If not,
  6366. + * see <http://www.gnu.org/licenses/>.
  6367. + *
  6368. + * Ubicom32 implementation derived from (with many thanks):
  6369. + * arch/m68knommu
  6370. + * arch/blackfin
  6371. + * arch/parisc
  6372. + */
  6373. +#ifndef _ASM_UBICOM32_IRQ_H
  6374. +#define _ASM_UBICOM32_IRQ_H
  6375. +
  6376. +#include <asm/irqflags.h>
  6377. +
  6378. +/*
  6379. + * We setup the IRQS to cover the full range of interrupt registers in
  6380. + * processor.
  6381. + */
  6382. +#define NR_IRQS 64
  6383. +
  6384. +#define irq_canonicalize(irq) (irq)
  6385. +
  6386. +extern int irq_soft_alloc(unsigned int *soft);
  6387. +extern void ack_bad_irq(unsigned int irq);
  6388. +extern void do_IRQ(int irq, struct pt_regs *fp);
  6389. +
  6390. +#endif /* _ASM_UBICOM32_IRQ_H */
  6391. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/irq_regs.h linux-2.6.28.10/arch/ubicom32/include/asm/irq_regs.h
  6392. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/irq_regs.h 1970-01-01 02:00:00.000000000 +0200
  6393. +++ linux-2.6.28.10/arch/ubicom32/include/asm/irq_regs.h 2009-08-06 10:31:02.000000000 +0300
  6394. @@ -0,0 +1,33 @@
  6395. +/*
  6396. + * arch/ubicom32/include/asm/irq_regs.h
  6397. + * Generic irq_regs.h for Ubicom32 architecture.
  6398. + *
  6399. + * (C) Copyright 2009, Ubicom, Inc.
  6400. + *
  6401. + * This file is part of the Ubicom32 Linux Kernel Port.
  6402. + *
  6403. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  6404. + * it and/or modify it under the terms of the GNU General Public License
  6405. + * as published by the Free Software Foundation, either version 2 of the
  6406. + * License, or (at your option) any later version.
  6407. + *
  6408. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  6409. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  6410. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  6411. + * the GNU General Public License for more details.
  6412. + *
  6413. + * You should have received a copy of the GNU General Public License
  6414. + * along with the Ubicom32 Linux Kernel Port. If not,
  6415. + * see <http://www.gnu.org/licenses/>.
  6416. + *
  6417. + * Ubicom32 implementation derived from (with many thanks):
  6418. + * arch/m68knommu
  6419. + * arch/blackfin
  6420. + * arch/parisc
  6421. + */
  6422. +#ifndef _ASM_UBICOM32_IRQ_REGS_H
  6423. +#define _ASM_UBICOM32_IRQ_REGS_H
  6424. +
  6425. +#include <asm-generic/irq_regs.h>
  6426. +
  6427. +#endif /* _ASM_UBICOM32_IRQ_REGS_H */
  6428. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/Kbuild linux-2.6.28.10/arch/ubicom32/include/asm/Kbuild
  6429. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/Kbuild 1970-01-01 02:00:00.000000000 +0200
  6430. +++ linux-2.6.28.10/arch/ubicom32/include/asm/Kbuild 2009-08-06 10:31:02.000000000 +0300
  6431. @@ -0,0 +1 @@
  6432. +include include/asm-generic/Kbuild.asm
  6433. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/kdebug.h linux-2.6.28.10/arch/ubicom32/include/asm/kdebug.h
  6434. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/kdebug.h 1970-01-01 02:00:00.000000000 +0200
  6435. +++ linux-2.6.28.10/arch/ubicom32/include/asm/kdebug.h 2009-08-06 10:31:02.000000000 +0300
  6436. @@ -0,0 +1,33 @@
  6437. +/*
  6438. + * arch/ubicom32/include/asm/kdebug.h
  6439. + * Generic kdebug.h for Ubicom32 architecture.
  6440. + *
  6441. + * (C) Copyright 2009, Ubicom, Inc.
  6442. + *
  6443. + * This file is part of the Ubicom32 Linux Kernel Port.
  6444. + *
  6445. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  6446. + * it and/or modify it under the terms of the GNU General Public License
  6447. + * as published by the Free Software Foundation, either version 2 of the
  6448. + * License, or (at your option) any later version.
  6449. + *
  6450. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  6451. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  6452. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  6453. + * the GNU General Public License for more details.
  6454. + *
  6455. + * You should have received a copy of the GNU General Public License
  6456. + * along with the Ubicom32 Linux Kernel Port. If not,
  6457. + * see <http://www.gnu.org/licenses/>.
  6458. + *
  6459. + * Ubicom32 implementation derived from (with many thanks):
  6460. + * arch/m68knommu
  6461. + * arch/blackfin
  6462. + * arch/parisc
  6463. + */
  6464. +#ifndef _ASM_UBICOM32_KDEBUG_H
  6465. +#define _ASM_UBICOM32_KDEBUG_H
  6466. +
  6467. +#include <asm-generic/kdebug.h>
  6468. +
  6469. +#endif /* _ASM_UBICOM32_KDEBUG_H */
  6470. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/kmap_types.h linux-2.6.28.10/arch/ubicom32/include/asm/kmap_types.h
  6471. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/kmap_types.h 1970-01-01 02:00:00.000000000 +0200
  6472. +++ linux-2.6.28.10/arch/ubicom32/include/asm/kmap_types.h 2009-08-06 10:31:02.000000000 +0300
  6473. @@ -0,0 +1,48 @@
  6474. +/*
  6475. + * arch/ubicom32/include/asm/kmap_types.h
  6476. + * Definition of km_type's for Ubicom32 architecture.
  6477. + *
  6478. + * (C) Copyright 2009, Ubicom, Inc.
  6479. + *
  6480. + * This file is part of the Ubicom32 Linux Kernel Port.
  6481. + *
  6482. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  6483. + * it and/or modify it under the terms of the GNU General Public License
  6484. + * as published by the Free Software Foundation, either version 2 of the
  6485. + * License, or (at your option) any later version.
  6486. + *
  6487. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  6488. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  6489. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  6490. + * the GNU General Public License for more details.
  6491. + *
  6492. + * You should have received a copy of the GNU General Public License
  6493. + * along with the Ubicom32 Linux Kernel Port. If not,
  6494. + * see <http://www.gnu.org/licenses/>.
  6495. + *
  6496. + * Ubicom32 implementation derived from (with many thanks):
  6497. + * arch/m68knommu
  6498. + * arch/blackfin
  6499. + * arch/parisc
  6500. + */
  6501. +#ifndef _ASM_UBICOM32_KMAP_TYPES_H
  6502. +#define _ASM_UBICOM32_KMAP_TYPES_H
  6503. +
  6504. +enum km_type {
  6505. + KM_BOUNCE_READ,
  6506. + KM_SKB_SUNRPC_DATA,
  6507. + KM_SKB_DATA_SOFTIRQ,
  6508. + KM_USER0,
  6509. + KM_USER1,
  6510. + KM_BIO_SRC_IRQ,
  6511. + KM_BIO_DST_IRQ,
  6512. + KM_PTE0,
  6513. + KM_PTE1,
  6514. + KM_IRQ0,
  6515. + KM_IRQ1,
  6516. + KM_SOFTIRQ0,
  6517. + KM_SOFTIRQ1,
  6518. + KM_TYPE_NR
  6519. +};
  6520. +
  6521. +#endif /* _ASM_UBICOM32_KMAP_TYPES_H */
  6522. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/ldsr.h linux-2.6.28.10/arch/ubicom32/include/asm/ldsr.h
  6523. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/ldsr.h 1970-01-01 02:00:00.000000000 +0200
  6524. +++ linux-2.6.28.10/arch/ubicom32/include/asm/ldsr.h 2009-08-06 10:31:02.000000000 +0300
  6525. @@ -0,0 +1,186 @@
  6526. +/*
  6527. + * arch/ubicom32/include/asm/ldsr.h
  6528. + * Ubicom32 LDSR interface definitions.
  6529. + *
  6530. + * (C) Copyright 2009, Ubicom, Inc.
  6531. + *
  6532. + * This file is part of the Ubicom32 Linux Kernel Port.
  6533. + *
  6534. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  6535. + * it and/or modify it under the terms of the GNU General Public License
  6536. + * as published by the Free Software Foundation, either version 2 of the
  6537. + * License, or (at your option) any later version.
  6538. + *
  6539. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  6540. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  6541. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  6542. + * the GNU General Public License for more details.
  6543. + *
  6544. + * You should have received a copy of the GNU General Public License
  6545. + * along with the Ubicom32 Linux Kernel Port. If not,
  6546. + * see <http://www.gnu.org/licenses/>.
  6547. + *
  6548. + * Ubicom32 implementation derived from (with many thanks):
  6549. + * arch/m68knommu
  6550. + * arch/blackfin
  6551. + * arch/parisc
  6552. + */
  6553. +#ifndef _ASM_UBICOM32_LDSR_H
  6554. +#define _ASM_UBICOM32_LDSR_H
  6555. +
  6556. +#include <asm/ubicom32-common.h>
  6557. +#include <asm/types.h>
  6558. +#include <asm/thread.h>
  6559. +
  6560. +extern unsigned int ldsr_soft_irq_mask;
  6561. +
  6562. +/*
  6563. + * ldsr_local_irq_is_disabled()
  6564. + * Test if interrupts are disabled for this thread?
  6565. + */
  6566. +static inline int ldsr_local_irq_is_disabled(void)
  6567. +{
  6568. + int ret;
  6569. + thread_t self = thread_get_self();
  6570. + unsigned int mask = (1 << self);
  6571. +
  6572. + asm volatile (
  6573. + " and.4 %0, scratchpad1, %1 \n\t"
  6574. + : "=r" (ret)
  6575. + : "d" (mask)
  6576. + : "cc"
  6577. + );
  6578. +
  6579. + /*
  6580. + * We return a simple 1 == disabled, 0 == enabled
  6581. + * losing which tid this is for, because Linux
  6582. + * can restore interrupts on a different thread.
  6583. + */
  6584. + return ret >> self;
  6585. +}
  6586. +
  6587. +/*
  6588. + * ldsr_local_irq_save()
  6589. + * Get the current interrupt state and disable interrupts.
  6590. + */
  6591. +static inline unsigned int ldsr_local_irq_save(void)
  6592. +{
  6593. + int ret;
  6594. + thread_t self = thread_get_self();
  6595. + unsigned int mask = (1 << self);
  6596. +
  6597. + /*
  6598. + * Ensure the compiler can not optimize out the code
  6599. + * (volatile) and that it does not "cache" values around
  6600. + * the interrupt state change (memory). This ensures
  6601. + * that interrupt changes are treated as a critical
  6602. + * section.
  6603. + */
  6604. + asm volatile (
  6605. + " and.4 %0, scratchpad1, %1 \n\t"
  6606. + " or.4 scratchpad1, scratchpad1, %1 \n\t"
  6607. + : "=&r" (ret)
  6608. + : "d" (mask)
  6609. + : "cc", "memory"
  6610. + );
  6611. +
  6612. + /*
  6613. + * We return a simple 1 == disabled, 0 == enabled
  6614. + * losing which tid this is for, because Linux
  6615. + * can restore interrupts on a different thread.
  6616. + */
  6617. + return ret >> self;
  6618. +}
  6619. +
  6620. +/*
  6621. + * ldsr_local_irq_restore()
  6622. + * Restore this cpu's interrupt enable/disable state.
  6623. + *
  6624. + * Note: flags is either 0 or 1.
  6625. + */
  6626. +static inline void ldsr_local_irq_restore(unsigned int flags)
  6627. +{
  6628. + unsigned int temp;
  6629. + thread_t self = thread_get_self();
  6630. + unsigned int mask = (1 << self);
  6631. + flags = (flags << self);
  6632. +
  6633. + /*
  6634. + * Ensure the compiler can not optimize out the code
  6635. + * (volatile) and that it does not "cache" values around
  6636. + * the interrupt state change (memory). This ensures
  6637. + * that interrupt changes are treated as a critical
  6638. + * section.
  6639. + *
  6640. + * Atomic change to our bit in scratchpad1 without
  6641. + * causing any temporary glitch in the value and
  6642. + * without effecting other values. Also this uses
  6643. + * no branches so no penalties.
  6644. + */
  6645. + asm volatile (
  6646. + " xor.4 %0, scratchpad1, %1 \n\t"
  6647. + " and.4 %0, %2, %0 \n\t"
  6648. + " xor.4 scratchpad1, scratchpad1, %0 \n\t"
  6649. + " move.4 int_set0, %3 \n\t"
  6650. + : "=&d"(temp)
  6651. + : "d"(flags), "r"(mask), "r"(ldsr_soft_irq_mask)
  6652. + : "cc", "memory"
  6653. + );
  6654. +}
  6655. +
  6656. +/*
  6657. + * ldsr_local_irq_disable_interrupt()
  6658. + * Disable ints for this thread.
  6659. + */
  6660. +static inline void ldsr_local_irq_disable(void)
  6661. +{
  6662. + unsigned int mask = (1 << thread_get_self());
  6663. +
  6664. + /*
  6665. + * Ensure the compiler can not optimize out the code
  6666. + * (volatile) and that it does not "cache" values around
  6667. + * the interrupt state change (memory). This ensures
  6668. + * that interrupt changes are treated as a critical
  6669. + * section.
  6670. + */
  6671. + asm volatile (
  6672. + " or.4 scratchpad1, scratchpad1, %0 \n\t"
  6673. + :
  6674. + : "d" (mask)
  6675. + : "cc", "memory"
  6676. + );
  6677. +}
  6678. +
  6679. +/*
  6680. + * ldsr_local_irq_enable_interrupt
  6681. + * Enable ints for this thread.
  6682. + */
  6683. +static inline void ldsr_local_irq_enable(void)
  6684. +{
  6685. + unsigned int mask = (1 << thread_get_self());
  6686. +
  6687. + /*
  6688. + * Ensure the compiler can not optimize out the code
  6689. + * (volatile) and that it does not "cache" values around
  6690. + * the interrupt state change (memory). This ensures
  6691. + * that interrupt changes are treated as a critical
  6692. + * section.
  6693. + */
  6694. + asm volatile (
  6695. + " and.4 scratchpad1, scratchpad1, %0 \n\t"
  6696. + " move.4 int_set0, %1 \n\t"
  6697. + :
  6698. + : "d" (~mask), "r" (ldsr_soft_irq_mask)
  6699. + : "cc", "memory"
  6700. + );
  6701. +}
  6702. +
  6703. +extern void ldsr_init(void);
  6704. +extern void ldsr_set_trap_irq(unsigned int irq);
  6705. +extern void ldsr_mask_vector(unsigned int vector);
  6706. +extern void ldsr_unmask_vector(unsigned int vector);
  6707. +extern void ldsr_enable_vector(unsigned int vector);
  6708. +extern void ldsr_disable_vector(unsigned int vector);
  6709. +extern thread_t ldsr_get_threadid(void);
  6710. +
  6711. +#endif /* _ASM_UBICOM32_LDSR_H */
  6712. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/linkage.h linux-2.6.28.10/arch/ubicom32/include/asm/linkage.h
  6713. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/linkage.h 1970-01-01 02:00:00.000000000 +0200
  6714. +++ linux-2.6.28.10/arch/ubicom32/include/asm/linkage.h 2009-08-06 10:31:02.000000000 +0300
  6715. @@ -0,0 +1,34 @@
  6716. +/*
  6717. + * arch/ubicom32/include/asm/linkage.h
  6718. + * Definition of Ubicom32 architecture specific linkage types.
  6719. + *
  6720. + * (C) Copyright 2009, Ubicom, Inc.
  6721. + *
  6722. + * This file is part of the Ubicom32 Linux Kernel Port.
  6723. + *
  6724. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  6725. + * it and/or modify it under the terms of the GNU General Public License
  6726. + * as published by the Free Software Foundation, either version 2 of the
  6727. + * License, or (at your option) any later version.
  6728. + *
  6729. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  6730. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  6731. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  6732. + * the GNU General Public License for more details.
  6733. + *
  6734. + * You should have received a copy of the GNU General Public License
  6735. + * along with the Ubicom32 Linux Kernel Port. If not,
  6736. + * see <http://www.gnu.org/licenses/>.
  6737. + *
  6738. + * Ubicom32 implementation derived from (with many thanks):
  6739. + * arch/m68knommu
  6740. + * arch/blackfin
  6741. + * arch/parisc
  6742. + */
  6743. +#ifndef _ASM_UBICOM32_LINKAGE_H
  6744. +#define _ASM_UBICOM32_LINKAGE_H
  6745. +
  6746. +#define __ocm_text __section(.ocm_text)
  6747. +#define __ocm_data __section(.ocm_data)
  6748. +
  6749. +#endif /* _ASM_UBICOM32_LINKAGE_H */
  6750. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/local.h linux-2.6.28.10/arch/ubicom32/include/asm/local.h
  6751. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/local.h 1970-01-01 02:00:00.000000000 +0200
  6752. +++ linux-2.6.28.10/arch/ubicom32/include/asm/local.h 2009-08-06 10:31:02.000000000 +0300
  6753. @@ -0,0 +1,33 @@
  6754. +/*
  6755. + * arch/ubicom32/include/asm/local.h
  6756. + * Generic local.h for Ubicom32 architecture.
  6757. + *
  6758. + * (C) Copyright 2009, Ubicom, Inc.
  6759. + *
  6760. + * This file is part of the Ubicom32 Linux Kernel Port.
  6761. + *
  6762. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  6763. + * it and/or modify it under the terms of the GNU General Public License
  6764. + * as published by the Free Software Foundation, either version 2 of the
  6765. + * License, or (at your option) any later version.
  6766. + *
  6767. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  6768. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  6769. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  6770. + * the GNU General Public License for more details.
  6771. + *
  6772. + * You should have received a copy of the GNU General Public License
  6773. + * along with the Ubicom32 Linux Kernel Port. If not,
  6774. + * see <http://www.gnu.org/licenses/>.
  6775. + *
  6776. + * Ubicom32 implementation derived from (with many thanks):
  6777. + * arch/m68knommu
  6778. + * arch/blackfin
  6779. + * arch/parisc
  6780. + */
  6781. +#ifndef _ASM_UBICOM32_LOCAL_H
  6782. +#define _ASM_UBICOM32_LOCAL_H
  6783. +
  6784. +#include <asm-generic/local.h>
  6785. +
  6786. +#endif /* _ASM_UBICOM32_LOCAL_H */
  6787. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/machdep.h linux-2.6.28.10/arch/ubicom32/include/asm/machdep.h
  6788. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/machdep.h 1970-01-01 02:00:00.000000000 +0200
  6789. +++ linux-2.6.28.10/arch/ubicom32/include/asm/machdep.h 2009-08-06 10:31:02.000000000 +0300
  6790. @@ -0,0 +1,43 @@
  6791. +/*
  6792. + * arch/ubicom32/include/asm/machdep.h
  6793. + * Machine dependent utility routines.
  6794. + *
  6795. + * (C) Copyright 2009, Ubicom, Inc.
  6796. + *
  6797. + * This file is part of the Ubicom32 Linux Kernel Port.
  6798. + *
  6799. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  6800. + * it and/or modify it under the terms of the GNU General Public License
  6801. + * as published by the Free Software Foundation, either version 2 of the
  6802. + * License, or (at your option) any later version.
  6803. + *
  6804. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  6805. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  6806. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  6807. + * the GNU General Public License for more details.
  6808. + *
  6809. + * You should have received a copy of the GNU General Public License
  6810. + * along with the Ubicom32 Linux Kernel Port. If not,
  6811. + * see <http://www.gnu.org/licenses/>.
  6812. + *
  6813. + * Ubicom32 implementation derived from (with many thanks):
  6814. + * arch/m68knommu
  6815. + * arch/blackfin
  6816. + * arch/parisc
  6817. + */
  6818. +#ifndef _ASM_UBICOM32_MACHDEP_H
  6819. +#define _ASM_UBICOM32_MACHDEP_H
  6820. +
  6821. +#include <linux/interrupt.h>
  6822. +
  6823. +/* Hardware clock functions */
  6824. +extern unsigned long hw_timer_offset(void);
  6825. +
  6826. +/* machine dependent power off functions */
  6827. +extern void (*mach_reset)(void);
  6828. +extern void (*mach_halt)(void);
  6829. +extern void (*mach_power_off)(void);
  6830. +
  6831. +extern void config_BSP(char *command, int len);
  6832. +
  6833. +#endif /* _ASM_UBICOM32_MACHDEP_H */
  6834. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/mc146818rtc.h linux-2.6.28.10/arch/ubicom32/include/asm/mc146818rtc.h
  6835. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/mc146818rtc.h 1970-01-01 02:00:00.000000000 +0200
  6836. +++ linux-2.6.28.10/arch/ubicom32/include/asm/mc146818rtc.h 2009-08-06 10:31:02.000000000 +0300
  6837. @@ -0,0 +1,36 @@
  6838. +/*
  6839. + * arch/ubicom32/include/asm/mc146818rtc.h
  6840. + * Generic mc146818rtc.h for Ubicom32 architecture.
  6841. + *
  6842. + * (C) Copyright 2009, Ubicom, Inc.
  6843. + *
  6844. + * This file is part of the Ubicom32 Linux Kernel Port.
  6845. + *
  6846. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  6847. + * it and/or modify it under the terms of the GNU General Public License
  6848. + * as published by the Free Software Foundation, either version 2 of the
  6849. + * License, or (at your option) any later version.
  6850. + *
  6851. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  6852. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  6853. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  6854. + * the GNU General Public License for more details.
  6855. + *
  6856. + * You should have received a copy of the GNU General Public License
  6857. + * along with the Ubicom32 Linux Kernel Port. If not,
  6858. + * see <http://www.gnu.org/licenses/>.
  6859. + *
  6860. + * Ubicom32 implementation derived from (with many thanks):
  6861. + * arch/m68knommu
  6862. + * arch/blackfin
  6863. + * arch/parisc
  6864. + */
  6865. +/*
  6866. + * Machine dependent access functions for RTC registers.
  6867. + */
  6868. +#ifndef _ASM_UBICOM32_MC146818RTC_H
  6869. +#define _ASM_UBICOM32_MC146818RTC_H
  6870. +
  6871. +/* empty include file to satisfy the include in genrtc.c/ide-geometry.c */
  6872. +
  6873. +#endif /* _ASM_UBICOM32_MC146818RTC_H */
  6874. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/mman.h linux-2.6.28.10/arch/ubicom32/include/asm/mman.h
  6875. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/mman.h 1970-01-01 02:00:00.000000000 +0200
  6876. +++ linux-2.6.28.10/arch/ubicom32/include/asm/mman.h 2009-08-06 10:31:02.000000000 +0300
  6877. @@ -0,0 +1,44 @@
  6878. +/*
  6879. + * arch/ubicom32/include/asm/mman.h
  6880. + * Memory mapping definitions for Ubicom32 architecture.
  6881. + *
  6882. + * (C) Copyright 2009, Ubicom, Inc.
  6883. + *
  6884. + * This file is part of the Ubicom32 Linux Kernel Port.
  6885. + *
  6886. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  6887. + * it and/or modify it under the terms of the GNU General Public License
  6888. + * as published by the Free Software Foundation, either version 2 of the
  6889. + * License, or (at your option) any later version.
  6890. + *
  6891. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  6892. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  6893. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  6894. + * the GNU General Public License for more details.
  6895. + *
  6896. + * You should have received a copy of the GNU General Public License
  6897. + * along with the Ubicom32 Linux Kernel Port. If not,
  6898. + * see <http://www.gnu.org/licenses/>.
  6899. + *
  6900. + * Ubicom32 implementation derived from (with many thanks):
  6901. + * arch/m68knommu
  6902. + * arch/blackfin
  6903. + * arch/parisc
  6904. + */
  6905. +#ifndef _ASM_UBICOM32_MMAN_H
  6906. +#define _ASM_UBICOM32_MMAN_H
  6907. +
  6908. +#include <asm-generic/mman.h>
  6909. +
  6910. +#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
  6911. +#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
  6912. +#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */
  6913. +#define MAP_LOCKED 0x2000 /* pages are locked */
  6914. +#define MAP_NORESERVE 0x4000 /* don't check for reservations */
  6915. +#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
  6916. +#define MAP_NONBLOCK 0x10000 /* do not block on IO */
  6917. +
  6918. +#define MCL_CURRENT 1 /* lock all current mappings */
  6919. +#define MCL_FUTURE 2 /* lock all future mappings */
  6920. +
  6921. +#endif /* _ASM_UBICOM32_MMAN_H */
  6922. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/mmu_context.h linux-2.6.28.10/arch/ubicom32/include/asm/mmu_context.h
  6923. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/mmu_context.h 1970-01-01 02:00:00.000000000 +0200
  6924. +++ linux-2.6.28.10/arch/ubicom32/include/asm/mmu_context.h 2009-08-06 10:31:02.000000000 +0300
  6925. @@ -0,0 +1,60 @@
  6926. +/*
  6927. + * arch/ubicom32/include/asm/mmu_context.h
  6928. + * MMU context definitions for Ubicom32 architecture.
  6929. + *
  6930. + * (C) Copyright 2009, Ubicom, Inc.
  6931. + * Copyright (C) 2004, Microtronix Datacom Ltd., All rights reserved.
  6932. + *
  6933. + * This file is part of the Ubicom32 Linux Kernel Port.
  6934. + *
  6935. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  6936. + * it and/or modify it under the terms of the GNU General Public License
  6937. + * as published by the Free Software Foundation, either version 2 of the
  6938. + * License, or (at your option) any later version.
  6939. + *
  6940. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  6941. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  6942. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  6943. + * the GNU General Public License for more details.
  6944. + *
  6945. + * You should have received a copy of the GNU General Public License
  6946. + * along with the Ubicom32 Linux Kernel Port. If not,
  6947. + * see <http://www.gnu.org/licenses/>.
  6948. + *
  6949. + * Ubicom32 implementation derived from (with many thanks):
  6950. + * arch/m68knommu
  6951. + * arch/blackfin
  6952. + * arch/parisc
  6953. + */
  6954. +
  6955. +#ifndef _ASM_UBICOM32_MMU_CONTEXT_H
  6956. +#define _ASM_UBICOM32_MMU_CONTEXT_H
  6957. +
  6958. +#include <asm/setup.h>
  6959. +#include <asm/page.h>
  6960. +#include <asm/pgalloc.h>
  6961. +
  6962. +static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
  6963. +{
  6964. +}
  6965. +
  6966. +extern inline int
  6967. +init_new_context(struct task_struct *tsk, struct mm_struct *mm)
  6968. +{
  6969. + // mm->context = virt_to_phys(mm->pgd);
  6970. + return(0);
  6971. +}
  6972. +
  6973. +#define destroy_context(mm) do { } while(0)
  6974. +
  6975. +static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk)
  6976. +{
  6977. +}
  6978. +
  6979. +#define deactivate_mm(tsk,mm) do { } while (0)
  6980. +
  6981. +extern inline void activate_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm)
  6982. +{
  6983. +}
  6984. +
  6985. +#endif /* _ASM_UBICOM32_MMU_CONTEXT_H */
  6986. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/mmu.h linux-2.6.28.10/arch/ubicom32/include/asm/mmu.h
  6987. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/mmu.h 1970-01-01 02:00:00.000000000 +0200
  6988. +++ linux-2.6.28.10/arch/ubicom32/include/asm/mmu.h 2009-08-06 10:31:02.000000000 +0300
  6989. @@ -0,0 +1,41 @@
  6990. +/*
  6991. + * arch/ubicom32/include/asm/mmu.h
  6992. + * Definition of mm_context_t struct for Ubicom32 architecture.
  6993. + *
  6994. + * (C) Copyright 2009, Ubicom, Inc.
  6995. + * Copyright (C) 2002, David McCullough <[email protected]>
  6996. + *
  6997. + * This file is part of the Ubicom32 Linux Kernel Port.
  6998. + *
  6999. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  7000. + * it and/or modify it under the terms of the GNU General Public License
  7001. + * as published by the Free Software Foundation, either version 2 of the
  7002. + * License, or (at your option) any later version.
  7003. + *
  7004. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  7005. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  7006. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  7007. + * the GNU General Public License for more details.
  7008. + *
  7009. + * You should have received a copy of the GNU General Public License
  7010. + * along with the Ubicom32 Linux Kernel Port. If not,
  7011. + * see <http://www.gnu.org/licenses/>.
  7012. + *
  7013. + * Ubicom32 implementation derived from (with many thanks):
  7014. + * arch/m68knommu
  7015. + * arch/blackfin
  7016. + * arch/parisc
  7017. + */
  7018. +#ifndef _ASM_UBICOM32_MMU_H
  7019. +#define _ASM_UBICOM32_MMU_H
  7020. +
  7021. +typedef struct {
  7022. + struct vm_list_struct *vmlist;
  7023. + unsigned long end_brk;
  7024. +#ifdef CONFIG_BINFMT_ELF_FDPIC
  7025. + unsigned long exec_fdpic_loadmap;
  7026. + unsigned long interp_fdpic_loadmap;
  7027. +#endif
  7028. +} mm_context_t;
  7029. +
  7030. +#endif /* _ASM_UBICOM32_MMU_H */
  7031. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/module.h linux-2.6.28.10/arch/ubicom32/include/asm/module.h
  7032. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/module.h 1970-01-01 02:00:00.000000000 +0200
  7033. +++ linux-2.6.28.10/arch/ubicom32/include/asm/module.h 2009-08-12 13:08:37.000000000 +0300
  7034. @@ -0,0 +1,44 @@
  7035. +/*
  7036. + * arch/ubicom32/include/asm/module.h
  7037. + * Ubicom32 architecture specific module definitions.
  7038. + *
  7039. + * (C) Copyright 2009, Ubicom, Inc.
  7040. + *
  7041. + * This file is part of the Ubicom32 Linux Kernel Port.
  7042. + *
  7043. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  7044. + * it and/or modify it under the terms of the GNU General Public License
  7045. + * as published by the Free Software Foundation, either version 2 of the
  7046. + * License, or (at your option) any later version.
  7047. + *
  7048. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  7049. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  7050. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  7051. + * the GNU General Public License for more details.
  7052. + *
  7053. + * You should have received a copy of the GNU General Public License
  7054. + * along with the Ubicom32 Linux Kernel Port. If not,
  7055. + * see <http://www.gnu.org/licenses/>.
  7056. + *
  7057. + * Ubicom32 implementation derived from (with many thanks):
  7058. + * arch/m68knommu
  7059. + * arch/blackfin
  7060. + * arch/parisc
  7061. + */
  7062. +#ifndef _ASM_UBICOM32_MODULE_H
  7063. +#define _ASM_UBICOM32_MODULE_H
  7064. +
  7065. +struct mod_arch_specific {
  7066. + void *ocm_inst;
  7067. + int ocm_inst_size;
  7068. +};
  7069. +
  7070. +#define Elf_Shdr Elf32_Shdr
  7071. +#define Elf_Sym Elf32_Sym
  7072. +#define Elf_Ehdr Elf32_Ehdr
  7073. +
  7074. +#define ARCH_PROC_MODULES_EXTRA(m,mod) \
  7075. + seq_printf(m, " OCM(%d bytes @ 0x%p)", \
  7076. + (mod)->arch.ocm_inst_size, (mod)->arch.ocm_inst)
  7077. +
  7078. +#endif /* _ASM_UBICOM32_MODULE_H */
  7079. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/msgbuf.h linux-2.6.28.10/arch/ubicom32/include/asm/msgbuf.h
  7080. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/msgbuf.h 1970-01-01 02:00:00.000000000 +0200
  7081. +++ linux-2.6.28.10/arch/ubicom32/include/asm/msgbuf.h 2009-08-06 10:31:02.000000000 +0300
  7082. @@ -0,0 +1,58 @@
  7083. +/*
  7084. + * arch/ubicom32/include/asm/msgbuf.h
  7085. + * Definition of msqid64_ds struct for Ubicom32 architecture.
  7086. + *
  7087. + * (C) Copyright 2009, Ubicom, Inc.
  7088. + *
  7089. + * This file is part of the Ubicom32 Linux Kernel Port.
  7090. + *
  7091. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  7092. + * it and/or modify it under the terms of the GNU General Public License
  7093. + * as published by the Free Software Foundation, either version 2 of the
  7094. + * License, or (at your option) any later version.
  7095. + *
  7096. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  7097. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  7098. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  7099. + * the GNU General Public License for more details.
  7100. + *
  7101. + * You should have received a copy of the GNU General Public License
  7102. + * along with the Ubicom32 Linux Kernel Port. If not,
  7103. + * see <http://www.gnu.org/licenses/>.
  7104. + *
  7105. + * Ubicom32 implementation derived from (with many thanks):
  7106. + * arch/m68knommu
  7107. + * arch/blackfin
  7108. + * arch/parisc
  7109. + */
  7110. +#ifndef _ASM_UBICOM32_MSGBUF_H
  7111. +#define _ASM_UBICOM32_MSGBUF_H
  7112. +
  7113. +/*
  7114. + * The msqid64_ds structure for ubicom32 architecture.
  7115. + * Note extra padding because this structure is passed back and forth
  7116. + * between kernel and user space.
  7117. + *
  7118. + * Pad space is left for:
  7119. + * - 64-bit time_t to solve y2038 problem
  7120. + * - 2 miscellaneous 32-bit values
  7121. + */
  7122. +
  7123. +struct msqid64_ds {
  7124. + struct ipc64_perm msg_perm;
  7125. + __kernel_time_t msg_stime; /* last msgsnd time */
  7126. + unsigned long __unused1;
  7127. + __kernel_time_t msg_rtime; /* last msgrcv time */
  7128. + unsigned long __unused2;
  7129. + __kernel_time_t msg_ctime; /* last change time */
  7130. + unsigned long __unused3;
  7131. + unsigned long msg_cbytes; /* current number of bytes on queue */
  7132. + unsigned long msg_qnum; /* number of messages in queue */
  7133. + unsigned long msg_qbytes; /* max number of bytes on queue */
  7134. + __kernel_pid_t msg_lspid; /* pid of last msgsnd */
  7135. + __kernel_pid_t msg_lrpid; /* last receive pid */
  7136. + unsigned long __unused4;
  7137. + unsigned long __unused5;
  7138. +};
  7139. +
  7140. +#endif /* _ASM_UBICOM32_MSGBUF_H */
  7141. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/mutex.h linux-2.6.28.10/arch/ubicom32/include/asm/mutex.h
  7142. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/mutex.h 1970-01-01 02:00:00.000000000 +0200
  7143. +++ linux-2.6.28.10/arch/ubicom32/include/asm/mutex.h 2009-08-06 10:31:02.000000000 +0300
  7144. @@ -0,0 +1,41 @@
  7145. +/*
  7146. + * arch/ubicom32/include/asm/mutex.h
  7147. + * Generic mutex.h for Ubicom32 architecture.
  7148. + *
  7149. + * (C) Copyright 2009, Ubicom, Inc.
  7150. + *
  7151. + * This file is part of the Ubicom32 Linux Kernel Port.
  7152. + *
  7153. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  7154. + * it and/or modify it under the terms of the GNU General Public License
  7155. + * as published by the Free Software Foundation, either version 2 of the
  7156. + * License, or (at your option) any later version.
  7157. + *
  7158. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  7159. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  7160. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  7161. + * the GNU General Public License for more details.
  7162. + *
  7163. + * You should have received a copy of the GNU General Public License
  7164. + * along with the Ubicom32 Linux Kernel Port. If not,
  7165. + * see <http://www.gnu.org/licenses/>.
  7166. + *
  7167. + * Ubicom32 implementation derived from (with many thanks):
  7168. + * arch/m68knommu
  7169. + * arch/blackfin
  7170. + * arch/parisc
  7171. + */
  7172. +/*
  7173. + * Pull in the generic implementation for the mutex fastpath.
  7174. + *
  7175. + * TODO: implement optimized primitives instead, or leave the generic
  7176. + * implementation in place, or pick the atomic_xchg() based generic
  7177. + * implementation. (see asm-generic/mutex-xchg.h for details)
  7178. + */
  7179. +
  7180. +#ifndef _ASM_UBICOM32_MUTEX_H
  7181. +#define _ASM_UBICOM32_MUTEX_H
  7182. +
  7183. +#include <asm-generic/mutex-dec.h>
  7184. +
  7185. +#endif /* _ASM_UBICOM32_MUTEX_H */
  7186. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/namei.h linux-2.6.28.10/arch/ubicom32/include/asm/namei.h
  7187. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/namei.h 1970-01-01 02:00:00.000000000 +0200
  7188. +++ linux-2.6.28.10/arch/ubicom32/include/asm/namei.h 2009-08-06 10:31:02.000000000 +0300
  7189. @@ -0,0 +1,38 @@
  7190. +/*
  7191. + * arch/ubicom32/include/asm/namei.h
  7192. + * Definition of __emul_prefix() for Ubicom32 architecture.
  7193. + *
  7194. + * (C) Copyright 2009, Ubicom, Inc.
  7195. + *
  7196. + * This file is part of the Ubicom32 Linux Kernel Port.
  7197. + *
  7198. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  7199. + * it and/or modify it under the terms of the GNU General Public License
  7200. + * as published by the Free Software Foundation, either version 2 of the
  7201. + * License, or (at your option) any later version.
  7202. + *
  7203. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  7204. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  7205. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  7206. + * the GNU General Public License for more details.
  7207. + *
  7208. + * You should have received a copy of the GNU General Public License
  7209. + * along with the Ubicom32 Linux Kernel Port. If not,
  7210. + * see <http://www.gnu.org/licenses/>.
  7211. + *
  7212. + * Ubicom32 implementation derived from (with many thanks):
  7213. + * arch/m68knommu
  7214. + * arch/blackfin
  7215. + * arch/parisc
  7216. + */
  7217. +#ifndef _ASM_UBICOM32_NAMEI_H
  7218. +#define _ASM_UBICOM32_NAMEI_H
  7219. +
  7220. +/* This dummy routine maybe changed to something useful
  7221. + * for /usr/gnemul/ emulation stuff.
  7222. + * Look at asm-sparc/namei.h for details.
  7223. + */
  7224. +
  7225. +#define __emul_prefix() NULL
  7226. +
  7227. +#endif /* _ASM_UBICOM32_NAMEI_H */
  7228. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/ocm-alloc.h linux-2.6.28.10/arch/ubicom32/include/asm/ocm-alloc.h
  7229. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/ocm-alloc.h 1970-01-01 02:00:00.000000000 +0200
  7230. +++ linux-2.6.28.10/arch/ubicom32/include/asm/ocm-alloc.h 2009-08-12 13:08:37.000000000 +0300
  7231. @@ -0,0 +1,36 @@
  7232. +/*
  7233. + * arch/ubicom32/include/asm/ocm-alloc.h
  7234. + * Ubicom32 architecture specific ocm definitions.
  7235. + *
  7236. + * (C) Copyright 2009, Ubicom, Inc.
  7237. + *
  7238. + * This file is part of the Ubicom32 Linux Kernel Port.
  7239. + *
  7240. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  7241. + * it and/or modify it under the terms of the GNU General Public License
  7242. + * as published by the Free Software Foundation, either version 2 of the
  7243. + * License, or (at your option) any later version.
  7244. + *
  7245. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  7246. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  7247. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  7248. + * the GNU General Public License for more details.
  7249. + *
  7250. + * You should have received a copy of the GNU General Public License
  7251. + * along with the Ubicom32 Linux Kernel Port. If not,
  7252. + * see <http://www.gnu.org/licenses/>.
  7253. + *
  7254. + * Ubicom32 implementation derived from (with many thanks):
  7255. + * arch/m68knommu
  7256. + * arch/blackfin
  7257. + * arch/parisc
  7258. + */
  7259. +#ifndef _ASM_UBICOM32_OCM_ALLOC_H
  7260. +#define _ASM_UBICOM32_OCM_ALLOC_H
  7261. +
  7262. +
  7263. +extern void *ocm_inst_alloc(size_t size, pid_t pid);
  7264. +extern int ocm_free(const void *ptr);
  7265. +extern int ocm_inst_free(const void *ptr);
  7266. +
  7267. +#endif /* _ASM_UBICOM32_OCM_ALLOC_H */
  7268. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/ocm_size.h linux-2.6.28.10/arch/ubicom32/include/asm/ocm_size.h
  7269. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/ocm_size.h 1970-01-01 02:00:00.000000000 +0200
  7270. +++ linux-2.6.28.10/arch/ubicom32/include/asm/ocm_size.h 2009-08-06 11:15:34.000000000 +0300
  7271. @@ -0,0 +1,2 @@
  7272. +#define APP_OCM_CODE_SIZE (0x3ffc2e00-0x3ffc0000)
  7273. +#define APP_OCM_DATA_SIZE (0x3ffd3500-0x3ffc8000)
  7274. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/ocm_text.lds.inc linux-2.6.28.10/arch/ubicom32/include/asm/ocm_text.lds.inc
  7275. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/ocm_text.lds.inc 1970-01-01 02:00:00.000000000 +0200
  7276. +++ linux-2.6.28.10/arch/ubicom32/include/asm/ocm_text.lds.inc 2009-08-06 10:31:02.000000000 +0300
  7277. @@ -0,0 +1,175 @@
  7278. +/*
  7279. + * arch/ubicom32/include/asm/ocm_text.lds.inc
  7280. + * <TODO: Replace with short file description>
  7281. + *
  7282. + * (C) Copyright 2009, Ubicom, Inc.
  7283. + *
  7284. + * This file is part of the Ubicom32 Linux Kernel Port.
  7285. + *
  7286. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  7287. + * it and/or modify it under the terms of the GNU General Public License
  7288. + * as published by the Free Software Foundation, either version 2 of the
  7289. + * License, or (at your option) any later version.
  7290. + *
  7291. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  7292. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  7293. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  7294. + * the GNU General Public License for more details.
  7295. + *
  7296. + * You should have received a copy of the GNU General Public License
  7297. + * along with the Ubicom32 Linux Kernel Port. If not,
  7298. + * see <http://www.gnu.org/licenses/>.
  7299. + *
  7300. + * Ubicom32 implementation derived from (with many thanks):
  7301. + * arch/m68knommu
  7302. + * arch/blackfin
  7303. + * arch/parisc
  7304. + */
  7305. +*(.text.do_csum)
  7306. +*(.text.tcp_packet)
  7307. +*(.text.ipt_do_table)
  7308. +*(.text.nf_conntrack_in)
  7309. +*(.text.ip_forward)
  7310. +*(.text.dev_queue_xmit)
  7311. +*(.text.netif_receive_skb)
  7312. +*(.text.ip_route_input)
  7313. +*(.text.ip_finish_output)
  7314. +*(.text.nf_iterate)
  7315. +*(.text.__hash_conntrack)
  7316. +*(.text.memset)
  7317. +*(.text.memcpy)
  7318. +*(.text.ip_rcv)
  7319. +*(.text.__nf_conntrack_find)
  7320. +*(.text.dev_hard_start_xmit)
  7321. +*(.text.vlan_dev_hard_start_xmit)
  7322. +*(.text.vlan_dev_hard_header)
  7323. +*(.text.__nf_ct_refresh_acct)
  7324. +*(.text.tcp_error)
  7325. +*(.text.pfifo_fast_enqueue)
  7326. +*(.text.ipv4_confirm)
  7327. +*(.text.ip_output)
  7328. +*(.text.neigh_connected_output)
  7329. +*(.text.nf_hook_slow)
  7330. +*(.text.nf_nat_packet)
  7331. +*(.text.local_bh_enable)
  7332. +*(.text.pfifo_fast_dequeue)
  7333. +*(.text.ubi32_eth_receive)
  7334. +*(.text.nf_nat_fn)
  7335. +*(.text.skb_checksum)
  7336. +*(.text.memmove)
  7337. +*(.text.ubi32_eth_tx_done)
  7338. +*(.text.eth_header)
  7339. +*(.text.skb_release_data)
  7340. +*(.text.nf_conntrack_find_get)
  7341. +*(.text.process_backlog)
  7342. +*(.text.vlan_skb_recv)
  7343. +*(.text.ip_rcv_finish)
  7344. +*(.text.__qdisc_run)
  7345. +*(.text.skb_push)
  7346. +*(.text.eth_type_trans)
  7347. +*(.text.__alloc_skb)
  7348. +*(.text.netif_rx)
  7349. +*(.text.nf_ip_checksum)
  7350. +*(.text.__skb_checksum_complete_head)
  7351. +*(.text.ipv4_conntrack_defrag)
  7352. +*(.text.tcp_pkt_to_tuple)
  7353. +*(.text.kfree)
  7354. +*(.text.tcp_manip_pkt)
  7355. +*(.text.skb_put)
  7356. +*(.text.nf_ct_get_tuple)
  7357. +*(.text.__kmalloc)
  7358. +*(.text.ubi32_eth_start_xmit)
  7359. +*(.text.free_block)
  7360. +*(.text.ipt_hook)
  7361. +*(.text.kmem_cache_free)
  7362. +*(.text.skb_pull_rcsum)
  7363. +*(.text.cache_alloc_refill)
  7364. +*(.text.skb_release_head_state)
  7365. +*(.text.manip_pkt)
  7366. +*(.text.ip_sabotage_in)
  7367. +*(.text.ip_forward_finish)
  7368. +*(.text.kmem_cache_alloc)
  7369. +*(.text.local_bh_disable)
  7370. +*(.text.ipv4_pkt_to_tuple)
  7371. +*(.text.inet_proto_csum_replace4)
  7372. +*(.text.__nf_ct_l4proto_find)
  7373. +*(.text.csum_partial)
  7374. +*(.text.neigh_resolve_output)
  7375. +*(.text.__kfree_skb)
  7376. +*(.text.kfree_skb)
  7377. +*(.text.__find_vlan_dev)
  7378. +*(.text.ldsr_ctxsw_thread)
  7379. +*(.text.__do_IRQ)
  7380. +*(.text.skb_pull)
  7381. +*(.text.ipv4_invert_tuple)
  7382. +*(.text.nf_ct_invert_tuplepr)
  7383. +*(.text.skb_make_writable)
  7384. +*(.text.ipv4_get_l4proto)
  7385. +*(.text.handle_IRQ_event)
  7386. +*(.text.net_rx_action)
  7387. +*(.text.__do_softirq)
  7388. +*(.text.nf_nat_in)
  7389. +*(.text.note_interrupt)
  7390. +*(.text.ipv4_conntrack_in)
  7391. +*(.text.dst_release)
  7392. +*(.text.tasklet_action)
  7393. +*(.text.nf_nat_out)
  7394. +*(.text.nf_ct_invert_tuple)
  7395. +*(.text.do_IRQ)
  7396. +*(.text.__tasklet_schedule)
  7397. +*(.text.__skb_checksum_complete)
  7398. +*(.text.ubi32_eth_interrupt)
  7399. +*(.text.dev_kfree_skb_any)
  7400. +*(.text.ret_from_interrupt_to_kernel)
  7401. +*(.text.preemptive_context_save)
  7402. +*(.text.irq_ack_vector)
  7403. +*(.text.update_wall_time)
  7404. +*(.text.ldsr_thread)
  7405. +*(.text.irq_exit)
  7406. +*(.text.ubi32_eth_do_tasklet)
  7407. +*(.text.__napi_schedule)
  7408. +*(.text.idle_cpu)
  7409. +*(.text.run_timer_softirq)
  7410. +*(.text.ldsr_mask_vector)
  7411. +*(.text.irq_enter)
  7412. +*(.text.ldsr_get_lsb)
  7413. +*(.text.ldsr_unmask_vector)
  7414. +*(.text.ip_fast_csum)
  7415. +*(.text.hrtimer_run_queues)
  7416. +*(.text.tcp_invert_tuple)
  7417. +*(.text.T___705)
  7418. +*(.text.run_posix_cpu_timers)
  7419. +*(.text.free_hot_cold_page)
  7420. +*(.text.lock_timer_base)
  7421. +*(.text.calc_delta_mine)
  7422. +*(.text.slab_destroy)
  7423. +*(.text.rcu_pending)
  7424. +*(.text.scheduler_tick)
  7425. +*(.text.hrtimer_run_pending)
  7426. +*(.text.do_softirq)
  7427. +*(.text.del_timer)
  7428. +*(.text.irq_end_vector)
  7429. +*(.text.pci_read_u32)
  7430. +*(.text.udivmodsi4)
  7431. +*(.text.memcmp)
  7432. +*(.text.memset)
  7433. +*(.text.__slab_alloc)
  7434. +*(.text.br_handle_frame)
  7435. +*(.text.br_fdb_update)
  7436. +*(.text.__br_fdb_get)
  7437. +*(.text.br_forward)
  7438. +*(.text.br_handle_frame_finish)
  7439. +*(.text.pci_write_u32)
  7440. +*(.text.kmem_freepages)
  7441. +*(.text.br_dev_queue_push_xmit)
  7442. +*(.text.ioread32)
  7443. +*(.text.next_zones_zonelist)
  7444. +*(.text.ubi32_pci_read_u32)
  7445. +*(.text.zone_watermark_ok)
  7446. +*(.text.__rmqueue_smallest)
  7447. +*(.text.ubi32_eth_napi_poll)
  7448. +*(.text.ubi32_pci_write_u32)
  7449. +*(.text.ubi32_pci_read_u32)
  7450. +*(.text._local_bh_enable)
  7451. +*(.text._local_bh_disable)
  7452. +*(.text.get_slab)
  7453. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/page.h linux-2.6.28.10/arch/ubicom32/include/asm/page.h
  7454. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/page.h 1970-01-01 02:00:00.000000000 +0200
  7455. +++ linux-2.6.28.10/arch/ubicom32/include/asm/page.h 2009-08-06 10:31:02.000000000 +0300
  7456. @@ -0,0 +1,106 @@
  7457. +/*
  7458. + * arch/ubicom32/include/asm/page.h
  7459. + * Memory page related operations and definitions.
  7460. + *
  7461. + * (C) Copyright 2009, Ubicom, Inc.
  7462. + *
  7463. + * This file is part of the Ubicom32 Linux Kernel Port.
  7464. + *
  7465. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  7466. + * it and/or modify it under the terms of the GNU General Public License
  7467. + * as published by the Free Software Foundation, either version 2 of the
  7468. + * License, or (at your option) any later version.
  7469. + *
  7470. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  7471. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  7472. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  7473. + * the GNU General Public License for more details.
  7474. + *
  7475. + * You should have received a copy of the GNU General Public License
  7476. + * along with the Ubicom32 Linux Kernel Port. If not,
  7477. + * see <http://www.gnu.org/licenses/>.
  7478. + *
  7479. + * Ubicom32 implementation derived from (with many thanks):
  7480. + * arch/m68knommu
  7481. + * arch/blackfin
  7482. + * arch/parisc
  7483. + */
  7484. +#ifndef _ASM_UBICOM32_PAGE_H
  7485. +#define _ASM_UBICOM32_PAGE_H
  7486. +
  7487. +/* PAGE_SHIFT determines the page size */
  7488. +
  7489. +#define PAGE_SHIFT 12
  7490. +#define PAGE_SIZE (1 << PAGE_SHIFT)
  7491. +#define PAGE_MASK (~(PAGE_SIZE-1))
  7492. +
  7493. +#include <asm/setup.h>
  7494. +
  7495. +#ifndef __ASSEMBLY__
  7496. +
  7497. +#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
  7498. +#define free_user_page(page, addr) free_page(addr)
  7499. +
  7500. +#define clear_page(page) memset((page), 0, PAGE_SIZE)
  7501. +#define copy_page(to,from) memcpy((to), (from), PAGE_SIZE)
  7502. +
  7503. +#define clear_user_page(page, vaddr, pg) clear_page(page)
  7504. +#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
  7505. +
  7506. +#define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \
  7507. + alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr)
  7508. +#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
  7509. +
  7510. +/*
  7511. + * These are used to make use of C type-checking..
  7512. + */
  7513. +typedef struct { unsigned long pte; } pte_t;
  7514. +typedef struct { unsigned long pmd[16]; } pmd_t;
  7515. +typedef struct { unsigned long pgd; } pgd_t;
  7516. +typedef struct { unsigned long pgprot; } pgprot_t;
  7517. +typedef struct page *pgtable_t;
  7518. +
  7519. +#define pte_val(x) ((x).pte)
  7520. +#define pmd_val(x) ((&x)->pmd[0])
  7521. +#define pgd_val(x) ((x).pgd)
  7522. +#define pgprot_val(x) ((x).pgprot)
  7523. +
  7524. +#define __pte(x) ((pte_t) { (x) } )
  7525. +#define __pmd(x) ((pmd_t) { (x) } )
  7526. +#define __pgd(x) ((pgd_t) { (x) } )
  7527. +#define __pgprot(x) ((pgprot_t) { (x) } )
  7528. +
  7529. +extern unsigned long memory_start;
  7530. +extern unsigned long memory_end;
  7531. +
  7532. +#endif /* !__ASSEMBLY__ */
  7533. +
  7534. +#include <asm/page_offset.h>
  7535. +
  7536. +#define PAGE_OFFSET (PAGE_OFFSET_RAW)
  7537. +
  7538. +#ifndef __ASSEMBLY__
  7539. +
  7540. +#define __pa(vaddr) virt_to_phys((void *)(vaddr))
  7541. +#define __va(paddr) phys_to_virt((unsigned long)(paddr))
  7542. +
  7543. +#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
  7544. +#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
  7545. +
  7546. +#define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT))
  7547. +#define page_to_virt(page) ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET)
  7548. +
  7549. +#define pfn_to_page(pfn) virt_to_page(pfn_to_virt(pfn))
  7550. +#define page_to_pfn(page) virt_to_pfn(page_to_virt(page))
  7551. +#define pfn_valid(pfn) ((pfn) < max_mapnr)
  7552. +
  7553. +#define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
  7554. + ((void *)(kaddr) < (void *)memory_end))
  7555. +
  7556. +#endif /* __ASSEMBLY__ */
  7557. +
  7558. +#ifdef __KERNEL__
  7559. +#include <asm-generic/page.h>
  7560. +#endif
  7561. +
  7562. +#endif /* _ASM_UBICOM32_PAGE_H */
  7563. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/page_offset.h linux-2.6.28.10/arch/ubicom32/include/asm/page_offset.h
  7564. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/page_offset.h 1970-01-01 02:00:00.000000000 +0200
  7565. +++ linux-2.6.28.10/arch/ubicom32/include/asm/page_offset.h 2009-08-06 10:31:02.000000000 +0300
  7566. @@ -0,0 +1,35 @@
  7567. +/*
  7568. + * arch/ubicom32/include/asm/page_offset.h
  7569. + * Definition of PAGE_OFFSET_RAW for Ubicom32 architecture.
  7570. + *
  7571. + * (C) Copyright 2009, Ubicom, Inc.
  7572. + *
  7573. + * This file is part of the Ubicom32 Linux Kernel Port.
  7574. + *
  7575. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  7576. + * it and/or modify it under the terms of the GNU General Public License
  7577. + * as published by the Free Software Foundation, either version 2 of the
  7578. + * License, or (at your option) any later version.
  7579. + *
  7580. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  7581. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  7582. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  7583. + * the GNU General Public License for more details.
  7584. + *
  7585. + * You should have received a copy of the GNU General Public License
  7586. + * along with the Ubicom32 Linux Kernel Port. If not,
  7587. + * see <http://www.gnu.org/licenses/>.
  7588. + *
  7589. + * Ubicom32 implementation derived from (with many thanks):
  7590. + * arch/m68knommu
  7591. + * arch/blackfin
  7592. + * arch/parisc
  7593. + */
  7594. +
  7595. +#ifndef _ASM_UBICOM32_PAGE_OFFSET_H
  7596. +#define _ASM_UBICOM32_PAGE_OFFSET_H
  7597. +
  7598. +/* This handles the memory map.. */
  7599. +#define PAGE_OFFSET_RAW 0x3ffc0000
  7600. +
  7601. +#endif /* _ASM_UBICOM32_PAGE_OFFSET_H */
  7602. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/param.h linux-2.6.28.10/arch/ubicom32/include/asm/param.h
  7603. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/param.h 1970-01-01 02:00:00.000000000 +0200
  7604. +++ linux-2.6.28.10/arch/ubicom32/include/asm/param.h 2009-08-06 10:31:02.000000000 +0300
  7605. @@ -0,0 +1,49 @@
  7606. +/*
  7607. + * arch/ubicom32/include/asm/param.h
  7608. + * Definition of miscellaneous constants, including HZ.
  7609. + *
  7610. + * (C) Copyright 2009, Ubicom, Inc.
  7611. + *
  7612. + * This file is part of the Ubicom32 Linux Kernel Port.
  7613. + *
  7614. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  7615. + * it and/or modify it under the terms of the GNU General Public License
  7616. + * as published by the Free Software Foundation, either version 2 of the
  7617. + * License, or (at your option) any later version.
  7618. + *
  7619. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  7620. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  7621. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  7622. + * the GNU General Public License for more details.
  7623. + *
  7624. + * You should have received a copy of the GNU General Public License
  7625. + * along with the Ubicom32 Linux Kernel Port. If not,
  7626. + * see <http://www.gnu.org/licenses/>.
  7627. + *
  7628. + * Ubicom32 implementation derived from (with many thanks):
  7629. + * arch/m68knommu
  7630. + * arch/blackfin
  7631. + * arch/parisc
  7632. + */
  7633. +#ifndef _ASM_UBICOM32_PARAM_H
  7634. +#define _ASM_UBICOM32_PARAM_H
  7635. +
  7636. +#ifdef __KERNEL__
  7637. +#define HZ CONFIG_HZ
  7638. +#define USER_HZ HZ
  7639. +#define CLOCKS_PER_SEC (USER_HZ)
  7640. +#endif
  7641. +
  7642. +#ifndef HZ
  7643. +#define HZ 100
  7644. +#endif
  7645. +
  7646. +#define EXEC_PAGESIZE 4096
  7647. +
  7648. +#ifndef NOGROUP
  7649. +#define NOGROUP (-1)
  7650. +#endif
  7651. +
  7652. +#define MAXHOSTNAMELEN 64 /* max length of hostname */
  7653. +
  7654. +#endif /* _ASM_UBICOM32_PARAM_H */
  7655. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/pci.h linux-2.6.28.10/arch/ubicom32/include/asm/pci.h
  7656. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/pci.h 1970-01-01 02:00:00.000000000 +0200
  7657. +++ linux-2.6.28.10/arch/ubicom32/include/asm/pci.h 2009-08-06 10:31:02.000000000 +0300
  7658. @@ -0,0 +1,210 @@
  7659. +/*
  7660. + * arch/ubicom32/include/asm/pci.h
  7661. + * Definitions of PCI operations for Ubicom32 architecture.
  7662. + *
  7663. + * (C) Copyright 2009, Ubicom, Inc.
  7664. + *
  7665. + * This file is part of the Ubicom32 Linux Kernel Port.
  7666. + *
  7667. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  7668. + * it and/or modify it under the terms of the GNU General Public License
  7669. + * as published by the Free Software Foundation, either version 2 of the
  7670. + * License, or (at your option) any later version.
  7671. + *
  7672. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  7673. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  7674. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  7675. + * the GNU General Public License for more details.
  7676. + *
  7677. + * You should have received a copy of the GNU General Public License
  7678. + * along with the Ubicom32 Linux Kernel Port. If not,
  7679. + * see <http://www.gnu.org/licenses/>.
  7680. + *
  7681. + * Ubicom32 implementation derived from (with many thanks):
  7682. + * arch/m68knommu
  7683. + * arch/blackfin
  7684. + * arch/parisc
  7685. + */
  7686. +#ifndef _ASM_UBICOM32_PCI_H
  7687. +#define _ASM_UBICOM32_PCI_H
  7688. +
  7689. +#include <asm/io.h>
  7690. +
  7691. +/* The PCI address space does equal the physical memory
  7692. + * address space. The networking and block device layers use
  7693. + * this boolean for bounce buffer decisions.
  7694. + */
  7695. +#define PCI_DMA_BUS_IS_PHYS (1)
  7696. +
  7697. +
  7698. +
  7699. +/*
  7700. + * Perform a master read/write to the PCI bus.
  7701. + * These functions return a PCI_RESP_xxx code.
  7702. + */
  7703. +extern u8 pci_read_u32(u8 pci_cmd, u32 address, u32 *data);
  7704. +extern u8 pci_write_u32(u8 pci_cmd, u32 address, u32 data);
  7705. +extern u8 pci_read_u16(u8 pci_cmd, u32 address, u16 *data);
  7706. +extern u8 pci_write_u16(u8 pci_cmd, u32 address, u16 data);
  7707. +extern u8 pci_read_u8(u8 pci_cmd, u32 address, u8 *data);
  7708. +extern u8 pci_write_u8(u8 pci_cmd, u32 address, u8 data);
  7709. +
  7710. +
  7711. +#define PCIBIOS_MIN_IO 0x100
  7712. +#define PCIBIOS_MIN_MEM 0x10000000
  7713. +
  7714. +#define pcibios_assign_all_busses() 0
  7715. +#define pcibios_scan_all_fns(a, b) 0
  7716. +extern void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
  7717. + struct resource *res);
  7718. +
  7719. +extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
  7720. + struct pci_bus_region *region);
  7721. +
  7722. +struct pci_sys_data;
  7723. +struct pci_bus;
  7724. +
  7725. +struct hw_pci {
  7726. + struct list_head buses;
  7727. + int nr_controllers;
  7728. + int (*setup)(int nr, struct pci_sys_data *);
  7729. + struct pci_bus *(*scan)(int nr, struct pci_sys_data *);
  7730. + void (*preinit)(void);
  7731. + void (*postinit)(void);
  7732. + u8 (*swizzle)(struct pci_dev *dev, u8 *pin);
  7733. + int (*map_irq)(struct pci_dev *dev, u8 slot, u8 pin);
  7734. +};
  7735. +
  7736. +/*
  7737. + * Per-controller structure
  7738. + */
  7739. +struct pci_sys_data {
  7740. + struct list_head node;
  7741. + int busnr; /* primary bus number */
  7742. + u64 mem_offset; /* bus->cpu memory mapping offset */
  7743. + unsigned long io_offset; /* bus->cpu IO mapping offset */
  7744. + struct pci_bus *bus; /* PCI bus */
  7745. + struct resource *resource[3]; /* Primary PCI bus resources */
  7746. + /* Bridge swizzling */
  7747. + u8 (*swizzle)(struct pci_dev *, u8 *);
  7748. + /* IRQ mapping */
  7749. + int (*map_irq)(struct pci_dev *, u8, u8);
  7750. + struct hw_pci *hw;
  7751. +};
  7752. +
  7753. +static inline struct resource *
  7754. +pcibios_select_root(struct pci_dev *pdev, struct resource *res)
  7755. +{
  7756. + struct resource *root = NULL;
  7757. +
  7758. + if (res->flags & IORESOURCE_IO)
  7759. + root = &ioport_resource;
  7760. + if (res->flags & IORESOURCE_MEM)
  7761. + root = &iomem_resource;
  7762. +
  7763. + return root;
  7764. +}
  7765. +
  7766. +static inline void pcibios_set_master(struct pci_dev *dev)
  7767. +{
  7768. + /* No special bus mastering setup handling */
  7769. +}
  7770. +#define HAVE_ARCH_PCI_SET_DMA_MAX_SEGMENT_SIZE 1
  7771. +#define HAVE_ARCH_PCI_SET_DMA_SEGMENT_BOUNDARY 1
  7772. +
  7773. +#ifdef CONFIG_PCI
  7774. +static inline void * pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
  7775. + dma_addr_t *dma_handle)
  7776. +{
  7777. + void *vaddr = kmalloc(size, GFP_KERNEL);
  7778. + if(vaddr != NULL) {
  7779. + *dma_handle = virt_to_phys(vaddr);
  7780. + }
  7781. + return vaddr;
  7782. +}
  7783. +
  7784. +static inline int pci_dma_supported(struct pci_dev *hwdev, dma_addr_t mask)
  7785. +{
  7786. + return 1;
  7787. +}
  7788. +
  7789. +static inline void pci_free_consistent(struct pci_dev *hwdev, size_t size,
  7790. + void *cpu_addr, dma_addr_t dma_handle)
  7791. +{
  7792. + kfree(cpu_addr);
  7793. + return;
  7794. +}
  7795. +
  7796. +static inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr,
  7797. + size_t size, int direction)
  7798. +{
  7799. + return virt_to_phys(ptr);
  7800. +}
  7801. +
  7802. +static inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
  7803. + size_t size, int direction)
  7804. +{
  7805. + return;
  7806. +}
  7807. +
  7808. +static inline dma_addr_t
  7809. +pci_map_page(struct pci_dev *hwdev, struct page *page,
  7810. + unsigned long offset, size_t size, int direction)
  7811. +{
  7812. + return pci_map_single(hwdev, page_address(page) + offset, size, (int)direction);
  7813. +}
  7814. +
  7815. +static inline void
  7816. +pci_unmap_page(struct pci_dev *hwdev, dma_addr_t dma_address,
  7817. + size_t size, int direction)
  7818. +{
  7819. + pci_unmap_single(hwdev, dma_address, size, direction);
  7820. +}
  7821. +
  7822. +static inline int
  7823. +pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg,
  7824. + int nents, int direction)
  7825. +{
  7826. + return nents;
  7827. +}
  7828. +
  7829. +static inline void
  7830. +pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg,
  7831. + int nents, int direction)
  7832. +{
  7833. +}
  7834. +
  7835. +static inline void
  7836. +pci_dma_sync_sg_for_cpu(struct pci_dev *hwdev, struct scatterlist *sg,
  7837. + int nelems, int direction)
  7838. +{
  7839. +}
  7840. +
  7841. +static inline void
  7842. +pci_dma_sync_sg_for_device(struct pci_dev *hwdev, struct scatterlist *sg,
  7843. + int nelems, int direction)
  7844. +{
  7845. +}
  7846. +
  7847. +static inline void
  7848. +pci_dma_sync_single_for_cpu(struct pci_dev *hwdev, dma_addr_t dma_handle,
  7849. + size_t size, int direction)
  7850. +{
  7851. +}
  7852. +
  7853. +static inline void
  7854. +pci_dma_sync_single_for_device(struct pci_dev *hwdev, dma_addr_t dma_handle,
  7855. + size_t size, int direction)
  7856. +{
  7857. +}
  7858. +
  7859. +static inline int
  7860. +pci_dma_mapping_error(struct pci_dev *hwdev, dma_addr_t dma_addr)
  7861. +{
  7862. + return dma_addr == 0;
  7863. +}
  7864. +extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
  7865. +extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
  7866. +#endif
  7867. +
  7868. +#endif /* _ASM_UBICOM32_PCI_H */
  7869. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/percpu.h linux-2.6.28.10/arch/ubicom32/include/asm/percpu.h
  7870. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/percpu.h 1970-01-01 02:00:00.000000000 +0200
  7871. +++ linux-2.6.28.10/arch/ubicom32/include/asm/percpu.h 2009-08-06 10:31:02.000000000 +0300
  7872. @@ -0,0 +1,33 @@
  7873. +/*
  7874. + * arch/ubicom32/include/asm/percpu.h
  7875. + * Generic percpu.h for the Ubicom32 architecture.
  7876. + *
  7877. + * (C) Copyright 2009, Ubicom, Inc.
  7878. + *
  7879. + * This file is part of the Ubicom32 Linux Kernel Port.
  7880. + *
  7881. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  7882. + * it and/or modify it under the terms of the GNU General Public License
  7883. + * as published by the Free Software Foundation, either version 2 of the
  7884. + * License, or (at your option) any later version.
  7885. + *
  7886. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  7887. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  7888. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  7889. + * the GNU General Public License for more details.
  7890. + *
  7891. + * You should have received a copy of the GNU General Public License
  7892. + * along with the Ubicom32 Linux Kernel Port. If not,
  7893. + * see <http://www.gnu.org/licenses/>.
  7894. + *
  7895. + * Ubicom32 implementation derived from (with many thanks):
  7896. + * arch/m68knommu
  7897. + * arch/blackfin
  7898. + * arch/parisc
  7899. + */
  7900. +#ifndef _ASM_UBICOM32_PERCPU_H
  7901. +#define _ASM_UBICOM32_PERCPU_H
  7902. +
  7903. +#include <asm-generic/percpu.h>
  7904. +
  7905. +#endif /* _ASM_UBICOM32_PERCPU_H */
  7906. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/pgalloc.h linux-2.6.28.10/arch/ubicom32/include/asm/pgalloc.h
  7907. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/pgalloc.h 1970-01-01 02:00:00.000000000 +0200
  7908. +++ linux-2.6.28.10/arch/ubicom32/include/asm/pgalloc.h 2009-08-06 10:31:02.000000000 +0300
  7909. @@ -0,0 +1,36 @@
  7910. +/*
  7911. + * arch/ubicom32/include/asm/pgalloc.h
  7912. + * Page table allocation definitions.
  7913. + *
  7914. + * (C) Copyright 2009, Ubicom, Inc.
  7915. + *
  7916. + * This file is part of the Ubicom32 Linux Kernel Port.
  7917. + *
  7918. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  7919. + * it and/or modify it under the terms of the GNU General Public License
  7920. + * as published by the Free Software Foundation, either version 2 of the
  7921. + * License, or (at your option) any later version.
  7922. + *
  7923. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  7924. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  7925. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  7926. + * the GNU General Public License for more details.
  7927. + *
  7928. + * You should have received a copy of the GNU General Public License
  7929. + * along with the Ubicom32 Linux Kernel Port. If not,
  7930. + * see <http://www.gnu.org/licenses/>.
  7931. + *
  7932. + * Ubicom32 implementation derived from (with many thanks):
  7933. + * arch/m68knommu
  7934. + * arch/blackfin
  7935. + * arch/parisc
  7936. + */
  7937. +#ifndef _ASM_UBICOM32_PGALLOC_H
  7938. +#define _ASM_UBICOM32_PGALLOC_H
  7939. +
  7940. +#include <linux/mm.h>
  7941. +#include <asm/setup.h>
  7942. +
  7943. +#define check_pgt_cache() do { } while (0)
  7944. +
  7945. +#endif /* _ASM_UBICOM32_PGALLOC_H */
  7946. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/pgtable.h linux-2.6.28.10/arch/ubicom32/include/asm/pgtable.h
  7947. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/pgtable.h 1970-01-01 02:00:00.000000000 +0200
  7948. +++ linux-2.6.28.10/arch/ubicom32/include/asm/pgtable.h 2009-08-06 10:31:02.000000000 +0300
  7949. @@ -0,0 +1,124 @@
  7950. +/*
  7951. + * arch/ubicom32/include/asm/pgtable.h
  7952. + * Ubicom32 pseudo page table definitions and operations.
  7953. + *
  7954. + * (C) Copyright 2009, Ubicom, Inc.
  7955. + * Copyright (C) 2004 Microtronix Datacom Ltd
  7956. + *
  7957. + * This file is part of the Ubicom32 Linux Kernel Port.
  7958. + *
  7959. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  7960. + * it and/or modify it under the terms of the GNU General Public License
  7961. + * as published by the Free Software Foundation, either version 2 of the
  7962. + * License, or (at your option) any later version.
  7963. + *
  7964. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  7965. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  7966. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  7967. + * the GNU General Public License for more details.
  7968. + *
  7969. + * You should have received a copy of the GNU General Public License
  7970. + * along with the Ubicom32 Linux Kernel Port. If not,
  7971. + * see <http://www.gnu.org/licenses/>.
  7972. + *
  7973. + * Ubicom32 implementation derived from (with many thanks):
  7974. + * arch/m68knommu
  7975. + * arch/blackfin
  7976. + * arch/parisc
  7977. + * and various works, Alpha, ix86, M68K, Sparc, ...et al
  7978. + */
  7979. +#ifndef _ASM_UBICOM32_PGTABLE_H
  7980. +#define _ASM_UBICOM32_PGTABLE_H
  7981. +
  7982. +#include <asm-generic/4level-fixup.h>
  7983. +
  7984. +//vic - this bit copied from m68knommu version
  7985. +#include <asm/setup.h>
  7986. +#include <asm/io.h>
  7987. +#include <linux/sched.h>
  7988. +
  7989. +typedef pte_t *pte_addr_t;
  7990. +
  7991. +#define pgd_present(pgd) (1) /* pages are always present on NO_MM */
  7992. +#define pgd_none(pgd) (0)
  7993. +#define pgd_bad(pgd) (0)
  7994. +#define pgd_clear(pgdp)
  7995. +#define kern_addr_valid(addr) (1)
  7996. +#define pmd_offset(a, b) ((void *)0)
  7997. +
  7998. +#define PAGE_NONE __pgprot(0) /* these mean nothing to NO_MM */
  7999. +#define PAGE_SHARED __pgprot(0) /* these mean nothing to NO_MM */
  8000. +#define PAGE_COPY __pgprot(0) /* these mean nothing to NO_MM */
  8001. +#define PAGE_READONLY __pgprot(0) /* these mean nothing to NO_MM */
  8002. +#define PAGE_KERNEL __pgprot(0) /* these mean nothing to NO_MM */
  8003. +//vic - this bit copied from m68knommu version
  8004. +
  8005. +extern void paging_init(void);
  8006. +#define swapper_pg_dir ((pgd_t *) 0)
  8007. +
  8008. +#define __swp_type(x) (0)
  8009. +#define __swp_offset(x) (0)
  8010. +#define __swp_entry(typ,off) ((swp_entry_t) { ((typ) | ((off) << 7)) })
  8011. +#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
  8012. +#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
  8013. +
  8014. +/*
  8015. + * pgprot_noncached() is only for infiniband pci support, and a real
  8016. + * implementation for RAM would be more complicated.
  8017. + */
  8018. +#define pgprot_noncached(prot) (prot)
  8019. +
  8020. +static inline int pte_file(pte_t pte) { return 0; }
  8021. +
  8022. +/*
  8023. + * ZERO_PAGE is a global shared page that is always zero: used
  8024. + * for zero-mapped memory areas etc..
  8025. + */
  8026. +#define ZERO_PAGE(vaddr) (virt_to_page(0))
  8027. +
  8028. +extern unsigned int kobjsize(const void *objp);
  8029. +extern int is_in_rom(unsigned long);
  8030. +
  8031. +/*
  8032. + * No page table caches to initialise
  8033. + */
  8034. +#define pgtable_cache_init() do { } while (0)
  8035. +
  8036. +#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
  8037. + remap_pfn_range(vma, vaddr, pfn, size, prot)
  8038. +
  8039. +extern inline void flush_cache_mm(struct mm_struct *mm)
  8040. +{
  8041. +}
  8042. +
  8043. +extern inline void flush_cache_range(struct mm_struct *mm,
  8044. + unsigned long start,
  8045. + unsigned long end)
  8046. +{
  8047. +}
  8048. +
  8049. +/* Push the page at kernel virtual address and clear the icache */
  8050. +extern inline void flush_page_to_ram (unsigned long address)
  8051. +{
  8052. +}
  8053. +
  8054. +/* Push n pages at kernel virtual address and clear the icache */
  8055. +extern inline void flush_pages_to_ram (unsigned long address, int n)
  8056. +{
  8057. +}
  8058. +
  8059. +/*
  8060. + * All 32bit addresses are effectively valid for vmalloc...
  8061. + * Sort of meaningless for non-VM targets.
  8062. + */
  8063. +#define VMALLOC_START 0
  8064. +#define VMALLOC_END 0xffffffff
  8065. +
  8066. +#define arch_enter_lazy_mmu_mode() do {} while (0)
  8067. +#define arch_leave_lazy_mmu_mode() do {} while (0)
  8068. +#define arch_flush_lazy_mmu_mode() do {} while (0)
  8069. +#define arch_enter_lazy_cpu_mode() do {} while (0)
  8070. +#define arch_leave_lazy_cpu_mode() do {} while (0)
  8071. +#define arch_flush_lazy_cpu_mode() do {} while (0)
  8072. +
  8073. +#endif /* _ASM_UBICOM32_PGTABLE_H */
  8074. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/poll.h linux-2.6.28.10/arch/ubicom32/include/asm/poll.h
  8075. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/poll.h 1970-01-01 02:00:00.000000000 +0200
  8076. +++ linux-2.6.28.10/arch/ubicom32/include/asm/poll.h 2009-08-06 10:31:02.000000000 +0300
  8077. @@ -0,0 +1,36 @@
  8078. +/*
  8079. + * arch/ubicom32/include/asm/poll.h
  8080. + * Ubicom32 specific poll() related flags definitions.
  8081. + *
  8082. + * (C) Copyright 2009, Ubicom, Inc.
  8083. + *
  8084. + * This file is part of the Ubicom32 Linux Kernel Port.
  8085. + *
  8086. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  8087. + * it and/or modify it under the terms of the GNU General Public License
  8088. + * as published by the Free Software Foundation, either version 2 of the
  8089. + * License, or (at your option) any later version.
  8090. + *
  8091. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  8092. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  8093. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  8094. + * the GNU General Public License for more details.
  8095. + *
  8096. + * You should have received a copy of the GNU General Public License
  8097. + * along with the Ubicom32 Linux Kernel Port. If not,
  8098. + * see <http://www.gnu.org/licenses/>.
  8099. + *
  8100. + * Ubicom32 implementation derived from (with many thanks):
  8101. + * arch/m68knommu
  8102. + * arch/blackfin
  8103. + * arch/parisc
  8104. + */
  8105. +#ifndef _ASM_UBICOM32_POLL_H
  8106. +#define _ASM_UBICOM32_POLL_H
  8107. +
  8108. +#define POLLWRNORM POLLOUT
  8109. +#define POLLWRBAND 0x0100
  8110. +
  8111. +#include <asm-generic/poll.h>
  8112. +
  8113. +#endif /* _ASM_UBICOM32_POLL_H */
  8114. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/posix_types.h linux-2.6.28.10/arch/ubicom32/include/asm/posix_types.h
  8115. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/posix_types.h 1970-01-01 02:00:00.000000000 +0200
  8116. +++ linux-2.6.28.10/arch/ubicom32/include/asm/posix_types.h 2009-08-06 10:31:02.000000000 +0300
  8117. @@ -0,0 +1,93 @@
  8118. +/*
  8119. + * arch/ubicom32/include/asm/posix_types.h
  8120. + * Ubicom32 architecture posix types.
  8121. + *
  8122. + * (C) Copyright 2009, Ubicom, Inc.
  8123. + * Copyright (C) 2004 Microtronix Datacom Ltd
  8124. + *
  8125. + * This file is part of the Ubicom32 Linux Kernel Port.
  8126. + *
  8127. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  8128. + * it and/or modify it under the terms of the GNU General Public License
  8129. + * as published by the Free Software Foundation, either version 2 of the
  8130. + * License, or (at your option) any later version.
  8131. + *
  8132. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  8133. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  8134. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  8135. + * the GNU General Public License for more details.
  8136. + *
  8137. + * You should have received a copy of the GNU General Public License
  8138. + * along with the Ubicom32 Linux Kernel Port. If not,
  8139. + * see <http://www.gnu.org/licenses/>.
  8140. + *
  8141. + * Ubicom32 implementation derived from (with many thanks):
  8142. + * arch/m68knommu
  8143. + * arch/blackfin
  8144. + * arch/parisc
  8145. + */
  8146. +#ifndef __ARCH_UBICOM32_POSIX_TYPES_H
  8147. +#define __ARCH_UBICOM32_POSIX_TYPES_H
  8148. +
  8149. +/*
  8150. + * This file is generally used by user-level software, so you need to
  8151. + * be a little careful about namespace pollution etc. Also, we cannot
  8152. + * assume GCC is being used.
  8153. + */
  8154. +
  8155. +typedef unsigned long __kernel_ino_t;
  8156. +typedef unsigned short __kernel_mode_t;
  8157. +typedef unsigned short __kernel_nlink_t;
  8158. +typedef long __kernel_off_t;
  8159. +typedef int __kernel_pid_t;
  8160. +typedef unsigned short __kernel_ipc_pid_t;
  8161. +typedef unsigned short __kernel_uid_t;
  8162. +typedef unsigned short __kernel_gid_t;
  8163. +typedef unsigned int __kernel_size_t;
  8164. +typedef int __kernel_ssize_t;
  8165. +typedef int __kernel_ptrdiff_t;
  8166. +typedef long __kernel_time_t;
  8167. +typedef long __kernel_suseconds_t;
  8168. +typedef long __kernel_clock_t;
  8169. +typedef int __kernel_timer_t;
  8170. +typedef int __kernel_clockid_t;
  8171. +typedef int __kernel_daddr_t;
  8172. +typedef char * __kernel_caddr_t;
  8173. +typedef unsigned short __kernel_uid16_t;
  8174. +typedef unsigned short __kernel_gid16_t;
  8175. +typedef unsigned int __kernel_uid32_t;
  8176. +typedef unsigned int __kernel_gid32_t;
  8177. +
  8178. +typedef unsigned short __kernel_old_uid_t;
  8179. +typedef unsigned short __kernel_old_gid_t;
  8180. +typedef unsigned short __kernel_old_dev_t;
  8181. +
  8182. +#ifdef __GNUC__
  8183. +typedef long long __kernel_loff_t;
  8184. +#endif
  8185. +
  8186. +typedef struct {
  8187. +#if defined(__KERNEL__) || defined(__USE_ALL)
  8188. + int val[2];
  8189. +#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
  8190. + int __val[2];
  8191. +#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
  8192. +} __kernel_fsid_t;
  8193. +
  8194. +#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
  8195. +
  8196. +#undef __FD_SET
  8197. +#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
  8198. +
  8199. +#undef __FD_CLR
  8200. +#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
  8201. +
  8202. +#undef __FD_ISSET
  8203. +#define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d))
  8204. +
  8205. +#undef __FD_ZERO
  8206. +#define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp)))
  8207. +
  8208. +#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
  8209. +
  8210. +#endif
  8211. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/processor.h linux-2.6.28.10/arch/ubicom32/include/asm/processor.h
  8212. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/processor.h 1970-01-01 02:00:00.000000000 +0200
  8213. +++ linux-2.6.28.10/arch/ubicom32/include/asm/processor.h 2009-08-06 10:31:02.000000000 +0300
  8214. @@ -0,0 +1,163 @@
  8215. +/*
  8216. + * arch/ubicom32/include/asm/processor.h
  8217. + * Thread related definitions for Ubicom32 architecture.
  8218. + *
  8219. + * (C) Copyright 2009, Ubicom, Inc.
  8220. + * Copyright (C) 1995 Hamish Macdonald
  8221. + *
  8222. + * This file is part of the Ubicom32 Linux Kernel Port.
  8223. + *
  8224. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  8225. + * it and/or modify it under the terms of the GNU General Public License
  8226. + * as published by the Free Software Foundation, either version 2 of the
  8227. + * License, or (at your option) any later version.
  8228. + *
  8229. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  8230. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  8231. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  8232. + * the GNU General Public License for more details.
  8233. + *
  8234. + * You should have received a copy of the GNU General Public License
  8235. + * along with the Ubicom32 Linux Kernel Port. If not,
  8236. + * see <http://www.gnu.org/licenses/>.
  8237. + *
  8238. + * Ubicom32 implementation derived from (with many thanks):
  8239. + * arch/m68knommu
  8240. + * arch/blackfin
  8241. + * arch/parisc
  8242. + */
  8243. +
  8244. +#ifndef _ASM_UBICOM32_PROCESSOR_H
  8245. +#define _ASM_UBICOM32_PROCESSOR_H
  8246. +
  8247. +/*
  8248. + * Default implementation of macro that returns current
  8249. + * instruction pointer ("program counter").
  8250. + */
  8251. +#define current_text_addr() ({ __label__ _l; _l: &&_l;})
  8252. +
  8253. +#include <linux/compiler.h>
  8254. +#include <linux/threads.h>
  8255. +#include <asm/types.h>
  8256. +#include <asm/segment.h>
  8257. +#include <asm/fpu.h>
  8258. +#include <asm/ptrace.h>
  8259. +#include <asm/current.h>
  8260. +#include <asm/thread_info.h>
  8261. +
  8262. +#if defined(CONFIG_UBICOM32_V3)
  8263. + #define CPU "IP5K"
  8264. +#endif
  8265. +#if defined(CONFIG_UBICOM32_V4)
  8266. + #define CPU "IP7K"
  8267. +#endif
  8268. +#ifndef CPU
  8269. + #define CPU "UNKNOWN"
  8270. +#endif
  8271. +
  8272. +/*
  8273. + * User space process size: 1st byte beyond user address space.
  8274. + */
  8275. +extern unsigned long memory_end;
  8276. +#define TASK_SIZE (memory_end)
  8277. +
  8278. +/*
  8279. + * This decides where the kernel will search for a free chunk of vm
  8280. + * space during mmap's. We won't be using it
  8281. + */
  8282. +#define TASK_UNMAPPED_BASE 0
  8283. +
  8284. +/*
  8285. + * This is the structure where we are going to save callee-saved registers.
  8286. + * A5 is the return address, A7 is the stack pointer, A6 is the frame
  8287. + * pointer. This is the frame that is created because of switch_to. This
  8288. + * is not the frame due to interrupt preemption or because of syscall entry.
  8289. + */
  8290. +
  8291. +struct thread_struct {
  8292. + unsigned long d10; /* D10 */
  8293. + unsigned long d11; /* D11 */
  8294. + unsigned long d12; /* D12 */
  8295. + unsigned long d13; /* D13 */
  8296. + unsigned long a1; /* A1 */
  8297. + unsigned long a2; /* A2 */
  8298. + unsigned long a5; /* A5 return address. */
  8299. + unsigned long a6; /* A6 */
  8300. + unsigned long sp; /* A7 kernel stack pointer. */
  8301. +};
  8302. +
  8303. +#define INIT_THREAD { \
  8304. + 0, 0, 0, 0, 0, 0, 0, 0, \
  8305. + sizeof(init_stack) + (unsigned long) init_stack - 8, \
  8306. +}
  8307. +
  8308. +/*
  8309. + * Do necessary setup to start up a newly executed thread.
  8310. + *
  8311. + * pass the data segment into user programs if it exists,
  8312. + * it can't hurt anything as far as I can tell
  8313. + */
  8314. +/*
  8315. + * Do necessary setup to start up a newly executed thread.
  8316. + */
  8317. +#define start_thread(regs, new_pc, new_sp) \
  8318. + do { \
  8319. + regs->pc = new_pc & ~3; \
  8320. + regs->an[5] = new_pc & ~3; \
  8321. + regs->an[7] = new_sp; \
  8322. + regs->nesting_level = -1; \
  8323. + regs->frame_type = UBICOM32_FRAME_TYPE_NEW_THREAD; \
  8324. + regs->thread_type = NORMAL_THREAD; \
  8325. + } while(0)
  8326. +
  8327. +/* Forward declaration, a strange C thing */
  8328. +struct task_struct;
  8329. +
  8330. +/* Free all resources held by a thread. */
  8331. +static inline void release_thread(struct task_struct *dead_task)
  8332. +{
  8333. +}
  8334. +
  8335. +/* Prepare to copy thread state - unlazy all lazy status */
  8336. +#define prepare_to_copy(tsk) do { } while (0)
  8337. +
  8338. +extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
  8339. +
  8340. +/*
  8341. + * Free current thread data structures etc..
  8342. + */
  8343. +static inline void exit_thread(void)
  8344. +{
  8345. +}
  8346. +
  8347. +unsigned long thread_saved_pc(struct task_struct *tsk);
  8348. +unsigned long get_wchan(struct task_struct *p);
  8349. +
  8350. +#define KSTK_EIP(tsk) (tsk->thread.a5)
  8351. +#define KSTK_ESP(tsk) (tsk->thread.sp)
  8352. +
  8353. +#define cpu_relax() barrier()
  8354. +
  8355. +extern void processor_init(void);
  8356. +extern unsigned int processor_timers(void);
  8357. +extern unsigned int processor_threads(void);
  8358. +extern unsigned int processor_frequency(void);
  8359. +extern int processor_interrupts(unsigned int *int0, unsigned int *int1);
  8360. +extern int processor_ocm(void **socm, void **eocm);
  8361. +extern int processor_dram(void **sdram, void **edram);
  8362. +
  8363. +#define THREAD_SIZE_LONGS (THREAD_SIZE/sizeof(unsigned long))
  8364. +#define KSTK_TOP(info) \
  8365. +({ \
  8366. + unsigned long *__ptr = (unsigned long *)(info); \
  8367. + (unsigned long)(&__ptr[THREAD_SIZE_LONGS]); \
  8368. +})
  8369. +
  8370. +#define task_pt_regs(task) \
  8371. +({ \
  8372. + struct pt_regs *__regs__; \
  8373. + __regs__ = (struct pt_regs *)(KSTK_TOP(task_stack_page(task))-8); \
  8374. + __regs__ - 1; \
  8375. +})
  8376. +
  8377. +#endif /* _ASM_UBICOM32_PROCESSOR_H */
  8378. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/ptrace.h linux-2.6.28.10/arch/ubicom32/include/asm/ptrace.h
  8379. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/ptrace.h 1970-01-01 02:00:00.000000000 +0200
  8380. +++ linux-2.6.28.10/arch/ubicom32/include/asm/ptrace.h 2009-08-06 10:31:02.000000000 +0300
  8381. @@ -0,0 +1,177 @@
  8382. +/*
  8383. + * arch/ubicom32/include/asm/ptrace.h
  8384. + * Ubicom32 architecture ptrace support.
  8385. + *
  8386. + * (C) Copyright 2009, Ubicom, Inc.
  8387. + *
  8388. + * This file is part of the Ubicom32 Linux Kernel Port.
  8389. + *
  8390. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  8391. + * it and/or modify it under the terms of the GNU General Public License
  8392. + * as published by the Free Software Foundation, either version 2 of the
  8393. + * License, or (at your option) any later version.
  8394. + *
  8395. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  8396. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  8397. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  8398. + * the GNU General Public License for more details.
  8399. + *
  8400. + * You should have received a copy of the GNU General Public License
  8401. + * along with the Ubicom32 Linux Kernel Port. If not,
  8402. + * see <http://www.gnu.org/licenses/>.
  8403. + *
  8404. + * Ubicom32 implementation derived from (with many thanks):
  8405. + * arch/m68knommu
  8406. + * arch/blackfin
  8407. + * arch/parisc
  8408. + */
  8409. +#ifndef _ASM_UBICOM32_PTRACE_H
  8410. +#define _ASM_UBICOM32_PTRACE_H
  8411. +
  8412. +#ifndef __ASSEMBLY__
  8413. +
  8414. +/*
  8415. + * We use hard coded constants because this is shared with user
  8416. + * space and the values are NOT allowed to change. Only fields
  8417. + * that are intended to be exposed get values.
  8418. + */
  8419. +#define PT_D0 0
  8420. +#define PT_D1 4
  8421. +#define PT_D2 8
  8422. +#define PT_D3 12
  8423. +#define PT_D4 16
  8424. +#define PT_D5 20
  8425. +#define PT_D6 24
  8426. +#define PT_D7 28
  8427. +#define PT_D8 32
  8428. +#define PT_D9 36
  8429. +#define PT_D10 40
  8430. +#define PT_D11 44
  8431. +#define PT_D12 48
  8432. +#define PT_D13 52
  8433. +#define PT_D14 56
  8434. +#define PT_D15 60
  8435. +#define PT_A0 64
  8436. +#define PT_A1 68
  8437. +#define PT_A2 72
  8438. +#define PT_A3 76
  8439. +#define PT_A4 80
  8440. +#define PT_A5 84
  8441. +#define PT_A6 88
  8442. +#define PT_A7 92
  8443. +#define PT_SP 92
  8444. +#define PT_ACC0HI 96
  8445. +#define PT_ACC0LO 100
  8446. +#define PT_MAC_RC16 104
  8447. +#define PT_ACC1HI 108
  8448. +#define PT_ACC1LO 112
  8449. +#define PT_SOURCE3 116
  8450. +#define PT_INST_CNT 120
  8451. +#define PT_CSR 124
  8452. +#define PT_DUMMY_UNUSED 128
  8453. +#define PT_INT_MASK0 132
  8454. +#define PT_INT_MASK1 136
  8455. +#define PT_TRAP_CAUSE 140
  8456. +#define PT_PC 144
  8457. +#define PT_ORIGINAL_D0 148
  8458. +#define PT_FRAME_TYPE 152
  8459. +
  8460. +/*
  8461. + * The following 'registers' are not registers at all but are used
  8462. + * locate the relocated sections.
  8463. + */
  8464. +#define PT_TEXT_ADDR 200
  8465. +#define PT_TEXT_END_ADDR 204
  8466. +#define PT_DATA_ADDR 208
  8467. +#define PT_EXEC_FDPIC_LOADMAP 212
  8468. +#define PT_INTERP_FDPIC_LOADMAP 216
  8469. +
  8470. +/*
  8471. + * This struct defines the way the registers are stored on the
  8472. + * stack during a system call.
  8473. + */
  8474. +enum thread_type {
  8475. + NORMAL_THREAD,
  8476. + KERNEL_THREAD,
  8477. +};
  8478. +
  8479. +#define UBICOM32_FRAME_TYPE_SYSCALL -1 /* System call frame */
  8480. +#define UBICOM32_FRAME_TYPE_INVALID 0 /* Invalid frame, no longer in use */
  8481. +#define UBICOM32_FRAME_TYPE_INTERRUPT 1 /* Interrupt frame */
  8482. +#define UBICOM32_FRAME_TYPE_TRAP 2 /* Trap frame */
  8483. +#define UBICOM32_FRAME_TYPE_SIGTRAMP 3 /* Signal trampoline frame. */
  8484. +#define UBICOM32_FRAME_TYPE_NEW_THREAD 4 /* New Thread. */
  8485. +
  8486. +struct pt_regs {
  8487. + /*
  8488. + * Data Registers
  8489. + */
  8490. + unsigned long dn[16];
  8491. +
  8492. + /*
  8493. + * Address Registers
  8494. + */
  8495. + unsigned long an[8];
  8496. +
  8497. + /*
  8498. + * Per thread misc registers.
  8499. + */
  8500. + unsigned long acc0[2];
  8501. + unsigned long mac_rc16;
  8502. + unsigned long acc1[2];
  8503. + unsigned long source3;
  8504. + unsigned long inst_cnt;
  8505. + unsigned long csr;
  8506. + unsigned long dummy_unused;
  8507. + unsigned long int_mask0;
  8508. + unsigned long int_mask1;
  8509. + unsigned long trap_cause;
  8510. + unsigned long pc;
  8511. + unsigned long original_dn_0;
  8512. +
  8513. + /*
  8514. + * Frame type. Syscall frames are -1. For other types look above.
  8515. + */
  8516. + unsigned long frame_type;
  8517. +
  8518. + /*
  8519. + * These fields are not exposed to ptrace.
  8520. + */
  8521. + unsigned long previous_pc;
  8522. + long nesting_level; /* When the kernel in in user space this
  8523. + * will be -1. */
  8524. + unsigned long thread_type; /* This indicates if this is a kernel
  8525. + * thread. */
  8526. +};
  8527. +
  8528. +/*
  8529. + * This is the extended stack used by signal handlers and the context
  8530. + * switcher: it's pushed after the normal "struct pt_regs".
  8531. + */
  8532. +struct switch_stack {
  8533. + unsigned long dummy;
  8534. +};
  8535. +
  8536. +#ifdef __KERNEL__
  8537. +
  8538. +/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
  8539. +#define PTRACE_GETREGS 12
  8540. +#define PTRACE_SETREGS 13
  8541. +
  8542. +#ifndef PS_S
  8543. +#define PS_S (0x2000)
  8544. +#define PS_M (0x1000)
  8545. +#endif
  8546. +
  8547. +extern int __user_mode(unsigned long sp);
  8548. +
  8549. +#define user_mode(regs) (__user_mode((regs->an[7])))
  8550. +#define user_stack(regs) ((regs)->an[7])
  8551. +#define instruction_pointer(regs) ((regs)->pc)
  8552. +#define profile_pc(regs) instruction_pointer(regs)
  8553. +extern void show_regs(struct pt_regs *);
  8554. +#endif /* __KERNEL__ */
  8555. +
  8556. +#endif /* __ASSEMBLY__ */
  8557. +
  8558. +#endif /* _ASM_UBICOM32_PTRACE_H */
  8559. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/range-protect-asm.h linux-2.6.28.10/arch/ubicom32/include/asm/range-protect-asm.h
  8560. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/range-protect-asm.h 1970-01-01 02:00:00.000000000 +0200
  8561. +++ linux-2.6.28.10/arch/ubicom32/include/asm/range-protect-asm.h 2009-08-06 10:31:02.000000000 +0300
  8562. @@ -0,0 +1,91 @@
  8563. +/*
  8564. + * arch/ubicom32/include/asm/range-protect-asm.h
  8565. + * Assembly macros for enabling memory protection.
  8566. + *
  8567. + * (C) Copyright 2009, Ubicom, Inc.
  8568. + *
  8569. + * This file is part of the Ubicom32 Linux Kernel Port.
  8570. + *
  8571. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  8572. + * it and/or modify it under the terms of the GNU General Public License
  8573. + * as published by the Free Software Foundation, either version 2 of the
  8574. + * License, or (at your option) any later version.
  8575. + *
  8576. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  8577. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  8578. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  8579. + * the GNU General Public License for more details.
  8580. + *
  8581. + * You should have received a copy of the GNU General Public License
  8582. + * along with the Ubicom32 Linux Kernel Port. If not,
  8583. + * see <http://www.gnu.org/licenses/>.
  8584. + *
  8585. + * Ubicom32 implementation derived from (with many thanks):
  8586. + * arch/m68knommu
  8587. + * arch/blackfin
  8588. + * arch/parisc
  8589. + */
  8590. +
  8591. +#ifndef _ASM_UBICOM32_RANGE_PROTECT_ASM_H
  8592. +#define _ASM_UBICOM32_RANGE_PROTECT_ASM_H
  8593. +
  8594. +#if defined(__ASSEMBLY__)
  8595. +
  8596. +#include <asm/thread-asm.h>
  8597. +
  8598. +/*
  8599. + * You should only use the enable/disable ranges when you have the atomic lock,
  8600. + * if you do not there will be problems.
  8601. + */
  8602. +
  8603. +/*
  8604. + * enable_kernel_ranges
  8605. + * Enable the kernel ranges (disabling protection) for thread,
  8606. + * where thread == (1 << thread number)
  8607. + */
  8608. +.macro enable_kernel_ranges thread
  8609. +#ifdef CONFIG_PROTECT_KERNEL
  8610. + or.4 I_RANGE0_EN, I_RANGE0_EN, \thread /* Enable Range Register */
  8611. + or.4 D_RANGE0_EN, D_RANGE0_EN, \thread
  8612. + or.4 D_RANGE1_EN, D_RANGE1_EN, \thread
  8613. +#endif
  8614. +.endm
  8615. +
  8616. +/*
  8617. + * enable_kernel_ranges_for_current
  8618. + * Enable the kernel ranges (disabling protection) for this thread
  8619. + */
  8620. +.macro enable_kernel_ranges_for_current scratch_reg
  8621. +#ifdef CONFIG_PROTECT_KERNEL
  8622. + thread_get_self_mask \scratch_reg
  8623. + enable_kernel_ranges \scratch_reg
  8624. +#endif
  8625. +.endm
  8626. +
  8627. +/*
  8628. + * disable_kernel_ranges
  8629. + * Disables the kernel ranges (enabling protection) for thread
  8630. + * where thread == (1 << thread number)
  8631. + */
  8632. +.macro disable_kernel_ranges thread
  8633. +#ifdef CONFIG_PROTECT_KERNEL
  8634. + not.4 \thread, \thread
  8635. + and.4 I_RANGE0_EN, I_RANGE0_EN, \thread /* Disable Range Register */
  8636. + and.4 D_RANGE0_EN, D_RANGE0_EN, \thread
  8637. + and.4 D_RANGE1_EN, D_RANGE1_EN, \thread
  8638. +#endif
  8639. +.endm
  8640. +
  8641. +/*
  8642. + * disable_kernel_ranges_for_current
  8643. + * Disable kernel ranges (enabling protection) for this thread
  8644. + */
  8645. +.macro disable_kernel_ranges_for_current scratch_reg
  8646. +#ifdef CONFIG_PROTECT_KERNEL
  8647. + thread_get_self_mask \scratch_reg
  8648. + disable_kernel_ranges \scratch_reg
  8649. +#endif
  8650. +.endm
  8651. +#endif
  8652. +
  8653. +#endif /* _ASM_UBICOM32_RANGE_PROTECT_ASM_H */
  8654. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/range-protect.h linux-2.6.28.10/arch/ubicom32/include/asm/range-protect.h
  8655. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/range-protect.h 1970-01-01 02:00:00.000000000 +0200
  8656. +++ linux-2.6.28.10/arch/ubicom32/include/asm/range-protect.h 2009-08-06 10:31:02.000000000 +0300
  8657. @@ -0,0 +1,62 @@
  8658. +/*
  8659. + * arch/ubicom32/include/asm/range-protect.h
  8660. + * Assembly macros declared in C for enabling memory protection.
  8661. + *
  8662. + * (C) Copyright 2009, Ubicom, Inc.
  8663. + *
  8664. + * This file is part of the Ubicom32 Linux Kernel Port.
  8665. + *
  8666. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  8667. + * it and/or modify it under the terms of the GNU General Public License
  8668. + * as published by the Free Software Foundation, either version 2 of the
  8669. + * License, or (at your option) any later version.
  8670. + *
  8671. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  8672. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  8673. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  8674. + * the GNU General Public License for more details.
  8675. + *
  8676. + * You should have received a copy of the GNU General Public License
  8677. + * along with the Ubicom32 Linux Kernel Port. If not,
  8678. + * see <http://www.gnu.org/licenses/>.
  8679. + *
  8680. + * Ubicom32 implementation derived from (with many thanks):
  8681. + * arch/m68knommu
  8682. + * arch/blackfin
  8683. + * arch/parisc
  8684. + */
  8685. +
  8686. +#ifndef _ASM_UBICOM32_RANGE_PROTECT_H
  8687. +#define _ASM_UBICOM32_RANGE_PROTECT_H
  8688. +
  8689. +#if !defined(__ASSEMBLY__)
  8690. +#include <asm/thread.h>
  8691. +/*
  8692. + * The following macros should be the identical to the ones in
  8693. + * range-protect-asm.h
  8694. + *
  8695. + * You should only use the enable/disable ranges when you have the atomic lock,
  8696. + * if you do not there will be problems.
  8697. + */
  8698. +
  8699. +/*
  8700. + * enable_kernel_ranges
  8701. + * Enable the kernel ranges (disabling protection) for thread,
  8702. + * where thread == (1 << thread number)
  8703. + */
  8704. +asm (
  8705. + ".macro enable_kernel_ranges thread \n\t"
  8706. +#ifdef CONFIG_PROTECT_KERNEL
  8707. + " or.4 I_RANGE0_EN, I_RANGE0_EN, \\thread \n\t" /* Enable Range Register */
  8708. + " or.4 D_RANGE0_EN, D_RANGE0_EN, \\thread \n\t"
  8709. + " or.4 D_RANGE1_EN, D_RANGE1_EN, \\thread \n\t"
  8710. +#endif
  8711. + ".endm \n\t"
  8712. +);
  8713. +
  8714. +#else /* __ASSEMBLY__ */
  8715. +
  8716. +#include <asm/range-protect-asm.h>
  8717. +
  8718. +#endif
  8719. +#endif /* _ASM_UBICOM32_RANGE_PROTECT_H */
  8720. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/resource.h linux-2.6.28.10/arch/ubicom32/include/asm/resource.h
  8721. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/resource.h 1970-01-01 02:00:00.000000000 +0200
  8722. +++ linux-2.6.28.10/arch/ubicom32/include/asm/resource.h 2009-08-06 10:31:02.000000000 +0300
  8723. @@ -0,0 +1,33 @@
  8724. +/*
  8725. + * arch/ubicom32/include/asm/resource.h
  8726. + * Generic definitions for Ubicom32 architecture.
  8727. + *
  8728. + * (C) Copyright 2009, Ubicom, Inc.
  8729. + *
  8730. + * This file is part of the Ubicom32 Linux Kernel Port.
  8731. + *
  8732. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  8733. + * it and/or modify it under the terms of the GNU General Public License
  8734. + * as published by the Free Software Foundation, either version 2 of the
  8735. + * License, or (at your option) any later version.
  8736. + *
  8737. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  8738. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  8739. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  8740. + * the GNU General Public License for more details.
  8741. + *
  8742. + * You should have received a copy of the GNU General Public License
  8743. + * along with the Ubicom32 Linux Kernel Port. If not,
  8744. + * see <http://www.gnu.org/licenses/>.
  8745. + *
  8746. + * Ubicom32 implementation derived from (with many thanks):
  8747. + * arch/m68knommu
  8748. + * arch/blackfin
  8749. + * arch/parisc
  8750. + */
  8751. +#ifndef _ASM_UBICOM32_RESOURCE_H
  8752. +#define _ASM_UBICOM32_RESOURCE_H
  8753. +
  8754. +#include <asm-generic/resource.h>
  8755. +
  8756. +#endif /* _ASM_UBICOM32_RESOURCE_H */
  8757. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/ring_tio.h linux-2.6.28.10/arch/ubicom32/include/asm/ring_tio.h
  8758. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/ring_tio.h 1970-01-01 02:00:00.000000000 +0200
  8759. +++ linux-2.6.28.10/arch/ubicom32/include/asm/ring_tio.h 2009-08-06 10:31:02.000000000 +0300
  8760. @@ -0,0 +1,42 @@
  8761. +/*
  8762. + * arch/ubicom32/include/asm/ring_tio.h
  8763. + * Ubicom32 architecture Ring TIO definitions.
  8764. + *
  8765. + * (C) Copyright 2009, Ubicom, Inc.
  8766. + *
  8767. + * This file is part of the Ubicom32 Linux Kernel Port.
  8768. + *
  8769. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  8770. + * it and/or modify it under the terms of the GNU General Public License
  8771. + * as published by the Free Software Foundation, either version 2 of the
  8772. + * License, or (at your option) any later version.
  8773. + *
  8774. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  8775. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  8776. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  8777. + * the GNU General Public License for more details.
  8778. + *
  8779. + * You should have received a copy of the GNU General Public License
  8780. + * along with the Ubicom32 Linux Kernel Port. If not,
  8781. + * see <http://www.gnu.org/licenses/>.
  8782. + */
  8783. +#ifndef _ASM_UBICOM32_RING_TIO_H
  8784. +#define _ASM_UBICOM32_RING_TIO_H
  8785. +
  8786. +#include <asm/devtree.h>
  8787. +
  8788. +#define RING_TIO_NODE_VERSION 2
  8789. +
  8790. +/*
  8791. + * Devtree node for ring
  8792. + */
  8793. +struct ring_tio_node {
  8794. + struct devtree_node dn;
  8795. +
  8796. + u32_t version;
  8797. + void *regs;
  8798. +};
  8799. +
  8800. +extern void ring_tio_init(const char *node_name);
  8801. +
  8802. +#endif /* _ASM_UBICOM32_RING_TIO_H */
  8803. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/scatterlist.h linux-2.6.28.10/arch/ubicom32/include/asm/scatterlist.h
  8804. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/scatterlist.h 1970-01-01 02:00:00.000000000 +0200
  8805. +++ linux-2.6.28.10/arch/ubicom32/include/asm/scatterlist.h 2009-08-06 10:31:02.000000000 +0300
  8806. @@ -0,0 +1,49 @@
  8807. +/*
  8808. + * arch/ubicom32/include/asm/scatterlist.h
  8809. + * Definitions of struct scatterlist for Ubicom32 architecture.
  8810. + *
  8811. + * (C) Copyright 2009, Ubicom, Inc.
  8812. + *
  8813. + * This file is part of the Ubicom32 Linux Kernel Port.
  8814. + *
  8815. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  8816. + * it and/or modify it under the terms of the GNU General Public License
  8817. + * as published by the Free Software Foundation, either version 2 of the
  8818. + * License, or (at your option) any later version.
  8819. + *
  8820. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  8821. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  8822. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  8823. + * the GNU General Public License for more details.
  8824. + *
  8825. + * You should have received a copy of the GNU General Public License
  8826. + * along with the Ubicom32 Linux Kernel Port. If not,
  8827. + * see <http://www.gnu.org/licenses/>.
  8828. + *
  8829. + * Ubicom32 implementation derived from (with many thanks):
  8830. + * arch/m68knommu
  8831. + * arch/blackfin
  8832. + * arch/parisc
  8833. + */
  8834. +#ifndef _ASM_UBICOM32_SCATTERLIST_H
  8835. +#define _ASM_UBICOM32_SCATTERLIST_H
  8836. +
  8837. +#include <linux/mm.h>
  8838. +#include <asm/types.h>
  8839. +
  8840. +struct scatterlist {
  8841. +#ifdef CONFIG_DEBUG_SG
  8842. + unsigned long sg_magic;
  8843. +#endif
  8844. + unsigned long page_link;
  8845. + unsigned int offset;
  8846. + dma_addr_t dma_address;
  8847. + unsigned int length;
  8848. +};
  8849. +
  8850. +#define sg_dma_address(sg) ((sg)->dma_address)
  8851. +#define sg_dma_len(sg) ((sg)->length)
  8852. +
  8853. +#define ISA_DMA_THRESHOLD (0xffffffff)
  8854. +
  8855. +#endif /* _ASM_UBICOM32_SCATTERLIST_H */
  8856. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/sections.h linux-2.6.28.10/arch/ubicom32/include/asm/sections.h
  8857. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/sections.h 1970-01-01 02:00:00.000000000 +0200
  8858. +++ linux-2.6.28.10/arch/ubicom32/include/asm/sections.h 2009-08-06 10:31:02.000000000 +0300
  8859. @@ -0,0 +1,33 @@
  8860. +/*
  8861. + * arch/ubicom32/include/asm/sections.h
  8862. + * Generic sections.h definitions for Ubicom32 architecture.
  8863. + *
  8864. + * (C) Copyright 2009, Ubicom, Inc.
  8865. + *
  8866. + * This file is part of the Ubicom32 Linux Kernel Port.
  8867. + *
  8868. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  8869. + * it and/or modify it under the terms of the GNU General Public License
  8870. + * as published by the Free Software Foundation, either version 2 of the
  8871. + * License, or (at your option) any later version.
  8872. + *
  8873. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  8874. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  8875. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  8876. + * the GNU General Public License for more details.
  8877. + *
  8878. + * You should have received a copy of the GNU General Public License
  8879. + * along with the Ubicom32 Linux Kernel Port. If not,
  8880. + * see <http://www.gnu.org/licenses/>.
  8881. + *
  8882. + * Ubicom32 implementation derived from (with many thanks):
  8883. + * arch/m68knommu
  8884. + * arch/blackfin
  8885. + * arch/parisc
  8886. + */
  8887. +#ifndef _ASM_UBICOM32_SECTIONS_H
  8888. +#define _ASM_UBICOM32_SECTIONS_H
  8889. +
  8890. +#include <asm-generic/sections.h>
  8891. +
  8892. +#endif /* _ASM_UBICOM32_SECTIONS_H */
  8893. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/segment.h linux-2.6.28.10/arch/ubicom32/include/asm/segment.h
  8894. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/segment.h 1970-01-01 02:00:00.000000000 +0200
  8895. +++ linux-2.6.28.10/arch/ubicom32/include/asm/segment.h 2009-08-06 10:31:02.000000000 +0300
  8896. @@ -0,0 +1,78 @@
  8897. +/*
  8898. + * arch/ubicom32/include/asm/segment.h
  8899. + * Memory segment definitions for Ubicom32 architecture.
  8900. + *
  8901. + * (C) Copyright 2009, Ubicom, Inc.
  8902. + *
  8903. + * This file is part of the Ubicom32 Linux Kernel Port.
  8904. + *
  8905. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  8906. + * it and/or modify it under the terms of the GNU General Public License
  8907. + * as published by the Free Software Foundation, either version 2 of the
  8908. + * License, or (at your option) any later version.
  8909. + *
  8910. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  8911. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  8912. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  8913. + * the GNU General Public License for more details.
  8914. + *
  8915. + * You should have received a copy of the GNU General Public License
  8916. + * along with the Ubicom32 Linux Kernel Port. If not,
  8917. + * see <http://www.gnu.org/licenses/>.
  8918. + *
  8919. + * Ubicom32 implementation derived from (with many thanks):
  8920. + * arch/m68knommu
  8921. + * arch/blackfin
  8922. + * arch/parisc
  8923. + */
  8924. +#ifndef _ASM_UBICOM32_SEGMENT_H
  8925. +#define _ASM_UBICOM32_SEGMENT_H
  8926. +
  8927. +/* define constants */
  8928. +/* Address spaces (FC0-FC2) */
  8929. +#define USER_DATA (1)
  8930. +#ifndef __USER_DS
  8931. +#define __USER_DS (USER_DATA)
  8932. +#endif
  8933. +#define USER_PROGRAM (2)
  8934. +#define SUPER_DATA (5)
  8935. +#ifndef __KERNEL_DS
  8936. +#define __KERNEL_DS (SUPER_DATA)
  8937. +#endif
  8938. +#define SUPER_PROGRAM (6)
  8939. +#define CPU_SPACE (7)
  8940. +
  8941. +#ifndef __ASSEMBLY__
  8942. +
  8943. +typedef struct {
  8944. + unsigned long seg;
  8945. +} mm_segment_t;
  8946. +
  8947. +#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
  8948. +#define USER_DS MAKE_MM_SEG(__USER_DS)
  8949. +#define KERNEL_DS MAKE_MM_SEG(__KERNEL_DS)
  8950. +
  8951. +/*
  8952. + * Get/set the SFC/DFC registers for MOVES instructions
  8953. + */
  8954. +
  8955. +static inline mm_segment_t get_fs(void)
  8956. +{
  8957. + return USER_DS;
  8958. +}
  8959. +
  8960. +static inline mm_segment_t get_ds(void)
  8961. +{
  8962. + /* return the supervisor data space code */
  8963. + return KERNEL_DS;
  8964. +}
  8965. +
  8966. +static inline void set_fs(mm_segment_t val)
  8967. +{
  8968. +}
  8969. +
  8970. +#define segment_eq(a,b) ((a).seg == (b).seg)
  8971. +
  8972. +#endif /* __ASSEMBLY__ */
  8973. +
  8974. +#endif /* _ASM_UBICOM32_SEGMENT_H */
  8975. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/semaphore.h linux-2.6.28.10/arch/ubicom32/include/asm/semaphore.h
  8976. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/semaphore.h 1970-01-01 02:00:00.000000000 +0200
  8977. +++ linux-2.6.28.10/arch/ubicom32/include/asm/semaphore.h 2009-08-06 10:31:02.000000000 +0300
  8978. @@ -0,0 +1,140 @@
  8979. +/*
  8980. + * arch/ubicom32/include/asm/semaphore.h
  8981. + * Interrupt-safe semaphores for Ubicom32 architecture.
  8982. + *
  8983. + * (C) Copyright 2009, Ubicom, Inc.
  8984. + * (C) Copyright 1996 Linus Torvalds
  8985. + * m68k version by Andreas Schwab
  8986. + * Copyright (C) 2004 Microtronix Datacom Ltd
  8987. + *
  8988. + * This file is part of the Ubicom32 Linux Kernel Port.
  8989. + *
  8990. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  8991. + * it and/or modify it under the terms of the GNU General Public License
  8992. + * as published by the Free Software Foundation, either version 2 of the
  8993. + * License, or (at your option) any later version.
  8994. + *
  8995. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  8996. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  8997. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  8998. + * the GNU General Public License for more details.
  8999. + *
  9000. + * You should have received a copy of the GNU General Public License
  9001. + * along with the Ubicom32 Linux Kernel Port. If not,
  9002. + * see <http://www.gnu.org/licenses/>.
  9003. + *
  9004. + * Ubicom32 implementation derived from (with many thanks):
  9005. + * arch/m68knommu
  9006. + * arch/blackfin
  9007. + * arch/parisc
  9008. + */
  9009. +#ifndef _ASM_UBICOM32_SEMAPHORE_H
  9010. +#define _ASM_UBICOM32_SEMAPHORE_H
  9011. +
  9012. +#define RW_LOCK_BIAS 0x01000000
  9013. +
  9014. +#ifndef __ASSEMBLY__
  9015. +
  9016. +#include <linux/linkage.h>
  9017. +#include <linux/wait.h>
  9018. +#include <linux/spinlock.h>
  9019. +#include <linux/rwsem.h>
  9020. +
  9021. +#include <asm/system.h>
  9022. +#include <asm/atomic.h>
  9023. +
  9024. +struct semaphore {
  9025. + atomic_t count;
  9026. + atomic_t waking;
  9027. + wait_queue_head_t wait;
  9028. +};
  9029. +
  9030. +#define __SEMAPHORE_INITIALIZER(name, n) \
  9031. +{ \
  9032. + .count = ATOMIC_INIT(n), \
  9033. + .waking = ATOMIC_INIT(0), \
  9034. + .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \
  9035. +}
  9036. +
  9037. +#define __DECLARE_SEMAPHORE_GENERIC(name,count) \
  9038. + struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
  9039. +
  9040. +#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
  9041. +#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
  9042. +
  9043. +static inline void sema_init (struct semaphore *sem, int val)
  9044. +{
  9045. + *sem = (struct semaphore)__SEMAPHORE_INITIALIZER(*sem, val);
  9046. +}
  9047. +
  9048. +static inline void init_MUTEX (struct semaphore *sem)
  9049. +{
  9050. + sema_init(sem, 1);
  9051. +}
  9052. +
  9053. +static inline void init_MUTEX_LOCKED (struct semaphore *sem)
  9054. +{
  9055. + sema_init(sem, 0);
  9056. +}
  9057. +
  9058. +asmlinkage void __down_failed(void /* special register calling convention */);
  9059. +asmlinkage int __down_failed_interruptible(void /* params in registers */);
  9060. +asmlinkage int __down_failed_trylock(void /* params in registers */);
  9061. +asmlinkage void __up_wakeup(void /* special register calling convention */);
  9062. +
  9063. +asmlinkage void __down(struct semaphore * sem);
  9064. +asmlinkage int __down_interruptible(struct semaphore * sem);
  9065. +asmlinkage int __down_trylock(struct semaphore * sem);
  9066. +asmlinkage void __up(struct semaphore * sem);
  9067. +
  9068. +extern spinlock_t semaphore_wake_lock;
  9069. +
  9070. +/*
  9071. + * This is ugly, but we want the default case to fall through.
  9072. + * "down_failed" is a special asm handler that calls the C
  9073. + * routine that actually waits.
  9074. + */
  9075. +static inline void down(struct semaphore * sem)
  9076. +{
  9077. + might_sleep();
  9078. +
  9079. + if (atomic_dec_return(&sem->count) < 0)
  9080. + __down(sem);
  9081. +}
  9082. +
  9083. +static inline int down_interruptible(struct semaphore * sem)
  9084. +{
  9085. + int ret = 0;
  9086. +
  9087. +
  9088. + might_sleep();
  9089. +
  9090. + if(atomic_dec_return(&sem->count) < 0)
  9091. + ret = __down_interruptible(sem);
  9092. + return ret;
  9093. +}
  9094. +
  9095. +static inline int down_trylock(struct semaphore * sem)
  9096. +{
  9097. + int ret = 0;
  9098. +
  9099. + if (atomic_dec_return (&sem->count) < 0)
  9100. + ret = __down_trylock(sem);
  9101. + return ret;
  9102. +}
  9103. +
  9104. +/*
  9105. + * Note! This is subtle. We jump to wake people up only if
  9106. + * the semaphore was negative (== somebody was waiting on it).
  9107. + * The default case (no contention) will result in NO
  9108. + * jumps for both down() and up().
  9109. + */
  9110. +static inline void up(struct semaphore * sem)
  9111. +{
  9112. + if (atomic_inc_return(&sem->count) <= 0)
  9113. + __up(sem);
  9114. +}
  9115. +
  9116. +#endif /* __ASSEMBLY__ */
  9117. +
  9118. +#endif /* _ASM_UBICOM32_SEMAPHORE_H */
  9119. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/semaphore-helper.h linux-2.6.28.10/arch/ubicom32/include/asm/semaphore-helper.h
  9120. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/semaphore-helper.h 1970-01-01 02:00:00.000000000 +0200
  9121. +++ linux-2.6.28.10/arch/ubicom32/include/asm/semaphore-helper.h 2009-08-06 10:31:02.000000000 +0300
  9122. @@ -0,0 +1,109 @@
  9123. +/*
  9124. + * arch/ubicom32/include/asm/semaphore-helper.h
  9125. + * Semaphore related definitions for Ubicom32 architecture.
  9126. + *
  9127. + * (C) Copyright 2009, Ubicom, Inc.
  9128. + *
  9129. + * This file is part of the Ubicom32 Linux Kernel Port.
  9130. + *
  9131. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  9132. + * it and/or modify it under the terms of the GNU General Public License
  9133. + * as published by the Free Software Foundation, either version 2 of the
  9134. + * License, or (at your option) any later version.
  9135. + *
  9136. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  9137. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  9138. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  9139. + * the GNU General Public License for more details.
  9140. + *
  9141. + * You should have received a copy of the GNU General Public License
  9142. + * along with the Ubicom32 Linux Kernel Port. If not,
  9143. + * see <http://www.gnu.org/licenses/>.
  9144. + *
  9145. + * Ubicom32 implementation derived from (with many thanks):
  9146. + * arch/m68knommu
  9147. + * arch/blackfin
  9148. + * arch/parisc
  9149. + */
  9150. +#ifndef _ASM_UBICOM32_SEMAPHORE_HELPER_H
  9151. +#define _ASM_UBICOM32_SEMAPHORE_HELPER_H
  9152. +
  9153. +/*
  9154. + * SMP- and interrupt-safe semaphores helper functions.
  9155. + *
  9156. + * (C) Copyright 1996 Linus Torvalds
  9157. + *
  9158. + * m68k version by Andreas Schwab
  9159. + */
  9160. +
  9161. +
  9162. +/*
  9163. + * These two _must_ execute atomically wrt each other.
  9164. + */
  9165. +static inline void wake_one_more(struct semaphore * sem)
  9166. +{
  9167. + atomic_inc(&sem->waking);
  9168. +}
  9169. +
  9170. +static inline int waking_non_zero(struct semaphore *sem)
  9171. +{
  9172. + int ret;
  9173. + unsigned long flags;
  9174. +
  9175. + spin_lock_irqsave(&semaphore_wake_lock, flags);
  9176. + ret = 0;
  9177. + if (atomic_read(&sem->waking) > 0) {
  9178. + atomic_dec(&sem->waking);
  9179. + ret = 1;
  9180. + }
  9181. + spin_unlock_irqrestore(&semaphore_wake_lock, flags);
  9182. + return ret;
  9183. +}
  9184. +
  9185. +/*
  9186. + * waking_non_zero_interruptible:
  9187. + * 1 got the lock
  9188. + * 0 go to sleep
  9189. + * -EINTR interrupted
  9190. + */
  9191. +static inline int waking_non_zero_interruptible(struct semaphore *sem,
  9192. + struct task_struct *tsk)
  9193. +{
  9194. + int ret;
  9195. + unsigned long flags;
  9196. +
  9197. + spin_lock_irqsave(&semaphore_wake_lock, flags);
  9198. + ret = 0;
  9199. + if (atomic_read(&sem->waking) > 0) {
  9200. + atomic_dec(&sem->waking);
  9201. + ret = 1;
  9202. + } else if (signal_pending(tsk)) {
  9203. + atomic_inc(&sem->count);
  9204. + ret = -EINTR;
  9205. + }
  9206. + spin_unlock_irqrestore(&semaphore_wake_lock, flags);
  9207. + return ret;
  9208. +}
  9209. +
  9210. +/*
  9211. + * waking_non_zero_trylock:
  9212. + * 1 failed to lock
  9213. + * 0 got the lock
  9214. + */
  9215. +static inline int waking_non_zero_trylock(struct semaphore *sem)
  9216. +{
  9217. + int ret;
  9218. + unsigned long flags;
  9219. +
  9220. + spin_lock_irqsave(&semaphore_wake_lock, flags);
  9221. + ret = 1;
  9222. + if (atomic_read(&sem->waking) > 0) {
  9223. + atomic_dec(&sem->waking);
  9224. + ret = 0;
  9225. + } else
  9226. + atomic_inc(&sem->count);
  9227. + spin_unlock_irqrestore(&semaphore_wake_lock, flags);
  9228. + return ret;
  9229. +}
  9230. +
  9231. +#endif /* _ASM_UBICOM32_SEMAPHORE_HELPER_H */
  9232. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/sembuf.h linux-2.6.28.10/arch/ubicom32/include/asm/sembuf.h
  9233. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/sembuf.h 1970-01-01 02:00:00.000000000 +0200
  9234. +++ linux-2.6.28.10/arch/ubicom32/include/asm/sembuf.h 2009-08-06 10:31:02.000000000 +0300
  9235. @@ -0,0 +1,52 @@
  9236. +/*
  9237. + * arch/ubicom32/include/asm/sembuf.h
  9238. + * The semid64_ds structure for Ubicom32 architecture.
  9239. + *
  9240. + * (C) Copyright 2009, Ubicom, Inc.
  9241. + *
  9242. + * This file is part of the Ubicom32 Linux Kernel Port.
  9243. + *
  9244. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  9245. + * it and/or modify it under the terms of the GNU General Public License
  9246. + * as published by the Free Software Foundation, either version 2 of the
  9247. + * License, or (at your option) any later version.
  9248. + *
  9249. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  9250. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  9251. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  9252. + * the GNU General Public License for more details.
  9253. + *
  9254. + * You should have received a copy of the GNU General Public License
  9255. + * along with the Ubicom32 Linux Kernel Port. If not,
  9256. + * see <http://www.gnu.org/licenses/>.
  9257. + *
  9258. + * Ubicom32 implementation derived from (with many thanks):
  9259. + * arch/m68knommu
  9260. + * arch/blackfin
  9261. + * arch/parisc
  9262. + */
  9263. +#ifndef _ASM_UBICOM32_SEMBUF_H
  9264. +#define _ASM_UBICOM32_SEMBUF_H
  9265. +
  9266. +/*
  9267. + * The semid64_ds structure for ubicom32 architecture.
  9268. + * Note extra padding because this structure is passed back and forth
  9269. + * between kernel and user space.
  9270. + *
  9271. + * Pad space is left for:
  9272. + * - 64-bit time_t to solve y2038 problem
  9273. + * - 2 miscellaneous 32-bit values
  9274. + */
  9275. +
  9276. +struct semid64_ds {
  9277. + struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
  9278. + __kernel_time_t sem_otime; /* last semop time */
  9279. + unsigned long __unused1;
  9280. + __kernel_time_t sem_ctime; /* last change time */
  9281. + unsigned long __unused2;
  9282. + unsigned long sem_nsems; /* no. of semaphores in array */
  9283. + unsigned long __unused3;
  9284. + unsigned long __unused4;
  9285. +};
  9286. +
  9287. +#endif /* _ASM_UBICOM32_SEMBUF_H */
  9288. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/setup.h linux-2.6.28.10/arch/ubicom32/include/asm/setup.h
  9289. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/setup.h 1970-01-01 02:00:00.000000000 +0200
  9290. +++ linux-2.6.28.10/arch/ubicom32/include/asm/setup.h 2009-08-06 10:31:02.000000000 +0300
  9291. @@ -0,0 +1,35 @@
  9292. +/*
  9293. + * arch/ubicom32/include/asm/setup.h
  9294. + * Kernel command line length definition.
  9295. + *
  9296. + * (C) Copyright 2009, Ubicom, Inc.
  9297. + * Copyright (C) 2004, Microtronix Datacom Ltd., All rights reserved.
  9298. + *
  9299. + * This file is part of the Ubicom32 Linux Kernel Port.
  9300. + *
  9301. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  9302. + * it and/or modify it under the terms of the GNU General Public License
  9303. + * as published by the Free Software Foundation, either version 2 of the
  9304. + * License, or (at your option) any later version.
  9305. + *
  9306. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  9307. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  9308. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  9309. + * the GNU General Public License for more details.
  9310. + *
  9311. + * You should have received a copy of the GNU General Public License
  9312. + * along with the Ubicom32 Linux Kernel Port. If not,
  9313. + * see <http://www.gnu.org/licenses/>.
  9314. + *
  9315. + * Ubicom32 implementation derived from (with many thanks):
  9316. + * arch/m68knommu
  9317. + * arch/blackfin
  9318. + * arch/parisc
  9319. + */
  9320. +
  9321. +#ifndef _ASM_UBICOM32_SETUP_H
  9322. +#define _ASM_UBICOM32_SETUP_H
  9323. +
  9324. +#define COMMAND_LINE_SIZE 512
  9325. +
  9326. +#endif /* _ASM_UBICOM32_SETUP_H */
  9327. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/shmbuf.h linux-2.6.28.10/arch/ubicom32/include/asm/shmbuf.h
  9328. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/shmbuf.h 1970-01-01 02:00:00.000000000 +0200
  9329. +++ linux-2.6.28.10/arch/ubicom32/include/asm/shmbuf.h 2009-08-06 10:31:02.000000000 +0300
  9330. @@ -0,0 +1,69 @@
  9331. +/*
  9332. + * arch/ubicom32/include/asm/shmbuf.h
  9333. + * The shmid64_ds structure for the Ubicom32 architecture.
  9334. + *
  9335. + * (C) Copyright 2009, Ubicom, Inc.
  9336. + *
  9337. + * This file is part of the Ubicom32 Linux Kernel Port.
  9338. + *
  9339. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  9340. + * it and/or modify it under the terms of the GNU General Public License
  9341. + * as published by the Free Software Foundation, either version 2 of the
  9342. + * License, or (at your option) any later version.
  9343. + *
  9344. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  9345. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  9346. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  9347. + * the GNU General Public License for more details.
  9348. + *
  9349. + * You should have received a copy of the GNU General Public License
  9350. + * along with the Ubicom32 Linux Kernel Port. If not,
  9351. + * see <http://www.gnu.org/licenses/>.
  9352. + *
  9353. + * Ubicom32 implementation derived from (with many thanks):
  9354. + * arch/m68knommu
  9355. + * arch/blackfin
  9356. + * arch/parisc
  9357. + */
  9358. +#ifndef _ASM_UBICOM32_SHMBUF_H
  9359. +#define _ASM_UBICOM32_SHMBUF_H
  9360. +
  9361. +/*
  9362. + * The shmid64_ds structure for m68k architecture.
  9363. + * Note extra padding because this structure is passed back and forth
  9364. + * between kernel and user space.
  9365. + *
  9366. + * Pad space is left for:
  9367. + * - 64-bit time_t to solve y2038 problem
  9368. + * - 2 miscellaneous 32-bit values
  9369. + */
  9370. +
  9371. +struct shmid64_ds {
  9372. + struct ipc64_perm shm_perm; /* operation perms */
  9373. + size_t shm_segsz; /* size of segment (bytes) */
  9374. + __kernel_time_t shm_atime; /* last attach time */
  9375. + unsigned long __unused1;
  9376. + __kernel_time_t shm_dtime; /* last detach time */
  9377. + unsigned long __unused2;
  9378. + __kernel_time_t shm_ctime; /* last change time */
  9379. + unsigned long __unused3;
  9380. + __kernel_pid_t shm_cpid; /* pid of creator */
  9381. + __kernel_pid_t shm_lpid; /* pid of last operator */
  9382. + unsigned long shm_nattch; /* no. of current attaches */
  9383. + unsigned long __unused4;
  9384. + unsigned long __unused5;
  9385. +};
  9386. +
  9387. +struct shminfo64 {
  9388. + unsigned long shmmax;
  9389. + unsigned long shmmin;
  9390. + unsigned long shmmni;
  9391. + unsigned long shmseg;
  9392. + unsigned long shmall;
  9393. + unsigned long __unused1;
  9394. + unsigned long __unused2;
  9395. + unsigned long __unused3;
  9396. + unsigned long __unused4;
  9397. +};
  9398. +
  9399. +#endif /* _ASM_UBICOM32_SHMBUF_H */
  9400. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/shmparam.h linux-2.6.28.10/arch/ubicom32/include/asm/shmparam.h
  9401. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/shmparam.h 1970-01-01 02:00:00.000000000 +0200
  9402. +++ linux-2.6.28.10/arch/ubicom32/include/asm/shmparam.h 2009-08-06 10:31:02.000000000 +0300
  9403. @@ -0,0 +1,35 @@
  9404. +/*
  9405. + * arch/ubicom32/include/asm/shmparam.h
  9406. + * Shared memory definitions for Ubicom32 architecture.
  9407. + *
  9408. + * (C) Copyright 2009, Ubicom, Inc.
  9409. + * Copyright (C) 2004 Microtronix Datacom Ltd
  9410. + *
  9411. + * This file is part of the Ubicom32 Linux Kernel Port.
  9412. + *
  9413. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  9414. + * it and/or modify it under the terms of the GNU General Public License
  9415. + * as published by the Free Software Foundation, either version 2 of the
  9416. + * License, or (at your option) any later version.
  9417. + *
  9418. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  9419. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  9420. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  9421. + * the GNU General Public License for more details.
  9422. + *
  9423. + * You should have received a copy of the GNU General Public License
  9424. + * along with the Ubicom32 Linux Kernel Port. If not,
  9425. + * see <http://www.gnu.org/licenses/>.
  9426. + *
  9427. + * Ubicom32 implementation derived from (with many thanks):
  9428. + * arch/m68knommu
  9429. + * arch/blackfin
  9430. + * arch/parisc
  9431. + * Alpha, ix86, M68K, Sparc, ...et al
  9432. + */
  9433. +#ifndef _ASM_UBICOM32_SHMPARAM_H
  9434. +#define _ASM_UBICOM32_SHMPARAM_H
  9435. +
  9436. +#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */
  9437. +
  9438. +#endif /* _ASM_UBICOM32_SHMPARAM_H */
  9439. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/sigcontext.h linux-2.6.28.10/arch/ubicom32/include/asm/sigcontext.h
  9440. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/sigcontext.h 1970-01-01 02:00:00.000000000 +0200
  9441. +++ linux-2.6.28.10/arch/ubicom32/include/asm/sigcontext.h 2009-08-06 10:31:02.000000000 +0300
  9442. @@ -0,0 +1,37 @@
  9443. +/*
  9444. + * arch/ubicom32/include/asm/sigcontext.h
  9445. + * Definition of sigcontext struct for Ubicom32 architecture.
  9446. + *
  9447. + * (C) Copyright 2009, Ubicom, Inc.
  9448. + *
  9449. + * This file is part of the Ubicom32 Linux Kernel Port.
  9450. + *
  9451. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  9452. + * it and/or modify it under the terms of the GNU General Public License
  9453. + * as published by the Free Software Foundation, either version 2 of the
  9454. + * License, or (at your option) any later version.
  9455. + *
  9456. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  9457. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  9458. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  9459. + * the GNU General Public License for more details.
  9460. + *
  9461. + * You should have received a copy of the GNU General Public License
  9462. + * along with the Ubicom32 Linux Kernel Port. If not,
  9463. + * see <http://www.gnu.org/licenses/>.
  9464. + *
  9465. + * Ubicom32 implementation derived from (with many thanks):
  9466. + * arch/m68knommu
  9467. + * arch/blackfin
  9468. + * arch/parisc
  9469. + */
  9470. +#ifndef _ASM_UBICOM32_SIGCONTEXT_H
  9471. +#define _ASM_UBICOM32_SIGCONTEXT_H
  9472. +
  9473. +#include <asm/ptrace.h>
  9474. +
  9475. +struct sigcontext {
  9476. + struct pt_regs sc_regs;
  9477. +};
  9478. +
  9479. +#endif /* _ASM_UBICOM32_SIGCONTEXT_H */
  9480. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/siginfo.h linux-2.6.28.10/arch/ubicom32/include/asm/siginfo.h
  9481. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/siginfo.h 1970-01-01 02:00:00.000000000 +0200
  9482. +++ linux-2.6.28.10/arch/ubicom32/include/asm/siginfo.h 2009-08-06 10:31:02.000000000 +0300
  9483. @@ -0,0 +1,33 @@
  9484. +/*
  9485. + * arch/ubicom32/include/asm/siginfo.h
  9486. + * Generic siginfo.h definitions for Ubicom32 architecture.
  9487. + *
  9488. + * (C) Copyright 2009, Ubicom, Inc.
  9489. + *
  9490. + * This file is part of the Ubicom32 Linux Kernel Port.
  9491. + *
  9492. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  9493. + * it and/or modify it under the terms of the GNU General Public License
  9494. + * as published by the Free Software Foundation, either version 2 of the
  9495. + * License, or (at your option) any later version.
  9496. + *
  9497. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  9498. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  9499. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  9500. + * the GNU General Public License for more details.
  9501. + *
  9502. + * You should have received a copy of the GNU General Public License
  9503. + * along with the Ubicom32 Linux Kernel Port. If not,
  9504. + * see <http://www.gnu.org/licenses/>.
  9505. + *
  9506. + * Ubicom32 implementation derived from (with many thanks):
  9507. + * arch/m68knommu
  9508. + * arch/blackfin
  9509. + * arch/parisc
  9510. + */
  9511. +#ifndef _ASM_UBICOM32_SIGINFO_H
  9512. +#define _ASM_UBICOM32_SIGINFO_H
  9513. +
  9514. +#include <asm-generic/siginfo.h>
  9515. +
  9516. +#endif /* _ASM_UBICOM32_SIGINFO_H */
  9517. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/signal.h linux-2.6.28.10/arch/ubicom32/include/asm/signal.h
  9518. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/signal.h 1970-01-01 02:00:00.000000000 +0200
  9519. +++ linux-2.6.28.10/arch/ubicom32/include/asm/signal.h 2009-08-12 13:08:37.000000000 +0300
  9520. @@ -0,0 +1,180 @@
  9521. +/*
  9522. + * arch/ubicom32/include/asm/signal.h
  9523. + * Signal related definitions for Ubicom32 architecture.
  9524. + *
  9525. + * (C) Copyright 2009, Ubicom, Inc.
  9526. + *
  9527. + * This file is part of the Ubicom32 Linux Kernel Port.
  9528. + *
  9529. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  9530. + * it and/or modify it under the terms of the GNU General Public License
  9531. + * as published by the Free Software Foundation, either version 2 of the
  9532. + * License, or (at your option) any later version.
  9533. + *
  9534. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  9535. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  9536. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  9537. + * the GNU General Public License for more details.
  9538. + *
  9539. + * You should have received a copy of the GNU General Public License
  9540. + * along with the Ubicom32 Linux Kernel Port. If not,
  9541. + * see <http://www.gnu.org/licenses/>.
  9542. + *
  9543. + * Ubicom32 implementation derived from (with many thanks):
  9544. + * arch/m68knommu
  9545. + * arch/blackfin
  9546. + * arch/parisc
  9547. + */
  9548. +#ifndef _ASM_UBICOM32_SIGNAL_H
  9549. +#define _ASM_UBICOM32_SIGNAL_H
  9550. +
  9551. +#include <linux/types.h>
  9552. +
  9553. +/* Avoid too many header ordering problems. */
  9554. +struct siginfo;
  9555. +
  9556. +#ifdef __KERNEL__
  9557. +/* Most things should be clean enough to redefine this at will, if care
  9558. + is taken to make libc match. */
  9559. +
  9560. +#define _NSIG 64
  9561. +#define _NSIG_BPW 32
  9562. +#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
  9563. +
  9564. +typedef unsigned long old_sigset_t; /* at least 32 bits */
  9565. +
  9566. +typedef struct {
  9567. + unsigned long sig[_NSIG_WORDS];
  9568. +} sigset_t;
  9569. +
  9570. +#endif /* __KERNEL__ */
  9571. +
  9572. +#define SIGHUP 1
  9573. +#define SIGINT 2
  9574. +#define SIGQUIT 3
  9575. +#define SIGILL 4
  9576. +#define SIGTRAP 5
  9577. +#define SIGABRT 6
  9578. +#define SIGIOT 6
  9579. +#define SIGBUS 7
  9580. +#define SIGFPE 8
  9581. +#define SIGKILL 9
  9582. +#define SIGUSR1 10
  9583. +#define SIGSEGV 11
  9584. +#define SIGUSR2 12
  9585. +#define SIGPIPE 13
  9586. +#define SIGALRM 14
  9587. +#define SIGTERM 15
  9588. +#define SIGSTKFLT 16
  9589. +#define SIGCHLD 17
  9590. +#define SIGCONT 18
  9591. +#define SIGSTOP 19
  9592. +#define SIGTSTP 20
  9593. +#define SIGTTIN 21
  9594. +#define SIGTTOU 22
  9595. +#define SIGURG 23
  9596. +#define SIGXCPU 24
  9597. +#define SIGXFSZ 25
  9598. +#define SIGVTALRM 26
  9599. +#define SIGPROF 27
  9600. +#define SIGWINCH 28
  9601. +#define SIGIO 29
  9602. +#define SIGPOLL SIGIO
  9603. +/*
  9604. +#define SIGLOST 29
  9605. +*/
  9606. +#define SIGPWR 30
  9607. +#define SIGSYS 31
  9608. +#define SIGUNUSED 31
  9609. +
  9610. +/* These should not be considered constants from userland. */
  9611. +#define SIGRTMIN 32
  9612. +#define SIGRTMAX _NSIG
  9613. +
  9614. +/*
  9615. + * SA_FLAGS values:
  9616. + *
  9617. + * SA_ONSTACK indicates that a registered stack_t will be used.
  9618. + * SA_RESTART flag to get restarting signals (which were the default long ago)
  9619. + * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
  9620. + * SA_RESETHAND clears the handler when the signal is delivered.
  9621. + * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
  9622. + * SA_NODEFER prevents the current signal from being masked in the handler.
  9623. + *
  9624. + * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
  9625. + * Unix names RESETHAND and NODEFER respectively.
  9626. + */
  9627. +#define SA_NOCLDSTOP 0x00000001
  9628. +#define SA_NOCLDWAIT 0x00000002
  9629. +#define SA_SIGINFO 0x00000004
  9630. +#define SA_ONSTACK 0x08000000
  9631. +#define SA_RESTART 0x10000000
  9632. +#define SA_NODEFER 0x40000000
  9633. +#define SA_RESETHAND 0x80000000
  9634. +
  9635. +#define SA_NOMASK SA_NODEFER
  9636. +#define SA_ONESHOT SA_RESETHAND
  9637. +
  9638. +/*
  9639. + * sigaltstack controls
  9640. + */
  9641. +#define SS_ONSTACK 1
  9642. +#define SS_DISABLE 2
  9643. +
  9644. +#define MINSIGSTKSZ 2048
  9645. +#define SIGSTKSZ 8192
  9646. +
  9647. +#include <asm-generic/signal.h>
  9648. +
  9649. +#ifdef __KERNEL__
  9650. +struct old_sigaction {
  9651. + __sighandler_t sa_handler;
  9652. + old_sigset_t sa_mask;
  9653. + unsigned long sa_flags;
  9654. + void (*sa_restorer)(void);
  9655. +};
  9656. +
  9657. +struct sigaction {
  9658. + __sighandler_t sa_handler;
  9659. + unsigned long sa_flags;
  9660. + void (*sa_restorer)(void);
  9661. + sigset_t sa_mask; /* mask last for extensibility */
  9662. +};
  9663. +
  9664. +struct k_sigaction {
  9665. + struct sigaction sa;
  9666. +};
  9667. +#else
  9668. +/* Here we must cater to libcs that poke about in kernel headers. */
  9669. +
  9670. +struct sigaction {
  9671. + union {
  9672. + __sighandler_t _sa_handler;
  9673. + void (*_sa_sigaction)(int, struct siginfo *, void *);
  9674. + } _u;
  9675. + sigset_t sa_mask;
  9676. + unsigned long sa_flags;
  9677. + void (*sa_restorer)(void);
  9678. +};
  9679. +
  9680. +#define sa_handler _u._sa_handler
  9681. +#define sa_sigaction _u._sa_sigaction
  9682. +
  9683. +#endif /* __KERNEL__ */
  9684. +
  9685. +typedef struct sigaltstack {
  9686. + void *ss_sp;
  9687. + int ss_flags;
  9688. + size_t ss_size;
  9689. +} stack_t;
  9690. +
  9691. +#ifdef __KERNEL__
  9692. +
  9693. +#include <asm/sigcontext.h>
  9694. +#undef __HAVE_ARCH_SIG_BITOPS
  9695. +
  9696. +#define ptrace_signal_deliver(regs, cookie) do { } while (0)
  9697. +
  9698. +#endif /* __KERNEL__ */
  9699. +
  9700. +#endif /* _ASM_UBICOM32_SIGNAL_H */
  9701. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/smp.h linux-2.6.28.10/arch/ubicom32/include/asm/smp.h
  9702. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/smp.h 1970-01-01 02:00:00.000000000 +0200
  9703. +++ linux-2.6.28.10/arch/ubicom32/include/asm/smp.h 2009-08-06 10:31:02.000000000 +0300
  9704. @@ -0,0 +1,83 @@
  9705. +/*
  9706. + * arch/ubicom32/include/asm/smp.h
  9707. + * SMP definitions for Ubicom32 architecture.
  9708. + *
  9709. + * (C) Copyright 2009, Ubicom, Inc.
  9710. + *
  9711. + * This file is part of the Ubicom32 Linux Kernel Port.
  9712. + *
  9713. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  9714. + * it and/or modify it under the terms of the GNU General Public License
  9715. + * as published by the Free Software Foundation, either version 2 of the
  9716. + * License, or (at your option) any later version.
  9717. + *
  9718. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  9719. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  9720. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  9721. + * the GNU General Public License for more details.
  9722. + *
  9723. + * You should have received a copy of the GNU General Public License
  9724. + * along with the Ubicom32 Linux Kernel Port. If not,
  9725. + * see <http://www.gnu.org/licenses/>.
  9726. + *
  9727. + * Ubicom32 implementation derived from (with many thanks):
  9728. + * arch/m68knommu
  9729. + * arch/blackfin
  9730. + * arch/parisc
  9731. + */
  9732. +#ifndef _ASM_UBICOM32_SMP_H
  9733. +#define _ASM_UBICOM32_SMP_H
  9734. +
  9735. +#ifndef ASSEMBLY
  9736. +#include <linux/bitops.h>
  9737. +#include <linux/threads.h>
  9738. +#include <linux/cpumask.h>
  9739. +#include <asm/ip5000.h>
  9740. +
  9741. +typedef unsigned long address_t;
  9742. +extern cpumask_t cpu_online_map;
  9743. +extern unsigned int smp_ipi_irq;
  9744. +
  9745. +/*
  9746. + * This magic constant controls our willingness to transfer
  9747. + * a process across CPUs.
  9748. + *
  9749. + * Such a transfer incurs cache and tlb
  9750. + * misses. The current value is inherited from i386. Still needs
  9751. + * to be tuned for parisc.
  9752. + */
  9753. +#define PROC_CHANGE_PENALTY 15 /* Schedule penalty */
  9754. +#define NO_PROC_ID 0xFF /* No processor magic marker */
  9755. +#define ANY_PROC_ID 0xFF /* Any processor magic marker */
  9756. +
  9757. +#ifdef CONFIG_SMP
  9758. +#define raw_smp_processor_id() (current_thread_info()->cpu)
  9759. +#endif /* CONFIG_SMP */
  9760. +
  9761. +static inline int __cpu_disable (void)
  9762. +{
  9763. + return 0;
  9764. +}
  9765. +
  9766. +static inline void __cpu_die (unsigned int cpu)
  9767. +{
  9768. + while(1) {
  9769. + };
  9770. +}
  9771. +
  9772. +extern int __cpu_up(unsigned int cpu);
  9773. +extern void smp_send_timer_all(void);
  9774. +extern void smp_timer_broadcast(cpumask_t mask);
  9775. +extern void smp_set_affinity(unsigned int irq, cpumask_t dest);
  9776. +extern void arch_send_call_function_single_ipi(int cpu);
  9777. +extern void arch_send_call_function_ipi(cpumask_t mask);
  9778. +
  9779. +/*
  9780. + * TODO: Once these are fully tested, we should turn them into
  9781. + * inline macros for performance.
  9782. + */
  9783. +extern unsigned long smp_get_affinity(unsigned int irq, int *all);
  9784. +extern void smp_reset_ipi(unsigned long mask);
  9785. +
  9786. +#endif /* !ASSEMBLY */
  9787. +#endif /* _ASM_UBICOM32_SMP_H */
  9788. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/socket.h linux-2.6.28.10/arch/ubicom32/include/asm/socket.h
  9789. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/socket.h 1970-01-01 02:00:00.000000000 +0200
  9790. +++ linux-2.6.28.10/arch/ubicom32/include/asm/socket.h 2009-08-06 10:31:02.000000000 +0300
  9791. @@ -0,0 +1,84 @@
  9792. +/*
  9793. + * arch/ubicom32/include/asm/socket.h
  9794. + * Socket options definitions for Ubicom32 architecture.
  9795. + *
  9796. + * (C) Copyright 2009, Ubicom, Inc.
  9797. + *
  9798. + * This file is part of the Ubicom32 Linux Kernel Port.
  9799. + *
  9800. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  9801. + * it and/or modify it under the terms of the GNU General Public License
  9802. + * as published by the Free Software Foundation, either version 2 of the
  9803. + * License, or (at your option) any later version.
  9804. + *
  9805. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  9806. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  9807. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  9808. + * the GNU General Public License for more details.
  9809. + *
  9810. + * You should have received a copy of the GNU General Public License
  9811. + * along with the Ubicom32 Linux Kernel Port. If not,
  9812. + * see <http://www.gnu.org/licenses/>.
  9813. + *
  9814. + * Ubicom32 implementation derived from (with many thanks):
  9815. + * arch/m68knommu
  9816. + * arch/blackfin
  9817. + * arch/parisc
  9818. + */
  9819. +#ifndef _ASM_UBICOM32_SOCKET_H
  9820. +#define _ASM_UBICOM32_SOCKET_H
  9821. +
  9822. +#include <asm/sockios.h>
  9823. +
  9824. +/* For setsockopt(2) */
  9825. +#define SOL_SOCKET 1
  9826. +
  9827. +#define SO_DEBUG 1
  9828. +#define SO_REUSEADDR 2
  9829. +#define SO_TYPE 3
  9830. +#define SO_ERROR 4
  9831. +#define SO_DONTROUTE 5
  9832. +#define SO_BROADCAST 6
  9833. +#define SO_SNDBUF 7
  9834. +#define SO_RCVBUF 8
  9835. +#define SO_SNDBUFFORCE 32
  9836. +#define SO_RCVBUFFORCE 33
  9837. +#define SO_KEEPALIVE 9
  9838. +#define SO_OOBINLINE 10
  9839. +#define SO_NO_CHECK 11
  9840. +#define SO_PRIORITY 12
  9841. +#define SO_LINGER 13
  9842. +#define SO_BSDCOMPAT 14
  9843. +/* To add :#define SO_REUSEPORT 15 */
  9844. +#define SO_PASSCRED 16
  9845. +#define SO_PEERCRED 17
  9846. +#define SO_RCVLOWAT 18
  9847. +#define SO_SNDLOWAT 19
  9848. +#define SO_RCVTIMEO 20
  9849. +#define SO_SNDTIMEO 21
  9850. +
  9851. +/* Security levels - as per NRL IPv6 - don't actually do anything */
  9852. +#define SO_SECURITY_AUTHENTICATION 22
  9853. +#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
  9854. +#define SO_SECURITY_ENCRYPTION_NETWORK 24
  9855. +
  9856. +#define SO_BINDTODEVICE 25
  9857. +
  9858. +/* Socket filtering */
  9859. +#define SO_ATTACH_FILTER 26
  9860. +#define SO_DETACH_FILTER 27
  9861. +
  9862. +#define SO_PEERNAME 28
  9863. +#define SO_TIMESTAMP 29
  9864. +#define SCM_TIMESTAMP SO_TIMESTAMP
  9865. +
  9866. +#define SO_ACCEPTCONN 30
  9867. +
  9868. +#define SO_PEERSEC 31
  9869. +#define SO_PASSSEC 34
  9870. +#define SO_TIMESTAMPNS 35
  9871. +#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
  9872. +
  9873. +#define SO_MARK 36
  9874. +
  9875. +#endif /* _ASM_UBICOM32_SOCKET_H */
  9876. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/sockios.h linux-2.6.28.10/arch/ubicom32/include/asm/sockios.h
  9877. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/sockios.h 1970-01-01 02:00:00.000000000 +0200
  9878. +++ linux-2.6.28.10/arch/ubicom32/include/asm/sockios.h 2009-08-06 10:31:02.000000000 +0300
  9879. @@ -0,0 +1,40 @@
  9880. +/*
  9881. + * arch/ubicom32/include/asm/sockios.h
  9882. + * Socket-level ioctl definitions for Ubicom32 architecture.
  9883. + *
  9884. + * (C) Copyright 2009, Ubicom, Inc.
  9885. + *
  9886. + * This file is part of the Ubicom32 Linux Kernel Port.
  9887. + *
  9888. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  9889. + * it and/or modify it under the terms of the GNU General Public License
  9890. + * as published by the Free Software Foundation, either version 2 of the
  9891. + * License, or (at your option) any later version.
  9892. + *
  9893. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  9894. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  9895. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  9896. + * the GNU General Public License for more details.
  9897. + *
  9898. + * You should have received a copy of the GNU General Public License
  9899. + * along with the Ubicom32 Linux Kernel Port. If not,
  9900. + * see <http://www.gnu.org/licenses/>.
  9901. + *
  9902. + * Ubicom32 implementation derived from (with many thanks):
  9903. + * arch/m68knommu
  9904. + * arch/blackfin
  9905. + * arch/parisc
  9906. + */
  9907. +#ifndef _ASM_UBICOM32_SOCKIOS_H
  9908. +#define _ASM_UBICOM32_SOCKIOS_H
  9909. +
  9910. +/* Socket-level I/O control calls. */
  9911. +#define FIOSETOWN 0x8901
  9912. +#define SIOCSPGRP 0x8902
  9913. +#define FIOGETOWN 0x8903
  9914. +#define SIOCGPGRP 0x8904
  9915. +#define SIOCATMARK 0x8905
  9916. +#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
  9917. +#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
  9918. +
  9919. +#endif /* _ASM_UBICOM32_SOCKIOS_H */
  9920. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/spinlock.h linux-2.6.28.10/arch/ubicom32/include/asm/spinlock.h
  9921. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/spinlock.h 1970-01-01 02:00:00.000000000 +0200
  9922. +++ linux-2.6.28.10/arch/ubicom32/include/asm/spinlock.h 2009-08-06 10:31:02.000000000 +0300
  9923. @@ -0,0 +1,293 @@
  9924. +/*
  9925. + * arch/ubicom32/include/asm/spinlock.h
  9926. + * Spinlock related definitions for Ubicom32 architecture.
  9927. + *
  9928. + * (C) Copyright 2009, Ubicom, Inc.
  9929. + *
  9930. + * This file is part of the Ubicom32 Linux Kernel Port.
  9931. + *
  9932. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  9933. + * it and/or modify it under the terms of the GNU General Public License
  9934. + * as published by the Free Software Foundation, either version 2 of the
  9935. + * License, or (at your option) any later version.
  9936. + *
  9937. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  9938. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  9939. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  9940. + * the GNU General Public License for more details.
  9941. + *
  9942. + * You should have received a copy of the GNU General Public License
  9943. + * along with the Ubicom32 Linux Kernel Port. If not,
  9944. + * see <http://www.gnu.org/licenses/>.
  9945. + *
  9946. + * Ubicom32 implementation derived from (with many thanks):
  9947. + * arch/m68knommu
  9948. + * arch/blackfin
  9949. + * arch/parisc
  9950. + */
  9951. +#ifndef _ASM_UBICOM32_SPINLOCK_H
  9952. +#define _ASM_UBICOM32_SPINLOCK_H
  9953. +
  9954. +#include <asm/system.h>
  9955. +#include <asm/processor.h>
  9956. +#include <asm/spinlock_types.h>
  9957. +
  9958. +/*
  9959. + * __raw_spin_lock()
  9960. + * Lock the lock.
  9961. + */
  9962. +static inline void __raw_spin_lock(raw_spinlock_t *x)
  9963. +{
  9964. + asm volatile (
  9965. + "1: bset %0, %0, #0 \n\t"
  9966. + " jmpne.f 1b \n\t"
  9967. + : "+U4" (x->lock)
  9968. + :
  9969. + : "memory", "cc"
  9970. + );
  9971. +}
  9972. +
  9973. +/*
  9974. + * __raw_spin_unlock()
  9975. + * Unlock the lock.
  9976. + */
  9977. +static inline void __raw_spin_unlock(raw_spinlock_t *x)
  9978. +{
  9979. + asm volatile (
  9980. + " bclr %0, %0, #0 \n\t"
  9981. + : "+U4" (x->lock)
  9982. + :
  9983. + : "memory", "cc"
  9984. + );
  9985. +}
  9986. +
  9987. +/*
  9988. + * __raw_spin_is_locked()
  9989. + * Test if the lock is locked.
  9990. + */
  9991. +static inline int __raw_spin_is_locked(raw_spinlock_t *x)
  9992. +{
  9993. + return x->lock;
  9994. +}
  9995. +
  9996. +/*
  9997. + * __raw_spin_unlock_wait()
  9998. + * Wait for the lock to be unlocked.
  9999. + *
  10000. + * Note: the caller has not guarantee that the lock will not
  10001. + * be acquired before they get to it.
  10002. + */
  10003. +static inline void __raw_spin_unlock_wait(raw_spinlock_t *x)
  10004. +{
  10005. + do {
  10006. + cpu_relax();
  10007. + } while (__raw_spin_is_locked(x));
  10008. +}
  10009. +
  10010. +/*
  10011. + * __raw_spin_trylock()
  10012. + * Try the lock, return 0 on failure, 1 on success.
  10013. + */
  10014. +static inline int __raw_spin_trylock(raw_spinlock_t *x)
  10015. +{
  10016. + int ret = 0;
  10017. +
  10018. + asm volatile (
  10019. + " bset %1, %1, #0 \n\t"
  10020. + " jmpne.f 1f \n\t"
  10021. + " move.4 %0, #1 \n\t"
  10022. + "1: \n\t"
  10023. + : "+r" (ret), "+U4" (x->lock)
  10024. + :
  10025. + : "memory", "cc"
  10026. + );
  10027. +
  10028. + return ret;
  10029. +}
  10030. +
  10031. +/*
  10032. + * __raw_spin_lock_flags()
  10033. + * Spin waiting for the lock (enabling IRQ(s))
  10034. + */
  10035. +static inline void __raw_spin_lock_flags(raw_spinlock_t *x, unsigned long flags)
  10036. +{
  10037. + mb();
  10038. + while (!__raw_spin_trylock(x)) {
  10039. + /*
  10040. + * If the flags from the IRQ are set, interrupts are disabled and we
  10041. + * need to re-enable them.
  10042. + */
  10043. + if (!flags) {
  10044. + cpu_relax();
  10045. + } else {
  10046. + raw_local_irq_enable();
  10047. + cpu_relax();
  10048. + raw_local_irq_disable();
  10049. + }
  10050. + }
  10051. + mb();
  10052. +}
  10053. +
  10054. +/*
  10055. + * Read-write spinlocks, allowing multiple readers but only one writer.
  10056. + * Linux rwlocks are unfair to writers; they can be starved for an indefinite
  10057. + * time by readers. With care, they can also be taken in interrupt context.
  10058. + *
  10059. + * In Ubicom32 architecture implementation, we have a spinlock and a counter.
  10060. + * Readers use the lock to serialise their access to the counter (which
  10061. + * records how many readers currently hold the lock).
  10062. + * Writers hold the spinlock, preventing any readers or other writers from
  10063. + * grabbing the rwlock.
  10064. + */
  10065. +
  10066. +/*
  10067. + * __raw_read_lock()
  10068. + * Increment the counter in the rwlock.
  10069. + *
  10070. + * Note that we have to ensure interrupts are disabled in case we're
  10071. + * interrupted by some other code that wants to grab the same read lock
  10072. + */
  10073. +static inline void __raw_read_lock(raw_rwlock_t *rw)
  10074. +{
  10075. + unsigned long flags;
  10076. + raw_local_irq_save(flags);
  10077. + __raw_spin_lock_flags(&rw->lock, flags);
  10078. + rw->counter++;
  10079. + __raw_spin_unlock(&rw->lock);
  10080. + raw_local_irq_restore(flags);
  10081. +}
  10082. +
  10083. +/*
  10084. + * __raw_read_unlock()
  10085. + * Decrement the counter.
  10086. + *
  10087. + * Note that we have to ensure interrupts are disabled in case we're
  10088. + * interrupted by some other code that wants to grab the same read lock
  10089. + */
  10090. +static inline void __raw_read_unlock(raw_rwlock_t *rw)
  10091. +{
  10092. + unsigned long flags;
  10093. + raw_local_irq_save(flags);
  10094. + __raw_spin_lock_flags(&rw->lock, flags);
  10095. + rw->counter--;
  10096. + __raw_spin_unlock(&rw->lock);
  10097. + raw_local_irq_restore(flags);
  10098. +}
  10099. +
  10100. +/*
  10101. + * __raw_read_trylock()
  10102. + * Increment the counter if we can.
  10103. + *
  10104. + * Note that we have to ensure interrupts are disabled in case we're
  10105. + * interrupted by some other code that wants to grab the same read lock
  10106. + */
  10107. +static inline int __raw_read_trylock(raw_rwlock_t *rw)
  10108. +{
  10109. + unsigned long flags;
  10110. + retry:
  10111. + raw_local_irq_save(flags);
  10112. + if (__raw_spin_trylock(&rw->lock)) {
  10113. + rw->counter++;
  10114. + __raw_spin_unlock(&rw->lock);
  10115. + raw_local_irq_restore(flags);
  10116. + return 1;
  10117. + }
  10118. +
  10119. + raw_local_irq_restore(flags);
  10120. +
  10121. + /*
  10122. + * If write-locked, we fail to acquire the lock
  10123. + */
  10124. + if (rw->counter < 0) {
  10125. + return 0;
  10126. + }
  10127. +
  10128. + /*
  10129. + * Wait until we have a realistic chance at the lock
  10130. + */
  10131. + while (__raw_spin_is_locked(&rw->lock) && rw->counter >= 0) {
  10132. + cpu_relax();
  10133. + }
  10134. +
  10135. + goto retry;
  10136. +}
  10137. +
  10138. +/*
  10139. + * __raw_write_lock()
  10140. + *
  10141. + * Note that we have to ensure interrupts are disabled in case we're
  10142. + * interrupted by some other code that wants to read_trylock() this lock
  10143. + */
  10144. +static inline void __raw_write_lock(raw_rwlock_t *rw)
  10145. +{
  10146. + unsigned long flags;
  10147. +retry:
  10148. + raw_local_irq_save(flags);
  10149. + __raw_spin_lock_flags(&rw->lock, flags);
  10150. +
  10151. + if (rw->counter != 0) {
  10152. + __raw_spin_unlock(&rw->lock);
  10153. + raw_local_irq_restore(flags);
  10154. +
  10155. + while (rw->counter != 0)
  10156. + cpu_relax();
  10157. +
  10158. + goto retry;
  10159. + }
  10160. +
  10161. + rw->counter = -1; /* mark as write-locked */
  10162. + mb();
  10163. + raw_local_irq_restore(flags);
  10164. +}
  10165. +
  10166. +static inline void __raw_write_unlock(raw_rwlock_t *rw)
  10167. +{
  10168. + rw->counter = 0;
  10169. + __raw_spin_unlock(&rw->lock);
  10170. +}
  10171. +
  10172. +/* Note that we have to ensure interrupts are disabled in case we're
  10173. + * interrupted by some other code that wants to read_trylock() this lock */
  10174. +static inline int __raw_write_trylock(raw_rwlock_t *rw)
  10175. +{
  10176. + unsigned long flags;
  10177. + int result = 0;
  10178. +
  10179. + raw_local_irq_save(flags);
  10180. + if (__raw_spin_trylock(&rw->lock)) {
  10181. + if (rw->counter == 0) {
  10182. + rw->counter = -1;
  10183. + result = 1;
  10184. + } else {
  10185. + /* Read-locked. Oh well. */
  10186. + __raw_spin_unlock(&rw->lock);
  10187. + }
  10188. + }
  10189. + raw_local_irq_restore(flags);
  10190. +
  10191. + return result;
  10192. +}
  10193. +
  10194. +/*
  10195. + * read_can_lock - would read_trylock() succeed?
  10196. + * @lock: the rwlock in question.
  10197. + */
  10198. +static inline int __raw_read_can_lock(raw_rwlock_t *rw)
  10199. +{
  10200. + return rw->counter >= 0;
  10201. +}
  10202. +
  10203. +/*
  10204. + * write_can_lock - would write_trylock() succeed?
  10205. + * @lock: the rwlock in question.
  10206. + */
  10207. +static inline int __raw_write_can_lock(raw_rwlock_t *rw)
  10208. +{
  10209. + return !rw->counter;
  10210. +}
  10211. +
  10212. +#define _raw_spin_relax(lock) cpu_relax()
  10213. +#define _raw_read_relax(lock) cpu_relax()
  10214. +#define _raw_write_relax(lock) cpu_relax()
  10215. +
  10216. +#endif /* _ASM_UBICOM32_SPINLOCK_H */
  10217. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/spinlock_types.h linux-2.6.28.10/arch/ubicom32/include/asm/spinlock_types.h
  10218. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/spinlock_types.h 1970-01-01 02:00:00.000000000 +0200
  10219. +++ linux-2.6.28.10/arch/ubicom32/include/asm/spinlock_types.h 2009-08-06 10:31:02.000000000 +0300
  10220. @@ -0,0 +1,43 @@
  10221. +/*
  10222. + * arch/ubicom32/include/asm/spinlock_types.h
  10223. + * Spinlock related structure definitions for Ubicom32 architecture.
  10224. + *
  10225. + * (C) Copyright 2009, Ubicom, Inc.
  10226. + *
  10227. + * This file is part of the Ubicom32 Linux Kernel Port.
  10228. + *
  10229. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  10230. + * it and/or modify it under the terms of the GNU General Public License
  10231. + * as published by the Free Software Foundation, either version 2 of the
  10232. + * License, or (at your option) any later version.
  10233. + *
  10234. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  10235. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  10236. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  10237. + * the GNU General Public License for more details.
  10238. + *
  10239. + * You should have received a copy of the GNU General Public License
  10240. + * along with the Ubicom32 Linux Kernel Port. If not,
  10241. + * see <http://www.gnu.org/licenses/>.
  10242. + *
  10243. + * Ubicom32 implementation derived from (with many thanks):
  10244. + * arch/m68knommu
  10245. + * arch/blackfin
  10246. + * arch/parisc
  10247. + */
  10248. +#ifndef _ASM_UBICOM32_SPINLOCK_TYPES_H
  10249. +#define _ASM_UBICOM32_SPINLOCK_TYPES_H
  10250. +
  10251. +typedef struct {
  10252. + volatile unsigned int lock;
  10253. +} raw_spinlock_t;
  10254. +
  10255. +typedef struct {
  10256. + raw_spinlock_t lock;
  10257. + volatile int counter;
  10258. +} raw_rwlock_t;
  10259. +
  10260. +#define __RAW_SPIN_LOCK_UNLOCKED { 0 }
  10261. +#define __RAW_RW_LOCK_UNLOCKED { __RAW_SPIN_LOCK_UNLOCKED, 0 }
  10262. +
  10263. +#endif /* _ASM_UBICOM32_SPINLOCK_TYPES_H */
  10264. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/stacktrace.h linux-2.6.28.10/arch/ubicom32/include/asm/stacktrace.h
  10265. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/stacktrace.h 1970-01-01 02:00:00.000000000 +0200
  10266. +++ linux-2.6.28.10/arch/ubicom32/include/asm/stacktrace.h 2009-08-06 10:31:02.000000000 +0300
  10267. @@ -0,0 +1,72 @@
  10268. +/*
  10269. + * arch/ubicom32/include/asm/stacktrace.h
  10270. + * Stacktrace functions for the Ubicom32 architecture.
  10271. + *
  10272. + * (C) Copyright 2009, Ubicom, Inc.
  10273. + *
  10274. + * This file is part of the Ubicom32 Linux Kernel Port.
  10275. + *
  10276. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  10277. + * it and/or modify it under the terms of the GNU General Public License
  10278. + * as published by the Free Software Foundation, either version 2 of the
  10279. + * License, or (at your option) any later version.
  10280. + *
  10281. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  10282. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  10283. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  10284. + * the GNU General Public License for more details.
  10285. + *
  10286. + * You should have received a copy of the GNU General Public License
  10287. + * along with the Ubicom32 Linux Kernel Port. If not,
  10288. + * see <http://www.gnu.org/licenses/>.
  10289. + *
  10290. + * Ubicom32 implementation derived from (with many thanks):
  10291. + * arch/m68knommu
  10292. + * arch/blackfin
  10293. + * arch/parisc
  10294. + */
  10295. +#ifndef _ASM_UBICOM32_STACKTRACE_H
  10296. +#define _ASM_UBICOM32_STACKTRACE_H
  10297. +
  10298. +#define between(a, b, c) (( \
  10299. + ((unsigned long) a) >= ((unsigned long) b)) && \
  10300. + (((unsigned long)a) <= ((unsigned long)c)))
  10301. +
  10302. +/*
  10303. + * These symbols are filled in by the linker.
  10304. + */
  10305. +extern unsigned long _stext;
  10306. +extern unsigned long _etext;
  10307. +
  10308. +/* OCM text goes from __ocm_text_run_begin to __data_begin */
  10309. +extern unsigned long __ocm_text_run_begin;
  10310. +extern unsigned long __data_begin;
  10311. +
  10312. +/* Account for OCM case - see stacktrace.c maybe combine(also trap.c) */
  10313. +/*
  10314. + * ubicom32_is_kernel()
  10315. + *
  10316. + * Check to see if the given address belongs to the kernel.
  10317. + * NOMMU does not permit any other means.
  10318. + */
  10319. +static inline int ubicom32_is_kernel(unsigned long addr)
  10320. +{
  10321. + int is_kernel = between(addr, &_stext, &_etext) || \
  10322. + between(addr, &__ocm_text_run_begin, &__data_begin);
  10323. +
  10324. +#ifdef CONFIG_MODULES
  10325. + if (!is_kernel)
  10326. + is_kernel = is_module_address(addr);
  10327. +#endif
  10328. + return is_kernel;
  10329. +}
  10330. +
  10331. +extern unsigned long stacktrace_iterate(
  10332. + unsigned long **trace,
  10333. + unsigned long stext, unsigned long etext,
  10334. + unsigned long ocm_stext, unsigned long ocm_etext,
  10335. + unsigned long sstack, unsigned long estack);
  10336. +#ifdef CONFIG_STACKTRACE
  10337. +void stacktrace_save_entries(struct task_struct *tsk, struct stack_trace *trace, unsigned long sp);
  10338. +#endif
  10339. +#endif /* _ASM_UBICOM32_STACKTRACE_H */
  10340. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/statfs.h linux-2.6.28.10/arch/ubicom32/include/asm/statfs.h
  10341. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/statfs.h 1970-01-01 02:00:00.000000000 +0200
  10342. +++ linux-2.6.28.10/arch/ubicom32/include/asm/statfs.h 2009-08-06 10:31:02.000000000 +0300
  10343. @@ -0,0 +1,33 @@
  10344. +/*
  10345. + * arch/ubicom32/include/asm/statfs.h
  10346. + * Generic statfs.h definitions
  10347. + *
  10348. + * (C) Copyright 2009, Ubicom, Inc.
  10349. + *
  10350. + * This file is part of the Ubicom32 Linux Kernel Port.
  10351. + *
  10352. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  10353. + * it and/or modify it under the terms of the GNU General Public License
  10354. + * as published by the Free Software Foundation, either version 2 of the
  10355. + * License, or (at your option) any later version.
  10356. + *
  10357. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  10358. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  10359. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  10360. + * the GNU General Public License for more details.
  10361. + *
  10362. + * You should have received a copy of the GNU General Public License
  10363. + * along with the Ubicom32 Linux Kernel Port. If not,
  10364. + * see <http://www.gnu.org/licenses/>.
  10365. + *
  10366. + * Ubicom32 implementation derived from (with many thanks):
  10367. + * arch/m68knommu
  10368. + * arch/blackfin
  10369. + * arch/parisc
  10370. + */
  10371. +#ifndef _ASM_UBICOM32_STATFS_H
  10372. +#define _ASM_UBICOM32_STATFS_H
  10373. +
  10374. +#include <asm-generic/statfs.h>
  10375. +
  10376. +#endif /* _ASM_UBICOM32_STATFS_H */
  10377. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/stat.h linux-2.6.28.10/arch/ubicom32/include/asm/stat.h
  10378. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/stat.h 1970-01-01 02:00:00.000000000 +0200
  10379. +++ linux-2.6.28.10/arch/ubicom32/include/asm/stat.h 2009-08-06 10:31:02.000000000 +0300
  10380. @@ -0,0 +1,104 @@
  10381. +/*
  10382. + * arch/ubicom32/include/asm/stat.h
  10383. + * File status definitions for Ubicom32 architecture.
  10384. + *
  10385. + * (C) Copyright 2009, Ubicom, Inc.
  10386. + *
  10387. + * This file is part of the Ubicom32 Linux Kernel Port.
  10388. + *
  10389. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  10390. + * it and/or modify it under the terms of the GNU General Public License
  10391. + * as published by the Free Software Foundation, either version 2 of the
  10392. + * License, or (at your option) any later version.
  10393. + *
  10394. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  10395. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  10396. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  10397. + * the GNU General Public License for more details.
  10398. + *
  10399. + * You should have received a copy of the GNU General Public License
  10400. + * along with the Ubicom32 Linux Kernel Port. If not,
  10401. + * see <http://www.gnu.org/licenses/>.
  10402. + *
  10403. + * Ubicom32 implementation derived from (with many thanks):
  10404. + * arch/m68knommu
  10405. + * arch/blackfin
  10406. + * arch/parisc
  10407. + */
  10408. +#ifndef _ASM_UBICOM32_STAT_H
  10409. +#define _ASM_UBICOM32_STAT_H
  10410. +
  10411. +struct __old_kernel_stat {
  10412. + unsigned short st_dev;
  10413. + unsigned short st_ino;
  10414. + unsigned short st_mode;
  10415. + unsigned short st_nlink;
  10416. + unsigned short st_uid;
  10417. + unsigned short st_gid;
  10418. + unsigned short st_rdev;
  10419. + unsigned long st_size;
  10420. + unsigned long st_atime;
  10421. + unsigned long st_mtime;
  10422. + unsigned long st_ctime;
  10423. +};
  10424. +
  10425. +struct stat {
  10426. + unsigned short st_dev;
  10427. + unsigned short __pad1;
  10428. + unsigned long st_ino;
  10429. + unsigned short st_mode;
  10430. + unsigned short st_nlink;
  10431. + unsigned short st_uid;
  10432. + unsigned short st_gid;
  10433. + unsigned short st_rdev;
  10434. + unsigned short __pad2;
  10435. + unsigned long st_size;
  10436. + unsigned long st_blksize;
  10437. + unsigned long st_blocks;
  10438. + unsigned long st_atime;
  10439. + unsigned long __unused1;
  10440. + unsigned long st_mtime;
  10441. + unsigned long __unused2;
  10442. + unsigned long st_ctime;
  10443. + unsigned long __unused3;
  10444. + unsigned long __unused4;
  10445. + unsigned long __unused5;
  10446. +};
  10447. +
  10448. +/* This matches struct stat64 in glibc2.1, hence the absolutely
  10449. + * insane amounts of padding around dev_t's.
  10450. + */
  10451. +struct stat64 {
  10452. + unsigned long long st_dev;
  10453. + unsigned char __pad1[2];
  10454. +
  10455. +#define STAT64_HAS_BROKEN_ST_INO 1
  10456. + unsigned long __st_ino;
  10457. +
  10458. + unsigned int st_mode;
  10459. + unsigned int st_nlink;
  10460. +
  10461. + unsigned long st_uid;
  10462. + unsigned long st_gid;
  10463. +
  10464. + unsigned long long st_rdev;
  10465. + unsigned char __pad3[2];
  10466. +
  10467. + long long st_size;
  10468. + unsigned long st_blksize;
  10469. +
  10470. + unsigned long long st_blocks; /* Number 512-byte blocks allocated. */
  10471. +
  10472. + unsigned long st_atime;
  10473. + unsigned long st_atime_nsec;
  10474. +
  10475. + unsigned long st_mtime;
  10476. + unsigned long st_mtime_nsec;
  10477. +
  10478. + unsigned long st_ctime;
  10479. + unsigned long st_ctime_nsec;
  10480. +
  10481. + unsigned long long st_ino;
  10482. +};
  10483. +
  10484. +#endif /* _ASM_UBICOM32_STAT_H */
  10485. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/string.h linux-2.6.28.10/arch/ubicom32/include/asm/string.h
  10486. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/string.h 1970-01-01 02:00:00.000000000 +0200
  10487. +++ linux-2.6.28.10/arch/ubicom32/include/asm/string.h 2009-08-06 10:31:02.000000000 +0300
  10488. @@ -0,0 +1,37 @@
  10489. +/*
  10490. + * arch/ubicom32/include/asm/string.h
  10491. + * String operation definitions for Ubicom32 architecture.
  10492. + *
  10493. + * (C) Copyright 2009, Ubicom, Inc.
  10494. + *
  10495. + * This file is part of the Ubicom32 Linux Kernel Port.
  10496. + *
  10497. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  10498. + * it and/or modify it under the terms of the GNU General Public License
  10499. + * as published by the Free Software Foundation, either version 2 of the
  10500. + * License, or (at your option) any later version.
  10501. + *
  10502. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  10503. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  10504. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  10505. + * the GNU General Public License for more details.
  10506. + *
  10507. + * You should have received a copy of the GNU General Public License
  10508. + * along with the Ubicom32 Linux Kernel Port. If not,
  10509. + * see <http://www.gnu.org/licenses/>.
  10510. + *
  10511. + * Ubicom32 implementation derived from (with many thanks):
  10512. + * arch/m68knommu
  10513. + * arch/blackfin
  10514. + * arch/parisc
  10515. + */
  10516. +#ifndef _ASM_UBICOM32_STRING_H
  10517. +#define _ASM_UBICOM32_STRING_H
  10518. +
  10519. +#define __HAVE_ARCH_MEMSET
  10520. +extern void *memset(void *b, int c, size_t len);
  10521. +
  10522. +#define __HAVE_ARCH_MEMCPY
  10523. +extern void *memcpy(void *to, const void *from, size_t len);
  10524. +
  10525. +#endif /* _ASM_UBICOM32_STRING_H */
  10526. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/system.h linux-2.6.28.10/arch/ubicom32/include/asm/system.h
  10527. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/system.h 1970-01-01 02:00:00.000000000 +0200
  10528. +++ linux-2.6.28.10/arch/ubicom32/include/asm/system.h 2009-08-06 10:31:02.000000000 +0300
  10529. @@ -0,0 +1,101 @@
  10530. +/*
  10531. + * arch/ubicom32/include/asm/system.h
  10532. + * Low level switching definitions.
  10533. + *
  10534. + * (C) Copyright 2009, Ubicom, Inc.
  10535. + *
  10536. + * This file is part of the Ubicom32 Linux Kernel Port.
  10537. + *
  10538. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  10539. + * it and/or modify it under the terms of the GNU General Public License
  10540. + * as published by the Free Software Foundation, either version 2 of the
  10541. + * License, or (at your option) any later version.
  10542. + *
  10543. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  10544. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  10545. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  10546. + * the GNU General Public License for more details.
  10547. + *
  10548. + * You should have received a copy of the GNU General Public License
  10549. + * along with the Ubicom32 Linux Kernel Port. If not,
  10550. + * see <http://www.gnu.org/licenses/>.
  10551. + *
  10552. + * Ubicom32 implementation derived from (with many thanks):
  10553. + * arch/m68knommu
  10554. + * arch/blackfin
  10555. + * arch/parisc
  10556. + */
  10557. +#ifndef _ASM_UBICOM32_SYSTEM_H
  10558. +#define _ASM_UBICOM32_SYSTEM_H
  10559. +
  10560. +#include <linux/irqflags.h>
  10561. +#include <linux/linkage.h>
  10562. +#include <asm/segment.h>
  10563. +#include <asm/entry.h>
  10564. +#include <asm/ldsr.h>
  10565. +#include <asm/irq.h>
  10566. +#include <asm/percpu.h>
  10567. +#include <asm/ubicom32-common.h>
  10568. +#include <asm/processor.h>
  10569. +
  10570. +/*
  10571. + * switch_to(n) should switch tasks to task ptr, first checking that
  10572. + * ptr isn't the current task, in which case it does nothing.
  10573. + */
  10574. +asmlinkage void resume(void);
  10575. +extern void *__switch_to(struct task_struct *prev,
  10576. + struct thread_struct *prev_switch,
  10577. + struct thread_struct *next_switch);
  10578. +
  10579. +/*
  10580. + * We will need a per linux thread sw_ksp for the switch_to macro to
  10581. + * track the kernel stack pointer for the current thread on that linux thread.
  10582. + */
  10583. +#define switch_to(prev,next,last) \
  10584. +({ \
  10585. + void *_last; \
  10586. + _last = (void *) \
  10587. + __switch_to(prev, &prev->thread, &next->thread); \
  10588. + (last) = _last; \
  10589. +})
  10590. +
  10591. +/*
  10592. + * Force strict CPU ordering.
  10593. + * Not really required on ubicom32...
  10594. + */
  10595. +#define nop() asm volatile ("nop"::)
  10596. +#define mb() asm volatile ("" : : :"memory")
  10597. +#define rmb() asm volatile ("" : : :"memory")
  10598. +#define wmb() asm volatile ("" : : :"memory")
  10599. +#define set_mb(var, value) ({ (var) = (value); wmb(); })
  10600. +
  10601. +#ifdef CONFIG_SMP
  10602. +#define smp_mb() mb()
  10603. +#define smp_rmb() rmb()
  10604. +#define smp_wmb() wmb()
  10605. +#define smp_read_barrier_depends() read_barrier_depends()
  10606. +#else
  10607. +#define smp_mb() mb()
  10608. +#define smp_rmb() rmb()
  10609. +#define smp_wmb() wmb()
  10610. +#define smp_read_barrier_depends() do { } while(0)
  10611. +#endif
  10612. +
  10613. +#define read_barrier_depends() ((void)0)
  10614. +
  10615. +/*
  10616. + * The following defines change how the scheduler calls the switch_to()
  10617. + * macro.
  10618. + *
  10619. + * 1) The first causes the runqueue to be unlocked on entry to
  10620. + * switch_to(). Since our ctx code does not play with the runqueue
  10621. + * we do not need it unlocked.
  10622. + *
  10623. + * 2) The later turns interrupts on during a ctxsw to reduce the latency of
  10624. + * interrupts during ctx. At this point in the port, we believe that this
  10625. + * latency is not a problem since we have very little code to perform a ctxsw.
  10626. + */
  10627. +// #define __ARCH_WANT_UNLOCKED_CTXSW
  10628. +// #define __ARCH_WANT_INTERRUPTS_ON_CTXSW
  10629. +
  10630. +#endif /* _ASM_UBICOM32_SYSTEM_H */
  10631. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/termbits.h linux-2.6.28.10/arch/ubicom32/include/asm/termbits.h
  10632. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/termbits.h 1970-01-01 02:00:00.000000000 +0200
  10633. +++ linux-2.6.28.10/arch/ubicom32/include/asm/termbits.h 2009-08-06 10:31:02.000000000 +0300
  10634. @@ -0,0 +1,227 @@
  10635. +/*
  10636. + * arch/ubicom32/include/asm/termbits.h
  10637. + * Terminal/serial port definitions for Ubicom32 architecture.
  10638. + *
  10639. + * (C) Copyright 2009, Ubicom, Inc.
  10640. + *
  10641. + * This file is part of the Ubicom32 Linux Kernel Port.
  10642. + *
  10643. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  10644. + * it and/or modify it under the terms of the GNU General Public License
  10645. + * as published by the Free Software Foundation, either version 2 of the
  10646. + * License, or (at your option) any later version.
  10647. + *
  10648. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  10649. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  10650. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  10651. + * the GNU General Public License for more details.
  10652. + *
  10653. + * You should have received a copy of the GNU General Public License
  10654. + * along with the Ubicom32 Linux Kernel Port. If not,
  10655. + * see <http://www.gnu.org/licenses/>.
  10656. + *
  10657. + * Ubicom32 implementation derived from (with many thanks):
  10658. + * arch/m68knommu
  10659. + * arch/blackfin
  10660. + * arch/parisc
  10661. + */
  10662. +#ifndef _ASM_UBICOM32_TERMBITS_H
  10663. +#define _ASM_UBICOM32_TERMBITS_H
  10664. +
  10665. +#include <linux/posix_types.h>
  10666. +
  10667. +typedef unsigned char cc_t;
  10668. +typedef unsigned int speed_t;
  10669. +typedef unsigned int tcflag_t;
  10670. +
  10671. +#define NCCS 19
  10672. +struct termios {
  10673. + tcflag_t c_iflag; /* input mode flags */
  10674. + tcflag_t c_oflag; /* output mode flags */
  10675. + tcflag_t c_cflag; /* control mode flags */
  10676. + tcflag_t c_lflag; /* local mode flags */
  10677. + cc_t c_line; /* line discipline */
  10678. + cc_t c_cc[NCCS]; /* control characters */
  10679. +};
  10680. +
  10681. +struct termios2 {
  10682. + tcflag_t c_iflag; /* input mode flags */
  10683. + tcflag_t c_oflag; /* output mode flags */
  10684. + tcflag_t c_cflag; /* control mode flags */
  10685. + tcflag_t c_lflag; /* local mode flags */
  10686. + cc_t c_line; /* line discipline */
  10687. + cc_t c_cc[NCCS]; /* control characters */
  10688. + speed_t c_ispeed; /* input speed */
  10689. + speed_t c_ospeed; /* output speed */
  10690. +};
  10691. +
  10692. +struct ktermios {
  10693. + tcflag_t c_iflag; /* input mode flags */
  10694. + tcflag_t c_oflag; /* output mode flags */
  10695. + tcflag_t c_cflag; /* control mode flags */
  10696. + tcflag_t c_lflag; /* local mode flags */
  10697. + cc_t c_line; /* line discipline */
  10698. + cc_t c_cc[NCCS]; /* control characters */
  10699. + speed_t c_ispeed; /* input speed */
  10700. + speed_t c_ospeed; /* output speed */
  10701. +};
  10702. +
  10703. +/* c_cc characters */
  10704. +#define VINTR 0
  10705. +#define VQUIT 1
  10706. +#define VERASE 2
  10707. +#define VKILL 3
  10708. +#define VEOF 4
  10709. +#define VTIME 5
  10710. +#define VMIN 6
  10711. +#define VSWTC 7
  10712. +#define VSTART 8
  10713. +#define VSTOP 9
  10714. +#define VSUSP 10
  10715. +#define VEOL 11
  10716. +#define VREPRINT 12
  10717. +#define VDISCARD 13
  10718. +#define VWERASE 14
  10719. +#define VLNEXT 15
  10720. +#define VEOL2 16
  10721. +
  10722. +
  10723. +/* c_iflag bits */
  10724. +#define IGNBRK 0000001
  10725. +#define BRKINT 0000002
  10726. +#define IGNPAR 0000004
  10727. +#define PARMRK 0000010
  10728. +#define INPCK 0000020
  10729. +#define ISTRIP 0000040
  10730. +#define INLCR 0000100
  10731. +#define IGNCR 0000200
  10732. +#define ICRNL 0000400
  10733. +#define IUCLC 0001000
  10734. +#define IXON 0002000
  10735. +#define IXANY 0004000
  10736. +#define IXOFF 0010000
  10737. +#define IMAXBEL 0020000
  10738. +#define IUTF8 0040000
  10739. +
  10740. +/* c_oflag bits */
  10741. +#define OPOST 0000001
  10742. +#define OLCUC 0000002
  10743. +#define ONLCR 0000004
  10744. +#define OCRNL 0000010
  10745. +#define ONOCR 0000020
  10746. +#define ONLRET 0000040
  10747. +#define OFILL 0000100
  10748. +#define OFDEL 0000200
  10749. +#define NLDLY 0000400
  10750. +#define NL0 0000000
  10751. +#define NL1 0000400
  10752. +#define CRDLY 0003000
  10753. +#define CR0 0000000
  10754. +#define CR1 0001000
  10755. +#define CR2 0002000
  10756. +#define CR3 0003000
  10757. +#define TABDLY 0014000
  10758. +#define TAB0 0000000
  10759. +#define TAB1 0004000
  10760. +#define TAB2 0010000
  10761. +#define TAB3 0014000
  10762. +#define XTABS 0014000
  10763. +#define BSDLY 0020000
  10764. +#define BS0 0000000
  10765. +#define BS1 0020000
  10766. +#define VTDLY 0040000
  10767. +#define VT0 0000000
  10768. +#define VT1 0040000
  10769. +#define FFDLY 0100000
  10770. +#define FF0 0000000
  10771. +#define FF1 0100000
  10772. +
  10773. +/* c_cflag bit meaning */
  10774. +#define CBAUD 0010017
  10775. +#define B0 0000000 /* hang up */
  10776. +#define B50 0000001
  10777. +#define B75 0000002
  10778. +#define B110 0000003
  10779. +#define B134 0000004
  10780. +#define B150 0000005
  10781. +#define B200 0000006
  10782. +#define B300 0000007
  10783. +#define B600 0000010
  10784. +#define B1200 0000011
  10785. +#define B1800 0000012
  10786. +#define B2400 0000013
  10787. +#define B4800 0000014
  10788. +#define B9600 0000015
  10789. +#define B19200 0000016
  10790. +#define B38400 0000017
  10791. +#define EXTA B19200
  10792. +#define EXTB B38400
  10793. +#define CSIZE 0000060
  10794. +#define CS5 0000000
  10795. +#define CS6 0000020
  10796. +#define CS7 0000040
  10797. +#define CS8 0000060
  10798. +#define CSTOPB 0000100
  10799. +#define CREAD 0000200
  10800. +#define PARENB 0000400
  10801. +#define PARODD 0001000
  10802. +#define HUPCL 0002000
  10803. +#define CLOCAL 0004000
  10804. +#define CBAUDEX 0010000
  10805. +#define BOTHER 0010000
  10806. +#define B57600 0010001
  10807. +#define B115200 0010002
  10808. +#define B230400 0010003
  10809. +#define B460800 0010004
  10810. +#define B500000 0010005
  10811. +#define B576000 0010006
  10812. +#define B921600 0010007
  10813. +#define B1000000 0010010
  10814. +#define B1152000 0010011
  10815. +#define B1500000 0010012
  10816. +#define B2000000 0010013
  10817. +#define B2500000 0010014
  10818. +#define B3000000 0010015
  10819. +#define B3500000 0010016
  10820. +#define B4000000 0010017
  10821. +#define CIBAUD 002003600000 /* input baud rate */
  10822. +#define CMSPAR 010000000000 /* mark or space (stick) parity */
  10823. +#define CRTSCTS 020000000000 /* flow control */
  10824. +
  10825. +#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
  10826. +
  10827. +/* c_lflag bits */
  10828. +#define ISIG 0000001
  10829. +#define ICANON 0000002
  10830. +#define XCASE 0000004
  10831. +#define ECHO 0000010
  10832. +#define ECHOE 0000020
  10833. +#define ECHOK 0000040
  10834. +#define ECHONL 0000100
  10835. +#define NOFLSH 0000200
  10836. +#define TOSTOP 0000400
  10837. +#define ECHOCTL 0001000
  10838. +#define ECHOPRT 0002000
  10839. +#define ECHOKE 0004000
  10840. +#define FLUSHO 0010000
  10841. +#define PENDIN 0040000
  10842. +#define IEXTEN 0100000
  10843. +
  10844. +
  10845. +/* tcflow() and TCXONC use these */
  10846. +#define TCOOFF 0
  10847. +#define TCOON 1
  10848. +#define TCIOFF 2
  10849. +#define TCION 3
  10850. +
  10851. +/* tcflush() and TCFLSH use these */
  10852. +#define TCIFLUSH 0
  10853. +#define TCOFLUSH 1
  10854. +#define TCIOFLUSH 2
  10855. +
  10856. +/* tcsetattr uses these */
  10857. +#define TCSANOW 0
  10858. +#define TCSADRAIN 1
  10859. +#define TCSAFLUSH 2
  10860. +
  10861. +#endif /* _ASM_UBICOM32_TERMBITS_H */
  10862. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/termios.h linux-2.6.28.10/arch/ubicom32/include/asm/termios.h
  10863. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/termios.h 1970-01-01 02:00:00.000000000 +0200
  10864. +++ linux-2.6.28.10/arch/ubicom32/include/asm/termios.h 2009-08-06 10:31:02.000000000 +0300
  10865. @@ -0,0 +1,119 @@
  10866. +/*
  10867. + * arch/ubicom32/include/asm/termios.h
  10868. + * Ubicom32 termio definitions.
  10869. + *
  10870. + * (C) Copyright 2009, Ubicom, Inc.
  10871. + *
  10872. + * This file is part of the Ubicom32 Linux Kernel Port.
  10873. + *
  10874. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  10875. + * it and/or modify it under the terms of the GNU General Public License
  10876. + * as published by the Free Software Foundation, either version 2 of the
  10877. + * License, or (at your option) any later version.
  10878. + *
  10879. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  10880. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  10881. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  10882. + * the GNU General Public License for more details.
  10883. + *
  10884. + * You should have received a copy of the GNU General Public License
  10885. + * along with the Ubicom32 Linux Kernel Port. If not,
  10886. + * see <http://www.gnu.org/licenses/>.
  10887. + *
  10888. + * Ubicom32 implementation derived from (with many thanks):
  10889. + * arch/m68knommu
  10890. + * arch/blackfin
  10891. + * arch/parisc
  10892. + */
  10893. +#ifndef _ASM_UBICOM32_TERMIOS_H
  10894. +#define _ASM_UBICOM32_TERMIOS_H
  10895. +
  10896. +#include <asm/termbits.h>
  10897. +#include <asm/ioctls.h>
  10898. +
  10899. +struct winsize {
  10900. + unsigned short ws_row;
  10901. + unsigned short ws_col;
  10902. + unsigned short ws_xpixel;
  10903. + unsigned short ws_ypixel;
  10904. +};
  10905. +
  10906. +#define NCC 8
  10907. +struct termio {
  10908. + unsigned short c_iflag; /* input mode flags */
  10909. + unsigned short c_oflag; /* output mode flags */
  10910. + unsigned short c_cflag; /* control mode flags */
  10911. + unsigned short c_lflag; /* local mode flags */
  10912. + unsigned char c_line; /* line discipline */
  10913. + unsigned char c_cc[NCC]; /* control characters */
  10914. +};
  10915. +
  10916. +#ifdef __KERNEL__
  10917. +/* intr=^C quit=^| erase=del kill=^U
  10918. + eof=^D vtime=\0 vmin=\1 sxtc=\0
  10919. + start=^Q stop=^S susp=^Z eol=\0
  10920. + reprint=^R discard=^U werase=^W lnext=^V
  10921. + eol2=\0
  10922. +*/
  10923. +#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
  10924. +#endif
  10925. +
  10926. +/* modem lines */
  10927. +#define TIOCM_LE 0x001
  10928. +#define TIOCM_DTR 0x002
  10929. +#define TIOCM_RTS 0x004
  10930. +#define TIOCM_ST 0x008
  10931. +#define TIOCM_SR 0x010
  10932. +#define TIOCM_CTS 0x020
  10933. +#define TIOCM_CAR 0x040
  10934. +#define TIOCM_RNG 0x080
  10935. +#define TIOCM_DSR 0x100
  10936. +#define TIOCM_CD TIOCM_CAR
  10937. +#define TIOCM_RI TIOCM_RNG
  10938. +#define TIOCM_OUT1 0x2000
  10939. +#define TIOCM_OUT2 0x4000
  10940. +#define TIOCM_LOOP 0x8000
  10941. +
  10942. +/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
  10943. +
  10944. +#ifdef __KERNEL__
  10945. +
  10946. +/*
  10947. + * Translate a "termio" structure into a "termios". Ugh.
  10948. + */
  10949. +#define user_termio_to_kernel_termios(termios, termio) \
  10950. +({ \
  10951. + unsigned short tmp; \
  10952. + get_user(tmp, &(termio)->c_iflag); \
  10953. + (termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \
  10954. + get_user(tmp, &(termio)->c_oflag); \
  10955. + (termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \
  10956. + get_user(tmp, &(termio)->c_cflag); \
  10957. + (termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \
  10958. + get_user(tmp, &(termio)->c_lflag); \
  10959. + (termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \
  10960. + get_user((termios)->c_line, &(termio)->c_line); \
  10961. + copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
  10962. +})
  10963. +
  10964. +/*
  10965. + * Translate a "termios" structure into a "termio". Ugh.
  10966. + */
  10967. +#define kernel_termios_to_user_termio(termio, termios) \
  10968. +({ \
  10969. + put_user((termios)->c_iflag, &(termio)->c_iflag); \
  10970. + put_user((termios)->c_oflag, &(termio)->c_oflag); \
  10971. + put_user((termios)->c_cflag, &(termio)->c_cflag); \
  10972. + put_user((termios)->c_lflag, &(termio)->c_lflag); \
  10973. + put_user((termios)->c_line, &(termio)->c_line); \
  10974. + copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
  10975. +})
  10976. +
  10977. +#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
  10978. +#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
  10979. +#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
  10980. +#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
  10981. +
  10982. +#endif /* __KERNEL__ */
  10983. +
  10984. +#endif /* _ASM_UBICOM32_TERMIOS_H */
  10985. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/thread-asm.h linux-2.6.28.10/arch/ubicom32/include/asm/thread-asm.h
  10986. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/thread-asm.h 1970-01-01 02:00:00.000000000 +0200
  10987. +++ linux-2.6.28.10/arch/ubicom32/include/asm/thread-asm.h 2009-08-06 10:31:02.000000000 +0300
  10988. @@ -0,0 +1,49 @@
  10989. +/*
  10990. + * arch/ubicom32/include/asm/thread-asm.h
  10991. + * Ubicom32 architecture specific thread definitions.
  10992. + *
  10993. + * (C) Copyright 2009, Ubicom, Inc.
  10994. + *
  10995. + * This file is part of the Ubicom32 Linux Kernel Port.
  10996. + *
  10997. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  10998. + * it and/or modify it under the terms of the GNU General Public License
  10999. + * as published by the Free Software Foundation, either version 2 of the
  11000. + * License, or (at your option) any later version.
  11001. + *
  11002. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  11003. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  11004. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  11005. + * the GNU General Public License for more details.
  11006. + *
  11007. + * You should have received a copy of the GNU General Public License
  11008. + * along with the Ubicom32 Linux Kernel Port. If not,
  11009. + * see <http://www.gnu.org/licenses/>.
  11010. + *
  11011. + * Ubicom32 implementation derived from (with many thanks):
  11012. + * arch/m68knommu
  11013. + * arch/blackfin
  11014. + * arch/parisc
  11015. + */
  11016. +#ifndef _ASM_UBICOM32_THREAD_ASM_H
  11017. +#define _ASM_UBICOM32_THREAD_ASM_H
  11018. +
  11019. +/*
  11020. + * thread_get_self
  11021. + * Read and shift the current thread into reg
  11022. + */
  11023. +.macro thread_get_self reg
  11024. + lsr.4 \reg, ROSR, #2
  11025. + and.4 \reg, #31, \reg /* Mask to get thread number into register */
  11026. +.endm
  11027. +
  11028. +/*
  11029. + * thread_get_self_mask
  11030. + * Read and shift the current thread mask into reg
  11031. + */
  11032. +.macro thread_get_self_mask reg
  11033. + lsr.4 \reg, ROSR, #2
  11034. + lsl.4 \reg, #1, \reg /* Thread bit */
  11035. +.endm
  11036. +
  11037. +#endif /* _ASM_UBICOM32_THREAD_ASM_H */
  11038. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/thread.h linux-2.6.28.10/arch/ubicom32/include/asm/thread.h
  11039. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/thread.h 1970-01-01 02:00:00.000000000 +0200
  11040. +++ linux-2.6.28.10/arch/ubicom32/include/asm/thread.h 2009-08-06 10:31:02.000000000 +0300
  11041. @@ -0,0 +1,313 @@
  11042. +/*
  11043. + * arch/ubicom32/include/asm/thread.h
  11044. + * Ubicom32 architecture specific thread definitions.
  11045. + *
  11046. + * (C) Copyright 2009, Ubicom, Inc.
  11047. + *
  11048. + * This file is part of the Ubicom32 Linux Kernel Port.
  11049. + *
  11050. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  11051. + * it and/or modify it under the terms of the GNU General Public License
  11052. + * as published by the Free Software Foundation, either version 2 of the
  11053. + * License, or (at your option) any later version.
  11054. + *
  11055. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  11056. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  11057. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  11058. + * the GNU General Public License for more details.
  11059. + *
  11060. + * You should have received a copy of the GNU General Public License
  11061. + * along with the Ubicom32 Linux Kernel Port. If not,
  11062. + * see <http://www.gnu.org/licenses/>.
  11063. + *
  11064. + * Ubicom32 implementation derived from (with many thanks):
  11065. + * arch/m68knommu
  11066. + * arch/blackfin
  11067. + * arch/parisc
  11068. + */
  11069. +#ifndef _ASM_UBICOM32_THREAD_H
  11070. +#define _ASM_UBICOM32_THREAD_H
  11071. +
  11072. +#if !defined(__ASSEMBLY__)
  11073. +
  11074. +#include <asm/ptrace.h>
  11075. +#include <asm/ubicom32-common.h>
  11076. +
  11077. +typedef int thread_t;
  11078. +typedef unsigned char thread_type_t;
  11079. +typedef void (*thread_exec_fn_t)(void *arg);
  11080. +
  11081. +#define THREAD_NULL 0x40
  11082. +#define THREAD_TYPE_HRT (1 << 0)
  11083. +#define THREAD_TYPE_SPECIAL 0
  11084. +#define THREAD_TYPE_NORMAL 0
  11085. +#define THREAD_TYPE_BACKGROUND (1 << 1)
  11086. +
  11087. +/*
  11088. + * This is the upper bound on the maximum hardware threads that one will find
  11089. + * on a Ubicom processor. It is used to size per hardware thread data structures.
  11090. + */
  11091. +#define THREAD_ARCHITECTURAL_MAX 16
  11092. +
  11093. +/*
  11094. + * TODO: Rename this at some point to be thread_
  11095. + */
  11096. +extern unsigned int sw_ksp[THREAD_ARCHITECTURAL_MAX];
  11097. +
  11098. +
  11099. +/*
  11100. + * thread_get_self()
  11101. + */
  11102. +static inline thread_t thread_get_self(void)
  11103. +{
  11104. + thread_t result;
  11105. + asm (
  11106. + "lsr.4 %0, ROSR, #2 \n\t"
  11107. + : "=d" (result)
  11108. + :
  11109. + : "cc"
  11110. + );
  11111. + return result & 31;
  11112. +}
  11113. +
  11114. +/*
  11115. + * thread_suspend()
  11116. + */
  11117. +static inline void thread_suspend(void)
  11118. +{
  11119. + asm volatile (
  11120. + "suspend\n\t"
  11121. + :
  11122. + :
  11123. + );
  11124. +}
  11125. +
  11126. +/*
  11127. + * thread_resume()
  11128. + */
  11129. +static inline void thread_resume(thread_t thread)
  11130. +{
  11131. + asm volatile (
  11132. + "move.4 MT_ACTIVE_SET, %0 \n\t"
  11133. + "pipe_flush 0 \n\t"
  11134. + "pipe_flush 0 \n\t"
  11135. + :
  11136. + : "d" (1 << thread)
  11137. + );
  11138. +}
  11139. +
  11140. +
  11141. +
  11142. +/*
  11143. + * thread_enable_mask()
  11144. + * Enable all threads in the mask.
  11145. + *
  11146. + * All writes to MT_EN must be protected by the MT_EN_LOCK bit
  11147. + */
  11148. +static inline void thread_enable_mask(unsigned int mask)
  11149. +{
  11150. + /*
  11151. + * must flush the pipeline twice.
  11152. + * first pipe_flush is to ensure write to MT_EN is completed
  11153. + * second one is to ensure any new instructions from
  11154. + * the targeted thread (the one being disabled), that
  11155. + * are issued while the write to MT_EN is being executed,
  11156. + * are completed.
  11157. + */
  11158. + UBICOM32_LOCK(MT_EN_LOCK_BIT);
  11159. + asm volatile (
  11160. + "or.4 MT_EN, MT_EN, %0 \n\t"
  11161. + "pipe_flush 0 \n\t"
  11162. + "pipe_flush 0 \n\t"
  11163. + :
  11164. + : "d" (mask)
  11165. + : "cc"
  11166. + );
  11167. + UBICOM32_UNLOCK(MT_EN_LOCK_BIT);
  11168. +}
  11169. +
  11170. +/*
  11171. + * thread_enable()
  11172. + */
  11173. +static inline void thread_enable(thread_t thread)
  11174. +{
  11175. + thread_enable_mask(1 << thread);
  11176. +}
  11177. +
  11178. +/*
  11179. + * thread_disable_mask()
  11180. + * Disable all threads in the mask.
  11181. + *
  11182. + * All writes to MT_EN must be protected by the MT_EN_LOCK bit
  11183. + */
  11184. +static inline void thread_disable_mask(unsigned int mask)
  11185. +{
  11186. + /*
  11187. + * must flush the pipeline twice.
  11188. + * first pipe_flush is to ensure write to MT_EN is completed
  11189. + * second one is to ensure any new instructions from
  11190. + * the targeted thread (the one being disabled), that
  11191. + * are issued while the write to MT_EN is being executed,
  11192. + * are completed.
  11193. + */
  11194. + UBICOM32_LOCK(MT_EN_LOCK_BIT);
  11195. + asm volatile (
  11196. + "and.4 MT_EN, MT_EN, %0 \n\t"
  11197. + "pipe_flush 0 \n\t"
  11198. + "pipe_flush 0 \n\t"
  11199. + :
  11200. + : "d" (~mask)
  11201. + : "cc"
  11202. + );
  11203. + UBICOM32_UNLOCK(MT_EN_LOCK_BIT);
  11204. +}
  11205. +
  11206. +/*
  11207. + * thread_disable()
  11208. + */
  11209. +static inline void thread_disable(thread_t thread)
  11210. +{
  11211. + thread_disable_mask(1 << thread);
  11212. +}
  11213. +
  11214. +/*
  11215. + * thread_disable_others()
  11216. + * Disable all other threads
  11217. + */
  11218. +static inline void thread_disable_others(void)
  11219. +{
  11220. + thread_t self = thread_get_self();
  11221. + thread_disable_mask(~(1 << self));
  11222. +}
  11223. +
  11224. +/*
  11225. + * thread_is_trapped()
  11226. + * Is the specified tid trapped?
  11227. + */
  11228. +static inline int thread_is_trapped(thread_t tid)
  11229. +{
  11230. + int thread_mask = (1 << tid);
  11231. + int trap_thread;
  11232. +
  11233. + asm (
  11234. + "move.4 %0, MT_TRAP \n\t"
  11235. + : "=d" (trap_thread)
  11236. + :
  11237. + );
  11238. + return (trap_thread & thread_mask);
  11239. +}
  11240. +
  11241. +/*
  11242. + * thread_is_enabled()
  11243. + * Is the specified tid enabled?
  11244. + */
  11245. +static inline int thread_is_enabled(thread_t tid)
  11246. +{
  11247. + int thread_mask = (1 << tid);
  11248. + int enabled_threads;
  11249. +
  11250. + asm (
  11251. + "move.4 %0, MT_EN \n\t"
  11252. + : "=d" (enabled_threads)
  11253. + :
  11254. + );
  11255. + return (enabled_threads & thread_mask);
  11256. +}
  11257. +
  11258. +/*
  11259. + * thread_get_instruction_count()
  11260. + */
  11261. +static inline unsigned int thread_get_instruction_count(void)
  11262. +{
  11263. + unsigned int result;
  11264. + asm (
  11265. + "move.4 %0, INST_CNT \n\t"
  11266. + : "=r" (result)
  11267. + );
  11268. + return result;
  11269. +}
  11270. +
  11271. +/*
  11272. + * thread_get_pc()
  11273. + * pc could point to a speculative and cancelled instruction unless thread is disabled
  11274. + */
  11275. +static inline void *thread_get_pc(thread_t thread)
  11276. +{
  11277. + void *result;
  11278. + asm (
  11279. + "move.4 csr, %1 \n\t"
  11280. + "setcsr_flush 0 \n\t"
  11281. + "move.4 %0, pc \n\t"
  11282. + "move.4 csr, #0 \n\t"
  11283. + "setcsr_flush 0 \n\t"
  11284. + : "=r" (result)
  11285. + : "r" ((thread << 9) | (1 << 8))
  11286. + );
  11287. + return result;
  11288. +}
  11289. +
  11290. +/*
  11291. + * thread_get_trap_cause()
  11292. + * This should be called only when the thread is not running
  11293. + */
  11294. +static inline unsigned int thread_get_trap_cause(thread_t thread)
  11295. +{
  11296. + unsigned int result;
  11297. + asm (
  11298. + "move.4 csr, %1 \n\t"
  11299. + "setcsr_flush 0 \n\t"
  11300. + "move.4 %0, trap_cause \n\t"
  11301. + "move.4 csr, #0 \n\t"
  11302. + "setcsr_flush 0 \n\t"
  11303. + : "=r" (result)
  11304. + : "r" ((thread << 9) | (1 << 8))
  11305. + );
  11306. + return result;
  11307. +}
  11308. +
  11309. +/*
  11310. + * THREAD_STALL macro.
  11311. + */
  11312. +#define THREAD_STALL \
  11313. + asm volatile ( \
  11314. + "move.4 mt_dbg_active_clr, #-1 \n\t" \
  11315. + "pipe_flush 0 \n\t" \
  11316. + : \
  11317. + : \
  11318. + )
  11319. +
  11320. +extern unsigned int thread_get_mainline(void);
  11321. +extern void thread_set_mainline(thread_t tid);
  11322. +extern thread_t thread_alloc(void);
  11323. +extern thread_t thread_start(thread_t thread, thread_exec_fn_t exec, void *arg, unsigned int *sp_high, thread_type_t type);
  11324. +
  11325. +/*
  11326. + * asm macros
  11327. + */
  11328. +asm (
  11329. +/*
  11330. + * thread_get_self
  11331. + * Read and shift the current thread into reg
  11332. + */
  11333. +".macro thread_get_self reg \n\t"
  11334. +" lsr.4 \\reg, ROSR, #2 \n\t"
  11335. +" and.4 \\reg, #31, \\reg \n\t"/* Mask to get thread number into
  11336. + * register */
  11337. +".endm \n\t"
  11338. +
  11339. +/*
  11340. + * thread_get_self_mask
  11341. + * Read and shift the current thread mask into reg
  11342. + */
  11343. +".macro thread_get_self_mask reg \n\t"
  11344. +" lsr.4 \\reg, ROSR, #2 \n\t"
  11345. +" lsl.4 \\reg, #1, \\reg \n\t" /* Thread bit */
  11346. +".endm \n\t"
  11347. + );
  11348. +
  11349. +#else /* __ASSEMBLY__ */
  11350. +
  11351. +#include <asm/thread-asm.h>
  11352. +
  11353. +#endif /* __ASSEMBLY__ */
  11354. +#endif /* _ASM_UBICOM32_THREAD_H */
  11355. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/thread_info.h linux-2.6.28.10/arch/ubicom32/include/asm/thread_info.h
  11356. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/thread_info.h 1970-01-01 02:00:00.000000000 +0200
  11357. +++ linux-2.6.28.10/arch/ubicom32/include/asm/thread_info.h 2009-08-06 10:31:02.000000000 +0300
  11358. @@ -0,0 +1,134 @@
  11359. +/*
  11360. + * arch/ubicom32/include/asm/thread_info.h
  11361. + * Ubicom32 architecture low-level thread information.
  11362. + *
  11363. + * (C) Copyright 2009, Ubicom, Inc.
  11364. + * Adapted from the i386 and PPC versions by Greg Ungerer ([email protected])
  11365. + * Copyright (C) 2002 David Howells ([email protected])
  11366. + * - Incorporating suggestions made by Linus Torvalds and Dave Miller
  11367. + *
  11368. + * This file is part of the Ubicom32 Linux Kernel Port.
  11369. + *
  11370. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  11371. + * it and/or modify it under the terms of the GNU General Public License
  11372. + * as published by the Free Software Foundation, either version 2 of the
  11373. + * License, or (at your option) any later version.
  11374. + *
  11375. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  11376. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  11377. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  11378. + * the GNU General Public License for more details.
  11379. + *
  11380. + * You should have received a copy of the GNU General Public License
  11381. + * along with the Ubicom32 Linux Kernel Port. If not,
  11382. + * see <http://www.gnu.org/licenses/>.
  11383. + *
  11384. + * Ubicom32 implementation derived from (with many thanks):
  11385. + * arch/m68knommu
  11386. + * arch/blackfin
  11387. + * arch/parisc
  11388. + */
  11389. +
  11390. +#ifndef _ASM_UBICOM32_THREAD_INFO_H
  11391. +#define _ASM_UBICOM32_THREAD_INFO_H
  11392. +
  11393. +#include <asm/page.h>
  11394. +
  11395. +/*
  11396. + * Size of kernel stack for each process. This must be a power of 2...
  11397. + */
  11398. +#ifdef CONFIG_4KSTACKS
  11399. +#define THREAD_SIZE_ORDER (0)
  11400. +#else
  11401. +#define THREAD_SIZE_ORDER (1)
  11402. +#endif
  11403. +
  11404. +/*
  11405. + * for asm files, THREAD_SIZE is now generated by asm-offsets.c
  11406. + */
  11407. +#define THREAD_SIZE (PAGE_SIZE<<THREAD_SIZE_ORDER)
  11408. +
  11409. +#ifdef __KERNEL__
  11410. +
  11411. +#ifndef __ASSEMBLY__
  11412. +
  11413. +/*
  11414. + * low level task data.
  11415. + */
  11416. +struct thread_info {
  11417. + struct task_struct *task; /* main task structure */
  11418. + struct exec_domain *exec_domain; /* execution domain */
  11419. + unsigned long flags; /* low level flags */
  11420. + int cpu; /* cpu we're on */
  11421. + int preempt_count; /* 0 => preemptable, <0 => BUG */
  11422. + int interrupt_nesting; /* Interrupt nesting level. */
  11423. + struct restart_block restart_block;
  11424. +};
  11425. +
  11426. +/*
  11427. + * macros/functions for gaining access to the thread information structure
  11428. + */
  11429. +#define INIT_THREAD_INFO(tsk) \
  11430. +{ \
  11431. + .task = &tsk, \
  11432. + .exec_domain = &default_exec_domain, \
  11433. + .flags = 0, \
  11434. + .cpu = 0, \
  11435. + .interrupt_nesting = 0, \
  11436. + .restart_block = { \
  11437. + .fn = do_no_restart_syscall, \
  11438. + }, \
  11439. +}
  11440. +
  11441. +#define init_thread_info (init_thread_union.thread_info)
  11442. +#define init_stack (init_thread_union.stack)
  11443. +
  11444. +
  11445. +/* how to get the thread information struct from C */
  11446. +static inline struct thread_info *current_thread_info(void)
  11447. +{
  11448. + struct thread_info *ti;
  11449. +
  11450. + asm (
  11451. + "and.4 %0, sp, %1\n\t"
  11452. + : "=&r" (ti)
  11453. + : "d" (~(THREAD_SIZE-1))
  11454. + : "cc"
  11455. + );
  11456. +
  11457. + return ti;
  11458. +}
  11459. +
  11460. +#define STACK_WARN (THREAD_SIZE / 8)
  11461. +
  11462. +#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR 1
  11463. +
  11464. +/* thread information allocation */
  11465. +#define alloc_thread_info(tsk) ((struct thread_info *) \
  11466. + __get_free_pages(GFP_KERNEL, THREAD_SIZE_ORDER))
  11467. +#define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_SIZE_ORDER)
  11468. +#endif /* __ASSEMBLY__ */
  11469. +
  11470. +#define PREEMPT_ACTIVE 0x4000000
  11471. +
  11472. +/*
  11473. + * thread information flag bit numbers
  11474. + */
  11475. +#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
  11476. +#define TIF_SIGPENDING 1 /* signal pending */
  11477. +#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
  11478. +#define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling
  11479. + TIF_NEED_RESCHED */
  11480. +#define TIF_MEMDIE 4
  11481. +
  11482. +/* as above, but as bit values */
  11483. +#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
  11484. +#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
  11485. +#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
  11486. +#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
  11487. +
  11488. +#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
  11489. +
  11490. +#endif /* __KERNEL__ */
  11491. +
  11492. +#endif /* _ASM_UBICOM32_THREAD_INFO_H */
  11493. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/timex.h linux-2.6.28.10/arch/ubicom32/include/asm/timex.h
  11494. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/timex.h 1970-01-01 02:00:00.000000000 +0200
  11495. +++ linux-2.6.28.10/arch/ubicom32/include/asm/timex.h 2009-08-06 10:31:02.000000000 +0300
  11496. @@ -0,0 +1,56 @@
  11497. +/*
  11498. + * arch/ubicom32/include/asm/timex.h
  11499. + * Ubicom32 architecture timex specifications.
  11500. + *
  11501. + * (C) Copyright 2009, Ubicom, Inc.
  11502. + *
  11503. + * This file is part of the Ubicom32 Linux Kernel Port.
  11504. + *
  11505. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  11506. + * it and/or modify it under the terms of the GNU General Public License
  11507. + * as published by the Free Software Foundation, either version 2 of the
  11508. + * License, or (at your option) any later version.
  11509. + *
  11510. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  11511. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  11512. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  11513. + * the GNU General Public License for more details.
  11514. + *
  11515. + * You should have received a copy of the GNU General Public License
  11516. + * along with the Ubicom32 Linux Kernel Port. If not,
  11517. + * see <http://www.gnu.org/licenses/>.
  11518. + *
  11519. + * Ubicom32 implementation derived from (with many thanks):
  11520. + * arch/m68knommu
  11521. + * arch/blackfin
  11522. + * arch/parisc
  11523. + */
  11524. +#ifndef _ASM_UBICOM32_TIMEX_H
  11525. +#define _ASM_UBICOM32_TIMEX_H
  11526. +
  11527. +#define CLOCK_TICK_RATE 266000000
  11528. +
  11529. +// #define ARCH_HAS_READ_CURRENT_TIMER
  11530. +
  11531. +typedef unsigned long cycles_t;
  11532. +
  11533. +static inline cycles_t get_cycles(void)
  11534. +{
  11535. + return 0;
  11536. +}
  11537. +
  11538. +extern int timer_alloc(void);
  11539. +extern void timer_set(int timervector, unsigned int cycles);
  11540. +extern int timer_reset(int timervector, unsigned int cycles);
  11541. +extern void timer_tick_init(void);
  11542. +extern void timer_device_init(void);
  11543. +
  11544. +#if defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST)
  11545. +extern void local_timer_interrupt(void);
  11546. +#endif
  11547. +
  11548. +#if defined(CONFIG_LOCAL_TIMERS) || defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST)
  11549. +extern int local_timer_setup(unsigned int cpu);
  11550. +#endif
  11551. +
  11552. +#endif /* _ASM_UBICOM32_TIMEX_H */
  11553. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/tlbflush.h linux-2.6.28.10/arch/ubicom32/include/asm/tlbflush.h
  11554. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/tlbflush.h 1970-01-01 02:00:00.000000000 +0200
  11555. +++ linux-2.6.28.10/arch/ubicom32/include/asm/tlbflush.h 2009-08-06 10:31:02.000000000 +0300
  11556. @@ -0,0 +1,79 @@
  11557. +/*
  11558. + * arch/ubicom32/include/asm/tlbflush.h
  11559. + * TLB operations for Ubicom32 architecture.
  11560. + *
  11561. + * (C) Copyright 2009, Ubicom, Inc.
  11562. + * Copyright (C) 2000 Lineo, David McCullough <[email protected]>
  11563. + * Copyright (C) 2000-2002, Greg Ungerer <[email protected]>
  11564. + *
  11565. + * This file is part of the Ubicom32 Linux Kernel Port.
  11566. + *
  11567. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  11568. + * it and/or modify it under the terms of the GNU General Public License
  11569. + * as published by the Free Software Foundation, either version 2 of the
  11570. + * License, or (at your option) any later version.
  11571. + *
  11572. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  11573. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  11574. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  11575. + * the GNU General Public License for more details.
  11576. + *
  11577. + * You should have received a copy of the GNU General Public License
  11578. + * along with the Ubicom32 Linux Kernel Port. If not,
  11579. + * see <http://www.gnu.org/licenses/>.
  11580. + *
  11581. + * Ubicom32 implementation derived from (with many thanks):
  11582. + * arch/m68knommu
  11583. + * arch/blackfin
  11584. + * arch/parisc
  11585. + */
  11586. +#ifndef _ASM_UBICOM32_TLB_FLUSH_H
  11587. +#define _ASM_UBICOM32_TLB_FLUSH_H
  11588. +
  11589. +#include <asm/setup.h>
  11590. +
  11591. +/*
  11592. + * flush all user-space atc entries.
  11593. + */
  11594. +static inline void __flush_tlb(void)
  11595. +{
  11596. + BUG();
  11597. +}
  11598. +
  11599. +static inline void __flush_tlb_one(unsigned long addr)
  11600. +{
  11601. + BUG();
  11602. +}
  11603. +
  11604. +#define flush_tlb() __flush_tlb()
  11605. +
  11606. +/*
  11607. + * flush all atc entries (both kernel and user-space entries).
  11608. + */
  11609. +static inline void flush_tlb_all(void)
  11610. +{
  11611. + BUG();
  11612. +}
  11613. +
  11614. +static inline void flush_tlb_mm(struct mm_struct *mm)
  11615. +{
  11616. + BUG();
  11617. +}
  11618. +
  11619. +static inline void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr)
  11620. +{
  11621. + BUG();
  11622. +}
  11623. +
  11624. +static inline void flush_tlb_range(struct mm_struct *mm,
  11625. + unsigned long start, unsigned long end)
  11626. +{
  11627. + BUG();
  11628. +}
  11629. +
  11630. +static inline void flush_tlb_kernel_page(unsigned long addr)
  11631. +{
  11632. + BUG();
  11633. +}
  11634. +
  11635. +#endif /* _ASM_UBICOM32_TLB_FLUSH_H */
  11636. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/tlb.h linux-2.6.28.10/arch/ubicom32/include/asm/tlb.h
  11637. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/tlb.h 1970-01-01 02:00:00.000000000 +0200
  11638. +++ linux-2.6.28.10/arch/ubicom32/include/asm/tlb.h 2009-08-06 10:31:02.000000000 +0300
  11639. @@ -0,0 +1,47 @@
  11640. +/*
  11641. + * arch/ubicom32/include/asm/tlb.h
  11642. + * Ubicom32 architecture TLB operations.
  11643. + *
  11644. + * (C) Copyright 2009, Ubicom, Inc.
  11645. + *
  11646. + * This file is part of the Ubicom32 Linux Kernel Port.
  11647. + *
  11648. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  11649. + * it and/or modify it under the terms of the GNU General Public License
  11650. + * as published by the Free Software Foundation, either version 2 of the
  11651. + * License, or (at your option) any later version.
  11652. + *
  11653. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  11654. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  11655. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  11656. + * the GNU General Public License for more details.
  11657. + *
  11658. + * You should have received a copy of the GNU General Public License
  11659. + * along with the Ubicom32 Linux Kernel Port. If not,
  11660. + * see <http://www.gnu.org/licenses/>.
  11661. + *
  11662. + * Ubicom32 implementation derived from (with many thanks):
  11663. + * arch/m68knommu
  11664. + * arch/blackfin
  11665. + * arch/parisc
  11666. + */
  11667. +#ifndef _ASM_UBICOM32_TLB_H
  11668. +#define _ASM_UBICOM32_TLB_H
  11669. +
  11670. +/*
  11671. + * ubicom32 doesn't need any special per-pte or
  11672. + * per-vma handling..
  11673. + */
  11674. +#define tlb_start_vma(tlb, vma) do { } while (0)
  11675. +#define tlb_end_vma(tlb, vma) do { } while (0)
  11676. +#define __tlb_remove_tlb_entry(tlb, ptep, address) do { } while (0)
  11677. +
  11678. +/*
  11679. + * .. because we flush the whole mm when it
  11680. + * fills up.
  11681. + */
  11682. +#define tlb_flush(tlb)
  11683. +
  11684. +#include <asm-generic/tlb.h>
  11685. +
  11686. +#endif /* _ASM_UBICOM32_TLB_H */
  11687. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/topology.h linux-2.6.28.10/arch/ubicom32/include/asm/topology.h
  11688. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/topology.h 1970-01-01 02:00:00.000000000 +0200
  11689. +++ linux-2.6.28.10/arch/ubicom32/include/asm/topology.h 2009-08-06 10:31:02.000000000 +0300
  11690. @@ -0,0 +1,33 @@
  11691. +/*
  11692. + * arch/ubicom32/include/asm/topology.h
  11693. + * Generic topology.h definitions for Ubicom32 architecture.
  11694. + *
  11695. + * (C) Copyright 2009, Ubicom, Inc.
  11696. + *
  11697. + * This file is part of the Ubicom32 Linux Kernel Port.
  11698. + *
  11699. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  11700. + * it and/or modify it under the terms of the GNU General Public License
  11701. + * as published by the Free Software Foundation, either version 2 of the
  11702. + * License, or (at your option) any later version.
  11703. + *
  11704. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  11705. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  11706. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  11707. + * the GNU General Public License for more details.
  11708. + *
  11709. + * You should have received a copy of the GNU General Public License
  11710. + * along with the Ubicom32 Linux Kernel Port. If not,
  11711. + * see <http://www.gnu.org/licenses/>.
  11712. + *
  11713. + * Ubicom32 implementation derived from (with many thanks):
  11714. + * arch/m68knommu
  11715. + * arch/blackfin
  11716. + * arch/parisc
  11717. + */
  11718. +#ifndef _ASM_UBICOM32_TOPOLOGY_H
  11719. +#define _ASM_UBICOM32_TOPOLOGY_H
  11720. +
  11721. +#include <asm-generic/topology.h>
  11722. +
  11723. +#endif /* _ASM_UBICOM32_TOPOLOGY_H */
  11724. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/traps.h linux-2.6.28.10/arch/ubicom32/include/asm/traps.h
  11725. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/traps.h 1970-01-01 02:00:00.000000000 +0200
  11726. +++ linux-2.6.28.10/arch/ubicom32/include/asm/traps.h 2009-08-06 10:31:02.000000000 +0300
  11727. @@ -0,0 +1,55 @@
  11728. +/*
  11729. + * arch/ubicom32/include/asm/traps.h
  11730. + * Trap related definitions for Ubicom32 architecture.
  11731. + *
  11732. + * (C) Copyright 2009, Ubicom, Inc.
  11733. + *
  11734. + * This file is part of the Ubicom32 Linux Kernel Port.
  11735. + *
  11736. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  11737. + * it and/or modify it under the terms of the GNU General Public License
  11738. + * as published by the Free Software Foundation, either version 2 of the
  11739. + * License, or (at your option) any later version.
  11740. + *
  11741. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  11742. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  11743. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  11744. + * the GNU General Public License for more details.
  11745. + *
  11746. + * You should have received a copy of the GNU General Public License
  11747. + * along with the Ubicom32 Linux Kernel Port. If not,
  11748. + * see <http://www.gnu.org/licenses/>.
  11749. + *
  11750. + * Ubicom32 implementation derived from (with many thanks):
  11751. + * arch/m68knommu
  11752. + * arch/blackfin
  11753. + * arch/parisc
  11754. + */
  11755. +
  11756. +#ifndef _ASM_UBICOM32_TRAPS_H
  11757. +#define _ASM_UBICOM32_TRAPS_H
  11758. +
  11759. +/*
  11760. + * Trap causes passed from ultra to Host OS
  11761. + */
  11762. +#define TRAP_CAUSE_TOTAL 13
  11763. +#define TRAP_CAUSE_DST_RANGE_ERR 12
  11764. +#define TRAP_CAUSE_SRC1_RANGE_ERR 11
  11765. +#define TRAP_CAUSE_I_RANGE_ERR 10
  11766. +#define TRAP_CAUSE_DCAPT 9
  11767. +#define TRAP_CAUSE_DST_SERROR 8
  11768. +#define TRAP_CAUSE_SRC1_SERROR 7
  11769. +#define TRAP_CAUSE_DST_MISALIGNED 6
  11770. +#define TRAP_CAUSE_SRC1_MISALIGNED 5
  11771. +#define TRAP_CAUSE_DST_DECODE_ERR 4
  11772. +#define TRAP_CAUSE_SRC1_DECODE_ERR 3
  11773. +#define TRAP_CAUSE_ILLEGAL_INST 2
  11774. +#define TRAP_CAUSE_I_SERROR 1
  11775. +#define TRAP_CAUSE_I_DECODE_ERR 0
  11776. +
  11777. +extern void trap_handler(int irq, struct pt_regs *regs);
  11778. +extern void trap_init_interrupt(void);
  11779. +extern void unaligned_emulate(unsigned int thread);
  11780. +extern int unaligned_only(unsigned int cause);
  11781. +
  11782. +#endif /* _ASM_UBICOM32_TRAPS_H */
  11783. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/types.h linux-2.6.28.10/arch/ubicom32/include/asm/types.h
  11784. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/types.h 1970-01-01 02:00:00.000000000 +0200
  11785. +++ linux-2.6.28.10/arch/ubicom32/include/asm/types.h 2009-08-06 10:31:02.000000000 +0300
  11786. @@ -0,0 +1,75 @@
  11787. +/*
  11788. + * arch/ubicom32/include/asm/types.h
  11789. + * Date type definitions for Ubicom32 architecture.
  11790. + *
  11791. + * (C) Copyright 2009, Ubicom, Inc.
  11792. + *
  11793. + * This file is part of the Ubicom32 Linux Kernel Port.
  11794. + *
  11795. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  11796. + * it and/or modify it under the terms of the GNU General Public License
  11797. + * as published by the Free Software Foundation, either version 2 of the
  11798. + * License, or (at your option) any later version.
  11799. + *
  11800. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  11801. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  11802. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  11803. + * the GNU General Public License for more details.
  11804. + *
  11805. + * You should have received a copy of the GNU General Public License
  11806. + * along with the Ubicom32 Linux Kernel Port. If not,
  11807. + * see <http://www.gnu.org/licenses/>.
  11808. + *
  11809. + * Ubicom32 implementation derived from (with many thanks):
  11810. + * arch/m68knommu
  11811. + * arch/blackfin
  11812. + * arch/parisc
  11813. + */
  11814. +#ifndef _ASM_UBICOM32_TYPES_H
  11815. +#define _ASM_UBICOM32_TYPES_H
  11816. +
  11817. +/*
  11818. + * This file is never included by application software unless
  11819. + * explicitly requested (e.g., via linux/types.h) in which case the
  11820. + * application is Linux specific so (user-) name space pollution is
  11821. + * not a major issue. However, for interoperability, libraries still
  11822. + * need to be careful to avoid a name clashes.
  11823. + */
  11824. +
  11825. +#include <asm-generic/int-ll64.h>
  11826. +
  11827. +#ifndef __ASSEMBLY__
  11828. +
  11829. +typedef unsigned short umode_t;
  11830. +
  11831. +#endif /* __ASSEMBLY__ */
  11832. +
  11833. +/*
  11834. + * These aren't exported outside the kernel to avoid name space clashes
  11835. + */
  11836. +#ifdef __KERNEL__
  11837. +
  11838. +#define BITS_PER_LONG 32
  11839. +
  11840. +#ifndef __ASSEMBLY__
  11841. +
  11842. +/* DMA addresses are always 32-bits wide */
  11843. +
  11844. +typedef u32 dma_addr_t;
  11845. +typedef u32 dma64_addr_t;
  11846. +
  11847. +/*
  11848. + * XXX These are "Ubicom style" typedefs. They should be removed in all files used by linux.
  11849. + */
  11850. +typedef u32 u32_t;
  11851. +typedef s32 s32_t;
  11852. +typedef u16 u16_t;
  11853. +typedef s16 s16_t;
  11854. +typedef u8 u8_t;
  11855. +typedef s8 s8_t;
  11856. +
  11857. +#endif /* __ASSEMBLY__ */
  11858. +
  11859. +#endif /* __KERNEL__ */
  11860. +
  11861. +#endif /* _ASM_UBICOM32_TYPES_H */
  11862. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/uaccess.h linux-2.6.28.10/arch/ubicom32/include/asm/uaccess.h
  11863. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/uaccess.h 1970-01-01 02:00:00.000000000 +0200
  11864. +++ linux-2.6.28.10/arch/ubicom32/include/asm/uaccess.h 2009-08-06 10:31:02.000000000 +0300
  11865. @@ -0,0 +1,347 @@
  11866. +/*
  11867. + * arch/ubicom32/include/asm/uaccess.h
  11868. + * User space memory access functions for Ubicom32 architecture.
  11869. + *
  11870. + * (C) Copyright 2009, Ubicom, Inc.
  11871. + *
  11872. + * This file is part of the Ubicom32 Linux Kernel Port.
  11873. + *
  11874. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  11875. + * it and/or modify it under the terms of the GNU General Public License
  11876. + * as published by the Free Software Foundation, either version 2 of the
  11877. + * License, or (at your option) any later version.
  11878. + *
  11879. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  11880. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  11881. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  11882. + * the GNU General Public License for more details.
  11883. + *
  11884. + * You should have received a copy of the GNU General Public License
  11885. + * along with the Ubicom32 Linux Kernel Port. If not,
  11886. + * see <http://www.gnu.org/licenses/>.
  11887. + *
  11888. + * Ubicom32 implementation derived from (with many thanks):
  11889. + * arch/m68knommu
  11890. + * arch/blackfin
  11891. + * arch/parisc
  11892. + * arch/alpha
  11893. + */
  11894. +#ifndef _ASM_UBICOM32_UACCESS_H
  11895. +#define _ASM_UBICOM32_UACCESS_H
  11896. +
  11897. +/*
  11898. + * User space memory access functions
  11899. + */
  11900. +#include <linux/sched.h>
  11901. +#include <linux/mm.h>
  11902. +#include <linux/string.h>
  11903. +
  11904. +#include <asm/segment.h>
  11905. +
  11906. +#define VERIFY_READ 0
  11907. +#define VERIFY_WRITE 1
  11908. +
  11909. +/*
  11910. + * The exception table consists of pairs of addresses: the first is the
  11911. + * address of an instruction that is allowed to fault, and the second is
  11912. + * the address at which the program should continue. No registers are
  11913. + * modified, so it is entirely up to the continuation code to figure out
  11914. + * what to do.
  11915. + *
  11916. + * All the routines below use bits of fixup code that are out of line
  11917. + * with the main instruction path. This means when everything is well,
  11918. + * we don't even have to jump over them. Further, they do not intrude
  11919. + * on our cache or tlb entries.
  11920. + */
  11921. +struct exception_table_entry
  11922. +{
  11923. + unsigned long insn, fixup;
  11924. +};
  11925. +
  11926. +/*
  11927. + * Ubicom32 does not currently support the exception table handling.
  11928. + */
  11929. +extern unsigned long search_exception_table(unsigned long);
  11930. +
  11931. +
  11932. +#if defined(CONFIG_ACCESS_OK_CHECKS_ENABLED)
  11933. +extern int __access_ok(unsigned long addr, unsigned long size);
  11934. +#else
  11935. +static inline int __access_ok(unsigned long addr, unsigned long size)
  11936. +{
  11937. + return 1;
  11938. +}
  11939. +#endif
  11940. +#define access_ok(type, addr, size) \
  11941. + likely(__access_ok((unsigned long)(addr), (size)))
  11942. +
  11943. +/*
  11944. + * The following functions do not exist. They keep callers
  11945. + * of put_user and get_user from passing unsupported argument
  11946. + * types. They result in a link time error.
  11947. + */
  11948. +extern int __put_user_bad(void);
  11949. +extern int __get_user_bad(void);
  11950. +
  11951. +/*
  11952. + * __put_user_no_check()
  11953. + * Put the requested data into the user space verifying the address
  11954. + *
  11955. + * Careful to not
  11956. + * (a) re-use the arguments for side effects (sizeof/typeof is ok)
  11957. + * (b) require any knowledge of processes at this stage
  11958. + */
  11959. +#define __put_user_no_check(x, ptr, size) \
  11960. +({ \
  11961. + int __pu_err = 0; \
  11962. + __typeof__(*(ptr)) __user *__pu_addr = (ptr); \
  11963. + switch (size) { \
  11964. + case 1: \
  11965. + case 2: \
  11966. + case 4: \
  11967. + case 8: \
  11968. + *__pu_addr = (__typeof__(*(ptr)))x; \
  11969. + break; \
  11970. + default: \
  11971. + __pu_err = __put_user_bad(); \
  11972. + break; \
  11973. + } \
  11974. + __pu_err; \
  11975. +})
  11976. +
  11977. +/*
  11978. + * __put_user_check()
  11979. + * Put the requested data into the user space verifying the address
  11980. + *
  11981. + * Careful to not
  11982. + * (a) re-use the arguments for side effects (sizeof/typeof is ok)
  11983. + * (b) require any knowledge of processes at this stage
  11984. + *
  11985. + * If requested, access_ok() will verify that ptr is a valid user
  11986. + * pointer.
  11987. + */
  11988. +#define __put_user_check(x, ptr, size) \
  11989. +({ \
  11990. + int __pu_err = -EFAULT; \
  11991. + __typeof__(*(ptr)) __user *__pu_addr = (ptr); \
  11992. + if (access_ok(VERIFY_WRITE, __pu_addr, size)) { \
  11993. + __pu_err = 0; \
  11994. + switch (size) { \
  11995. + case 1: \
  11996. + case 2: \
  11997. + case 4: \
  11998. + case 8: \
  11999. + *__pu_addr = (__typeof__(*(ptr)))x; \
  12000. + break; \
  12001. + default: \
  12002. + __pu_err = __put_user_bad(); \
  12003. + break; \
  12004. + } \
  12005. + } \
  12006. + __pu_err; \
  12007. +})
  12008. +
  12009. +/*
  12010. + * __get_user_no_check()
  12011. + * Read the value at ptr into x.
  12012. + *
  12013. + * If requested, access_ok() will verify that ptr is a valid user
  12014. + * pointer. If the caller passes a modifying argument for ptr (e.g. x++)
  12015. + * this macro will not work.
  12016. + */
  12017. +#define __get_user_no_check(x, ptr, size) \
  12018. +({ \
  12019. + int __gu_err = 0; \
  12020. + __typeof__((x)) __gu_val = 0; \
  12021. + const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
  12022. + switch (size) { \
  12023. + case 1: \
  12024. + case 2: \
  12025. + case 4: \
  12026. + case 8: \
  12027. + __gu_val = (__typeof__((x)))*(__gu_addr); \
  12028. + break; \
  12029. + default: \
  12030. + __gu_err = __get_user_bad(); \
  12031. + (x) = 0; \
  12032. + break; \
  12033. + } \
  12034. + (x) = __gu_val; \
  12035. + __gu_err; \
  12036. +})
  12037. +
  12038. +/*
  12039. + * __get_user_check()
  12040. + * Read the value at ptr into x.
  12041. + *
  12042. + * If requested, access_ok() will verify that ptr is a valid user
  12043. + * pointer.
  12044. + */
  12045. +#define __get_user_check(x, ptr, size) \
  12046. +({ \
  12047. + int __gu_err = -EFAULT; \
  12048. + __typeof__(x) __gu_val = 0; \
  12049. + const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
  12050. + if (access_ok(VERIFY_READ, __gu_addr, size)) { \
  12051. + __gu_err = 0; \
  12052. + switch (size) { \
  12053. + case 1: \
  12054. + case 2: \
  12055. + case 4: \
  12056. + case 8: \
  12057. + __gu_val = (__typeof__((x)))*(__gu_addr); \
  12058. + break; \
  12059. + default: \
  12060. + __gu_err = __get_user_bad(); \
  12061. + (x) = 0; \
  12062. + break; \
  12063. + } \
  12064. + } \
  12065. + (x) = __gu_val; \
  12066. + __gu_err; \
  12067. +})
  12068. +
  12069. +/*
  12070. + * The "xxx" versions are allowed to perform some amount of address
  12071. + * space checking. See access_ok().
  12072. + */
  12073. +#define put_user(x,ptr) \
  12074. + __put_user_check((__typeof__(*(ptr)))(x),(ptr), sizeof(*(ptr)))
  12075. +#define get_user(x,ptr) \
  12076. + __get_user_check((x), (ptr), sizeof(*(ptr)))
  12077. +
  12078. +/*
  12079. + * The "__xxx" versions do not do address space checking, useful when
  12080. + * doing multiple accesses to the same area (the programmer has to do the
  12081. + * checks by hand with "access_ok()")
  12082. + */
  12083. +#define __put_user(x,ptr) \
  12084. + __put_user_no_check((__typeof__(*(ptr)))(x),(ptr), sizeof(*(ptr)))
  12085. +#define __get_user(x,ptr) \
  12086. + __get_user_no_check((x), (ptr), sizeof(*(ptr)))
  12087. +
  12088. +/*
  12089. + * __copy_tofrom_user_no_check()
  12090. + * Copy the data either to or from user space.
  12091. + *
  12092. + * Return the number of bytes NOT copied.
  12093. + */
  12094. +static inline unsigned long
  12095. +__copy_tofrom_user_no_check(void *to, const void *from, unsigned long n)
  12096. +{
  12097. + memcpy(to, from, n);
  12098. + return 0;
  12099. +}
  12100. +
  12101. +/*
  12102. + * copy_to_user()
  12103. + * Copy the kernel data to user space.
  12104. + *
  12105. + * Return the number of bytes that were copied.
  12106. + */
  12107. +static inline unsigned long
  12108. +copy_to_user(void __user *to, const void *from, unsigned long n)
  12109. +{
  12110. + if (!access_ok(VERIFY_WRITE, to, n)) {
  12111. + return n;
  12112. + }
  12113. + return __copy_tofrom_user_no_check((__force void *)to, from, n);
  12114. +}
  12115. +
  12116. +/*
  12117. + * copy_from_user()
  12118. + * Copy the user data to kernel space.
  12119. + *
  12120. + * Return the number of bytes that were copied. On error, we zero
  12121. + * out the destination.
  12122. + */
  12123. +static inline unsigned long
  12124. +copy_from_user(void *to, const void __user *from, unsigned long n)
  12125. +{
  12126. + if (!access_ok(VERIFY_READ, from, n)) {
  12127. + return n;
  12128. + }
  12129. + return __copy_tofrom_user_no_check(to, (__force void *)from, n);
  12130. +}
  12131. +
  12132. +#define __copy_to_user(to, from, n) \
  12133. + __copy_tofrom_user_no_check((__force void *)to, from, n)
  12134. +#define __copy_from_user(to, from, n) \
  12135. + __copy_tofrom_user_no_check(to, (__force void *)from, n)
  12136. +#define __copy_to_user_inatomic(to, from, n) \
  12137. + __copy_tofrom_user_no_check((__force void *)to, from, n)
  12138. +#define __copy_from_user_inatomic(to, from, n) \
  12139. + __copy_tofrom_user_no_check(to, (__force void *)from, n)
  12140. +
  12141. +#define copy_to_user_ret(to, from, n, retval) \
  12142. + ({ if (copy_to_user(to, from, n)) return retval; })
  12143. +
  12144. +#define copy_from_user_ret(to, from, n, retval) \
  12145. + ({ if (copy_from_user(to, from, n)) return retval; })
  12146. +
  12147. +/*
  12148. + * strncpy_from_user()
  12149. + * Copy a null terminated string from userspace.
  12150. + *
  12151. + * dst - Destination in kernel space. The buffer must be at least count.
  12152. + * src - Address of string in user space.
  12153. + * count - Maximum number of bytes to copy (including the trailing NULL).
  12154. + *
  12155. + * Returns the length of the string (not including the trailing NULL. If
  12156. + * count is smaller than the length of the string, we copy count bytes
  12157. + * and return count.
  12158. + *
  12159. + */
  12160. +static inline long strncpy_from_user(char *dst, const __user char *src, long count)
  12161. +{
  12162. + char *tmp;
  12163. + if (!access_ok(VERIFY_READ, src, 1)) {
  12164. + return -EFAULT;
  12165. + }
  12166. +
  12167. + strncpy(dst, src, count);
  12168. + for (tmp = dst; *tmp && count > 0; tmp++, count--) {
  12169. + ;
  12170. + }
  12171. + return(tmp - dst);
  12172. +}
  12173. +
  12174. +/*
  12175. + * strnlen_user()
  12176. + * Return the size of a string (including the ending 0)
  12177. + *
  12178. + * Return -EFAULT on exception, a value greater than <n> if too long
  12179. + */
  12180. +static inline long strnlen_user(const __user char *src, long n)
  12181. +{
  12182. + if (!access_ok(VERIFY_READ, src, 1)) {
  12183. + return -EFAULT;
  12184. + }
  12185. + return(strlen(src) + 1);
  12186. +}
  12187. +
  12188. +#define strlen_user(str) strnlen_user(str, 32767)
  12189. +
  12190. +/*
  12191. + * __clear_user()
  12192. + * Zero Userspace
  12193. + */
  12194. +static inline unsigned long __clear_user(__user void *to, unsigned long n)
  12195. +{
  12196. + memset(to, 0, n);
  12197. + return 0;
  12198. +}
  12199. +
  12200. +/*
  12201. + * clear_user()
  12202. + * Zero user space (check for valid addresses)
  12203. + */
  12204. +static inline unsigned long clear_user(__user void *to, unsigned long n)
  12205. +{
  12206. + if (!access_ok(VERIFY_WRITE, to, n)) {
  12207. + return -EFAULT;
  12208. + }
  12209. + return __clear_user(to, n);
  12210. +}
  12211. +
  12212. +#endif /* _ASM_UBICOM32_UACCESS_H */
  12213. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/ubicom32-common-asm.h linux-2.6.28.10/arch/ubicom32/include/asm/ubicom32-common-asm.h
  12214. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/ubicom32-common-asm.h 1970-01-01 02:00:00.000000000 +0200
  12215. +++ linux-2.6.28.10/arch/ubicom32/include/asm/ubicom32-common-asm.h 2009-08-06 10:31:02.000000000 +0300
  12216. @@ -0,0 +1,49 @@
  12217. +/*
  12218. + * arch/ubicom32/include/asm/ubicom32-common-asm.h
  12219. + * Ubicom32 atomic lock operations.
  12220. + *
  12221. + * (C) Copyright 2009, Ubicom, Inc.
  12222. + *
  12223. + * This file is part of the Ubicom32 Linux Kernel Port.
  12224. + *
  12225. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  12226. + * it and/or modify it under the terms of the GNU General Public License
  12227. + * as published by the Free Software Foundation, either version 2 of the
  12228. + * License, or (at your option) any later version.
  12229. + *
  12230. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  12231. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  12232. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  12233. + * the GNU General Public License for more details.
  12234. + *
  12235. + * You should have received a copy of the GNU General Public License
  12236. + * along with the Ubicom32 Linux Kernel Port. If not,
  12237. + * see <http://www.gnu.org/licenses/>.
  12238. + *
  12239. + * Ubicom32 implementation derived from (with many thanks):
  12240. + * arch/m68knommu
  12241. + * arch/blackfin
  12242. + * arch/parisc
  12243. + */
  12244. +
  12245. +#ifndef _ASM_UBICOM32_UBICOM32_COMMON_ASM_H
  12246. +#define _ASM_UBICOM32_UBICOM32_COMMON_ASM_H
  12247. +
  12248. +/*
  12249. + * atomic_lock_acquire macro
  12250. + * Equivalent to __atomic_lock_acquire()
  12251. + */
  12252. +.macro atomic_lock_acquire
  12253. + bset scratchpad1, scratchpad1, #ATOMIC_LOCK_BIT
  12254. + jmpne.f .-4
  12255. +.endm
  12256. +
  12257. +/*
  12258. + * atomic_lock_release macro
  12259. + * Equivalent to __atomic_lock_release()
  12260. + */
  12261. +.macro atomic_lock_release
  12262. + bclr scratchpad1, scratchpad1, #ATOMIC_LOCK_BIT
  12263. +.endm
  12264. +
  12265. +#endif /* _ASM_UBICOM32_UBICOM32_COMMON_ASM_H */
  12266. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/ubicom32-common.h linux-2.6.28.10/arch/ubicom32/include/asm/ubicom32-common.h
  12267. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/ubicom32-common.h 1970-01-01 02:00:00.000000000 +0200
  12268. +++ linux-2.6.28.10/arch/ubicom32/include/asm/ubicom32-common.h 2009-08-06 10:31:02.000000000 +0300
  12269. @@ -0,0 +1,124 @@
  12270. +/*
  12271. + * arch/ubicom32/include/asm/ubicom32-common.h
  12272. + * Ubicom32 atomic lock operations.
  12273. + *
  12274. + * (C) Copyright 2009, Ubicom, Inc.
  12275. + *
  12276. + * This file is part of the Ubicom32 Linux Kernel Port.
  12277. + *
  12278. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  12279. + * it and/or modify it under the terms of the GNU General Public License
  12280. + * as published by the Free Software Foundation, either version 2 of the
  12281. + * License, or (at your option) any later version.
  12282. + *
  12283. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  12284. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  12285. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  12286. + * the GNU General Public License for more details.
  12287. + *
  12288. + * You should have received a copy of the GNU General Public License
  12289. + * along with the Ubicom32 Linux Kernel Port. If not,
  12290. + * see <http://www.gnu.org/licenses/>.
  12291. + *
  12292. + * Ubicom32 implementation derived from (with many thanks):
  12293. + * arch/m68knommu
  12294. + * arch/blackfin
  12295. + * arch/parisc
  12296. + */
  12297. +
  12298. +#ifndef _ASM_UBICOM32_UBICOM32_COMMON_H
  12299. +#define _ASM_UBICOM32_UBICOM32_COMMON_H
  12300. +
  12301. +#define S(arg) #arg
  12302. +#define D(arg) S(arg)
  12303. +/*
  12304. + * scratchpad1 is owned by the LDSR.
  12305. + *
  12306. + * The upper bits provide 16 global spinlocks. Acquiring one of these
  12307. + * global spinlocks synchornizes across multiple threads and prevents
  12308. + * the LDSR from delivering any interrupts while the lock is held.
  12309. + * Use these locks only when absolutely required.
  12310. + *
  12311. + * The lower 16 bits of scratchpad1 are used as per thread interrupt
  12312. + * enable/disable bits. These bits will prevent a thread from receiving
  12313. + * any interrupts.
  12314. + *
  12315. + * Bit Usage:
  12316. + * - MT_EN_LOCK_BIT - Protects writes to MT_EN, so code can read current value
  12317. + * then write a new value atomically (profiler for example)
  12318. + * - ATOMIC_LOCK_BIT - Used to provide general purpose atomic handling.
  12319. + * - LDSR_LOCK_BIT - Used by the LDSR exclusively to provide protection.
  12320. + * - LSB 16 bits - Used by the LDSR to represent thread enable/disable bits.
  12321. + */
  12322. +#define MT_EN_LOCK_BIT 31
  12323. +#define ATOMIC_LOCK_BIT 30
  12324. +#define LDSR_LOCK_BIT 29
  12325. +#define PCI_LOCK_BIT 28
  12326. +
  12327. +#if !defined(__ASSEMBLY__)
  12328. +
  12329. +#define UBICOM32_TRYLOCK(bit) \
  12330. + asm volatile ( \
  12331. + " move.4 %0, #0 \n\t" \
  12332. + " bset scratchpad1, scratchpad1, #"D(bit)" \n\t" \
  12333. + " jmpne.f 1f \n\t" \
  12334. + " move.4 %0, #1 \n\t" \
  12335. + "1: \n\t" \
  12336. + : "=r" (ret) \
  12337. + : \
  12338. + : "cc", "memory" \
  12339. + ); \
  12340. +
  12341. +#define UBICOM32_UNLOCK(bit) \
  12342. + asm volatile ( \
  12343. + " bclr scratchpad1, scratchpad1, #"D(bit)" \n\t" \
  12344. + : \
  12345. + : \
  12346. + : "cc", "memory" \
  12347. + ); \
  12348. +
  12349. +#define UBICOM32_LOCK(bit) \
  12350. + asm volatile ( \
  12351. + "1: bset scratchpad1, scratchpad1, #"D(bit)" \n\t" \
  12352. + " jmpne.f 1b \n\t" \
  12353. + : \
  12354. + : \
  12355. + : "cc", "memory" \
  12356. + ); \
  12357. +
  12358. +/*
  12359. + * __atomic_lock_trylock()
  12360. + * Attempt to acquire the lock, return TRUE if acquired.
  12361. + */
  12362. +static inline int __atomic_lock_trylock(void)
  12363. +{
  12364. + int ret;
  12365. + UBICOM32_TRYLOCK(ATOMIC_LOCK_BIT);
  12366. + return ret;
  12367. +}
  12368. +
  12369. +/*
  12370. + * __atomic_lock_release()
  12371. + * Release the global atomic lock.
  12372. + *
  12373. + * Note: no one is suspended waiting since this lock is a spinning lock.
  12374. + */
  12375. +static inline void __atomic_lock_release(void)
  12376. +{
  12377. + UBICOM32_UNLOCK(ATOMIC_LOCK_BIT);
  12378. +}
  12379. +
  12380. +/*
  12381. + * __atomic_lock_acquire()
  12382. + * Acquire the global atomic lock, spin if not available.
  12383. + */
  12384. +static inline void __atomic_lock_acquire(void)
  12385. +{
  12386. + UBICOM32_LOCK(ATOMIC_LOCK_BIT);
  12387. +}
  12388. +#else /* __ASSEMBLY__ */
  12389. +
  12390. +#include <asm/ubicom32-common-asm.h>
  12391. +
  12392. +#endif /* __ASSEMBLY__ */
  12393. +#endif /* _ASM_UBICOM32_UBICOM32_COMMON_H */
  12394. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/ucontext.h linux-2.6.28.10/arch/ubicom32/include/asm/ucontext.h
  12395. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/ucontext.h 1970-01-01 02:00:00.000000000 +0200
  12396. +++ linux-2.6.28.10/arch/ubicom32/include/asm/ucontext.h 2009-08-06 10:31:02.000000000 +0300
  12397. @@ -0,0 +1,39 @@
  12398. +/*
  12399. + * arch/ubicom32/include/asm/ucontext.h
  12400. + * Definition of ucontext structure for Ubicom32 architecture.
  12401. + *
  12402. + * (C) Copyright 2009, Ubicom, Inc.
  12403. + *
  12404. + * This file is part of the Ubicom32 Linux Kernel Port.
  12405. + *
  12406. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  12407. + * it and/or modify it under the terms of the GNU General Public License
  12408. + * as published by the Free Software Foundation, either version 2 of the
  12409. + * License, or (at your option) any later version.
  12410. + *
  12411. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  12412. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  12413. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  12414. + * the GNU General Public License for more details.
  12415. + *
  12416. + * You should have received a copy of the GNU General Public License
  12417. + * along with the Ubicom32 Linux Kernel Port. If not,
  12418. + * see <http://www.gnu.org/licenses/>.
  12419. + *
  12420. + * Ubicom32 implementation derived from (with many thanks):
  12421. + * arch/m68knommu
  12422. + * arch/blackfin
  12423. + * arch/parisc
  12424. + */
  12425. +#ifndef _ASM_UBICOM32_UCONTEXT_H
  12426. +#define _ASM_UBICOM32_UCONTEXT_H
  12427. +
  12428. +struct ucontext {
  12429. + unsigned long uc_flags;
  12430. + struct ucontext *uc_link;
  12431. + stack_t uc_stack;
  12432. + struct sigcontext uc_mcontext;
  12433. + sigset_t uc_sigmask; /* mask last for extensibility */
  12434. +};
  12435. +
  12436. +#endif /* _ASM_UBICOM32_UCONTEXT_H */
  12437. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/unaligned.h linux-2.6.28.10/arch/ubicom32/include/asm/unaligned.h
  12438. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/unaligned.h 1970-01-01 02:00:00.000000000 +0200
  12439. +++ linux-2.6.28.10/arch/ubicom32/include/asm/unaligned.h 2009-08-06 10:31:02.000000000 +0300
  12440. @@ -0,0 +1,44 @@
  12441. +/*
  12442. + * arch/ubicom32/include/asm/unaligned.h
  12443. + * Ubicom32 architecture unaligned memory access definitions.
  12444. + *
  12445. + * (C) Copyright 2009, Ubicom, Inc.
  12446. + *
  12447. + * This file is part of the Ubicom32 Linux Kernel Port.
  12448. + *
  12449. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  12450. + * it and/or modify it under the terms of the GNU General Public License
  12451. + * as published by the Free Software Foundation, either version 2 of the
  12452. + * License, or (at your option) any later version.
  12453. + *
  12454. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  12455. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  12456. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  12457. + * the GNU General Public License for more details.
  12458. + *
  12459. + * You should have received a copy of the GNU General Public License
  12460. + * along with the Ubicom32 Linux Kernel Port. If not,
  12461. + * see <http://www.gnu.org/licenses/>.
  12462. + *
  12463. + * Ubicom32 implementation derived from (with many thanks):
  12464. + * arch/m68knommu
  12465. + * arch/blackfin
  12466. + * arch/parisc
  12467. + *
  12468. + * TODO: This is a copy of arm unaligned handling that probably needs
  12469. + * to be optimized for UBICOM32, but it works for now.
  12470. + */
  12471. +
  12472. +#ifndef _ASM_UBICOM32_UNALIGNED_H
  12473. +#define _ASM_UBICOM32_UNALIGNED_H
  12474. +
  12475. +#include <asm/types.h>
  12476. +
  12477. +#include <linux/unaligned/le_byteshift.h>
  12478. +#include <linux/unaligned/be_byteshift.h>
  12479. +#include <linux/unaligned/generic.h>
  12480. +
  12481. +#define get_unaligned __get_unaligned_be
  12482. +#define put_unaligned __put_unaligned_be
  12483. +
  12484. +#endif /* _ASM_UBICOM32_UNALIGNED_H */
  12485. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/unistd.h linux-2.6.28.10/arch/ubicom32/include/asm/unistd.h
  12486. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/unistd.h 1970-01-01 02:00:00.000000000 +0200
  12487. +++ linux-2.6.28.10/arch/ubicom32/include/asm/unistd.h 2009-08-06 10:31:02.000000000 +0300
  12488. @@ -0,0 +1,400 @@
  12489. +/*
  12490. + * arch/ubicom32/include/asm/unistd.h
  12491. + * Ubicom32 architecture syscall definitions.
  12492. + *
  12493. + * (C) Copyright 2009, Ubicom, Inc.
  12494. + *
  12495. + * This file is part of the Ubicom32 Linux Kernel Port.
  12496. + *
  12497. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  12498. + * it and/or modify it under the terms of the GNU General Public License
  12499. + * as published by the Free Software Foundation, either version 2 of the
  12500. + * License, or (at your option) any later version.
  12501. + *
  12502. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  12503. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  12504. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  12505. + * the GNU General Public License for more details.
  12506. + *
  12507. + * You should have received a copy of the GNU General Public License
  12508. + * along with the Ubicom32 Linux Kernel Port. If not,
  12509. + * see <http://www.gnu.org/licenses/>.
  12510. + *
  12511. + * Ubicom32 implementation derived from (with many thanks):
  12512. + * arch/m68knommu
  12513. + * arch/blackfin
  12514. + * arch/parisc
  12515. + */
  12516. +#ifndef _ASM_UBICOM32_UNISTD_H
  12517. +#define _ASM_UBICOM32_UNISTD_H
  12518. +
  12519. +/*
  12520. + * This file contains the system call numbers.
  12521. + */
  12522. +
  12523. +#define __NR_restart_syscall 0
  12524. +#define __NR_exit 1
  12525. +#define __NR_fork 2
  12526. +#define __NR_read 3
  12527. +#define __NR_write 4
  12528. +#define __NR_open 5
  12529. +#define __NR_close 6
  12530. +#define __NR_waitpid 7
  12531. +#define __NR_creat 8
  12532. +#define __NR_link 9
  12533. +#define __NR_unlink 10
  12534. +#define __NR_execve 11
  12535. +#define __NR_chdir 12
  12536. +#define __NR_time 13
  12537. +#define __NR_mknod 14
  12538. +#define __NR_chmod 15
  12539. +#define __NR_chown 16
  12540. +#define __NR_break 17
  12541. +#define __NR_oldstat 18
  12542. +#define __NR_lseek 19
  12543. +#define __NR_getpid 20
  12544. +#define __NR_mount 21
  12545. +#define __NR_umount 22
  12546. +#define __NR_setuid 23
  12547. +#define __NR_getuid 24
  12548. +#define __NR_stime 25
  12549. +#define __NR_ptrace 26
  12550. +#define __NR_alarm 27
  12551. +#define __NR_oldfstat 28
  12552. +#define __NR_pause 29
  12553. +#define __NR_utime 30
  12554. +#define __NR_stty 31
  12555. +#define __NR_gtty 32
  12556. +#define __NR_access 33
  12557. +#define __NR_nice 34
  12558. +#define __NR_ftime 35
  12559. +#define __NR_sync 36
  12560. +#define __NR_kill 37
  12561. +#define __NR_rename 38
  12562. +#define __NR_mkdir 39
  12563. +#define __NR_rmdir 40
  12564. +#define __NR_dup 41
  12565. +#define __NR_pipe 42
  12566. +#define __NR_times 43
  12567. +#define __NR_prof 44
  12568. +#define __NR_brk 45
  12569. +#define __NR_setgid 46
  12570. +#define __NR_getgid 47
  12571. +#define __NR_signal 48
  12572. +#define __NR_geteuid 49
  12573. +#define __NR_getegid 50
  12574. +#define __NR_acct 51
  12575. +#define __NR_umount2 52
  12576. +#define __NR_lock 53
  12577. +#define __NR_ioctl 54
  12578. +#define __NR_fcntl 55
  12579. +#define __NR_mpx 56
  12580. +#define __NR_setpgid 57
  12581. +#define __NR_ulimit 58
  12582. +#define __NR_oldolduname 59
  12583. +#define __NR_umask 60
  12584. +#define __NR_chroot 61
  12585. +#define __NR_ustat 62
  12586. +#define __NR_dup2 63
  12587. +#define __NR_getppid 64
  12588. +#define __NR_getpgrp 65
  12589. +#define __NR_setsid 66
  12590. +#define __NR_sigaction 67
  12591. +#define __NR_sgetmask 68
  12592. +#define __NR_ssetmask 69
  12593. +#define __NR_setreuid 70
  12594. +#define __NR_setregid 71
  12595. +#define __NR_sigsuspend 72
  12596. +#define __NR_sigpending 73
  12597. +#define __NR_sethostname 74
  12598. +#define __NR_setrlimit 75
  12599. +#define __NR_getrlimit 76
  12600. +#define __NR_getrusage 77
  12601. +#define __NR_gettimeofday 78
  12602. +#define __NR_settimeofday 79
  12603. +#define __NR_getgroups 80
  12604. +#define __NR_setgroups 81
  12605. +#define __NR_select 82
  12606. +#define __NR_symlink 83
  12607. +#define __NR_oldlstat 84
  12608. +#define __NR_readlink 85
  12609. +#define __NR_uselib 86
  12610. +#define __NR_swapon 87
  12611. +#define __NR_reboot 88
  12612. +#define __NR_readdir 89
  12613. +#define __NR_mmap 90
  12614. +#define __NR_munmap 91
  12615. +#define __NR_truncate 92
  12616. +#define __NR_ftruncate 93
  12617. +#define __NR_fchmod 94
  12618. +#define __NR_fchown 95
  12619. +#define __NR_getpriority 96
  12620. +#define __NR_setpriority 97
  12621. +#define __NR_profil 98
  12622. +#define __NR_statfs 99
  12623. +#define __NR_fstatfs 100
  12624. +#define __NR_ioperm 101
  12625. +#define __NR_socketcall 102
  12626. +#define __NR_syslog 103
  12627. +#define __NR_setitimer 104
  12628. +#define __NR_getitimer 105
  12629. +#define __NR_stat 106
  12630. +#define __NR_lstat 107
  12631. +#define __NR_fstat 108
  12632. +#define __NR_olduname 109
  12633. +#define __NR_iopl /* 110 */ not supported
  12634. +#define __NR_vhangup 111
  12635. +#define __NR_idle /* 112 */ Obsolete
  12636. +#define __NR_vm86 /* 113 */ not supported
  12637. +#define __NR_wait4 114
  12638. +#define __NR_swapoff 115
  12639. +#define __NR_sysinfo 116
  12640. +#define __NR_ipc 117
  12641. +#define __NR_fsync 118
  12642. +#define __NR_sigreturn 119
  12643. +#define __NR_clone 120
  12644. +#define __NR_setdomainname 121
  12645. +#define __NR_uname 122
  12646. +#define __NR_cacheflush 123
  12647. +#define __NR_adjtimex 124
  12648. +#define __NR_mprotect 125
  12649. +#define __NR_sigprocmask 126
  12650. +#define __NR_create_module 127
  12651. +#define __NR_init_module 128
  12652. +#define __NR_delete_module 129
  12653. +#define __NR_get_kernel_syms 130
  12654. +#define __NR_quotactl 131
  12655. +#define __NR_getpgid 132
  12656. +#define __NR_fchdir 133
  12657. +#define __NR_bdflush 134
  12658. +#define __NR_sysfs 135
  12659. +#define __NR_personality 136
  12660. +#define __NR_afs_syscall 137 /* Syscall for Andrew File System */
  12661. +#define __NR_setfsuid 138
  12662. +#define __NR_setfsgid 139
  12663. +#define __NR__llseek 140
  12664. +#define __NR_getdents 141
  12665. +#define __NR__newselect 142
  12666. +#define __NR_flock 143
  12667. +#define __NR_msync 144
  12668. +#define __NR_readv 145
  12669. +#define __NR_writev 146
  12670. +#define __NR_getsid 147
  12671. +#define __NR_fdatasync 148
  12672. +#define __NR__sysctl 149
  12673. +#define __NR_mlock 150
  12674. +#define __NR_munlock 151
  12675. +#define __NR_mlockall 152
  12676. +#define __NR_munlockall 153
  12677. +#define __NR_sched_setparam 154
  12678. +#define __NR_sched_getparam 155
  12679. +#define __NR_sched_setscheduler 156
  12680. +#define __NR_sched_getscheduler 157
  12681. +#define __NR_sched_yield 158
  12682. +#define __NR_sched_get_priority_max 159
  12683. +#define __NR_sched_get_priority_min 160
  12684. +#define __NR_sched_rr_get_interval 161
  12685. +#define __NR_nanosleep 162
  12686. +#define __NR_mremap 163
  12687. +#define __NR_setresuid 164
  12688. +#define __NR_getresuid 165
  12689. +#define __NR_getpagesize 166
  12690. +#define __NR_query_module 167
  12691. +#define __NR_poll 168
  12692. +#define __NR_nfsservctl 169
  12693. +#define __NR_setresgid 170
  12694. +#define __NR_getresgid 171
  12695. +#define __NR_prctl 172
  12696. +#define __NR_rt_sigreturn 173
  12697. +#define __NR_rt_sigaction 174
  12698. +#define __NR_rt_sigprocmask 175
  12699. +#define __NR_rt_sigpending 176
  12700. +#define __NR_rt_sigtimedwait 177
  12701. +#define __NR_rt_sigqueueinfo 178
  12702. +#define __NR_rt_sigsuspend 179
  12703. +#define __NR_pread64 180
  12704. +#define __NR_pwrite64 181
  12705. +#define __NR_lchown 182
  12706. +#define __NR_getcwd 183
  12707. +#define __NR_capget 184
  12708. +#define __NR_capset 185
  12709. +#define __NR_sigaltstack 186
  12710. +#define __NR_sendfile 187
  12711. +#define __NR_getpmsg 188 /* some people actually want streams */
  12712. +#define __NR_putpmsg 189 /* some people actually want streams */
  12713. +#define __NR_vfork 190
  12714. +#define __NR_ugetrlimit 191
  12715. +#define __NR_mmap2 192
  12716. +#define __NR_truncate64 193
  12717. +#define __NR_ftruncate64 194
  12718. +#define __NR_stat64 195
  12719. +#define __NR_lstat64 196
  12720. +#define __NR_fstat64 197
  12721. +#define __NR_chown32 198
  12722. +#define __NR_getuid32 199
  12723. +#define __NR_getgid32 200
  12724. +#define __NR_geteuid32 201
  12725. +#define __NR_getegid32 202
  12726. +#define __NR_setreuid32 203
  12727. +#define __NR_setregid32 204
  12728. +#define __NR_getgroups32 205
  12729. +#define __NR_setgroups32 206
  12730. +#define __NR_fchown32 207
  12731. +#define __NR_setresuid32 208
  12732. +#define __NR_getresuid32 209
  12733. +#define __NR_setresgid32 210
  12734. +#define __NR_getresgid32 211
  12735. +#define __NR_lchown32 212
  12736. +#define __NR_setuid32 213
  12737. +#define __NR_setgid32 214
  12738. +#define __NR_setfsuid32 215
  12739. +#define __NR_setfsgid32 216
  12740. +#define __NR_pivot_root 217
  12741. +#define __NR_getdents64 220
  12742. +#define __NR_gettid 221
  12743. +#define __NR_tkill 222
  12744. +#define __NR_setxattr 223
  12745. +#define __NR_lsetxattr 224
  12746. +#define __NR_fsetxattr 225
  12747. +#define __NR_getxattr 226
  12748. +#define __NR_lgetxattr 227
  12749. +#define __NR_fgetxattr 228
  12750. +#define __NR_listxattr 229
  12751. +#define __NR_llistxattr 230
  12752. +#define __NR_flistxattr 231
  12753. +#define __NR_removexattr 232
  12754. +#define __NR_lremovexattr 233
  12755. +#define __NR_fremovexattr 234
  12756. +#define __NR_futex 235
  12757. +#define __NR_sendfile64 236
  12758. +#define __NR_mincore 237
  12759. +#define __NR_madvise 238
  12760. +#define __NR_fcntl64 239
  12761. +#define __NR_readahead 240
  12762. +#define __NR_io_setup 241
  12763. +#define __NR_io_destroy 242
  12764. +#define __NR_io_getevents 243
  12765. +#define __NR_io_submit 244
  12766. +#define __NR_io_cancel 245
  12767. +#define __NR_fadvise64 246
  12768. +#define __NR_exit_group 247
  12769. +#define __NR_lookup_dcookie 248
  12770. +#define __NR_epoll_create 249
  12771. +#define __NR_epoll_ctl 250
  12772. +#define __NR_epoll_wait 251
  12773. +#define __NR_remap_file_pages 252
  12774. +#define __NR_set_tid_address 253
  12775. +#define __NR_timer_create 254
  12776. +#define __NR_timer_settime 255
  12777. +#define __NR_timer_gettime 256
  12778. +#define __NR_timer_getoverrun 257
  12779. +#define __NR_timer_delete 258
  12780. +#define __NR_clock_settime 259
  12781. +#define __NR_clock_gettime 260
  12782. +#define __NR_clock_getres 261
  12783. +#define __NR_clock_nanosleep 262
  12784. +#define __NR_statfs64 263
  12785. +#define __NR_fstatfs64 264
  12786. +#define __NR_tgkill 265
  12787. +#define __NR_utimes 266
  12788. +#define __NR_fadvise64_64 267
  12789. +#define __NR_mbind 268
  12790. +#define __NR_get_mempolicy 269
  12791. +#define __NR_set_mempolicy 270
  12792. +#define __NR_mq_open 271
  12793. +#define __NR_mq_unlink 272
  12794. +#define __NR_mq_timedsend 273
  12795. +#define __NR_mq_timedreceive 274
  12796. +#define __NR_mq_notify 275
  12797. +#define __NR_mq_getsetattr 276
  12798. +#define __NR_waitid 277
  12799. +#define __NR_vserver 278
  12800. +#define __NR_add_key 279
  12801. +#define __NR_request_key 280
  12802. +#define __NR_keyctl 281
  12803. +#define __NR_ioprio_set 282
  12804. +#define __NR_ioprio_get 283
  12805. +#define __NR_inotify_init 284
  12806. +#define __NR_inotify_add_watch 285
  12807. +#define __NR_inotify_rm_watch 286
  12808. +#define __NR_migrate_pages 287
  12809. +#define __NR_openat 288
  12810. +#define __NR_mkdirat 289
  12811. +#define __NR_mknodat 290
  12812. +#define __NR_fchownat 291
  12813. +#define __NR_futimesat 292
  12814. +#define __NR_fstatat64 293
  12815. +#define __NR_unlinkat 294
  12816. +#define __NR_renameat 295
  12817. +#define __NR_linkat 296
  12818. +#define __NR_symlinkat 297
  12819. +#define __NR_readlinkat 298
  12820. +#define __NR_fchmodat 299
  12821. +#define __NR_faccessat 300
  12822. +#define __NR_pselect6 301
  12823. +#define __NR_ppoll 302
  12824. +#define __NR_unshare 303
  12825. +#define __NR_set_robust_list 304
  12826. +#define __NR_get_robust_list 305
  12827. +#define __NR_splice 306
  12828. +#define __NR_sync_file_range 307
  12829. +#define __NR_tee 308
  12830. +#define __NR_vmsplice 309
  12831. +#define __NR_move_pages 310
  12832. +#define __NR_sched_setaffinity 311
  12833. +#define __NR_sched_getaffinity 312
  12834. +#define __NR_kexec_load 313
  12835. +#define __NR_getcpu 314
  12836. +#define __NR_epoll_pwait 315
  12837. +#define __NR_utimensat 316
  12838. +#define __NR_signalfd 317
  12839. +#define __NR_timerfd_create 318
  12840. +#define __NR_eventfd 319
  12841. +#define __NR_fallocate 320
  12842. +#define __NR_timerfd_settime 321
  12843. +#define __NR_timerfd_gettime 322
  12844. +#define __NR_signalfd4 323
  12845. +#define __NR_eventfd2 324
  12846. +#define __NR_epoll_create1 325
  12847. +#define __NR_dup3 326
  12848. +#define __NR_pipe2 327
  12849. +#define __NR_inotify_init1 328
  12850. +
  12851. +#ifdef __KERNEL__
  12852. +
  12853. +#define NR_syscalls 329
  12854. +
  12855. +#define __ARCH_WANT_IPC_PARSE_VERSION
  12856. +#define __ARCH_WANT_OLD_READDIR
  12857. +#define __ARCH_WANT_OLD_STAT
  12858. +#define __ARCH_WANT_STAT64
  12859. +#define __ARCH_WANT_SYS_ALARM
  12860. +#define __ARCH_WANT_SYS_GETHOSTNAME
  12861. +#define __ARCH_WANT_SYS_PAUSE
  12862. +#define __ARCH_WANT_SYS_SGETMASK
  12863. +#define __ARCH_WANT_SYS_SIGNAL
  12864. +#define __ARCH_WANT_SYS_TIME
  12865. +#define __ARCH_WANT_SYS_UTIME
  12866. +#define __ARCH_WANT_SYS_WAITPID
  12867. +#define __ARCH_WANT_SYS_SOCKETCALL
  12868. +#define __ARCH_WANT_SYS_FADVISE64
  12869. +#define __ARCH_WANT_SYS_GETPGRP
  12870. +#define __ARCH_WANT_SYS_LLSEEK
  12871. +#define __ARCH_WANT_SYS_NICE
  12872. +#define __ARCH_WANT_SYS_OLD_GETRLIMIT
  12873. +#define __ARCH_WANT_SYS_OLDUMOUNT
  12874. +#define __ARCH_WANT_SYS_SIGPENDING
  12875. +#define __ARCH_WANT_SYS_SIGPROCMASK
  12876. +#define __ARCH_WANT_SYS_RT_SIGACTION
  12877. +
  12878. +/*
  12879. + * "Conditional" syscalls
  12880. + *
  12881. + * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
  12882. + * but it doesn't work on all toolchains, so we just do it by hand
  12883. + */
  12884. +//#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
  12885. +#define cond_syscall(x) long x(void) __attribute__((weak,alias("sys_ni_syscall")))
  12886. +#endif /* __KERNEL__ */
  12887. +
  12888. +#endif /* _ASM_UBICOM32_UNISTD_H */
  12889. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/user.h linux-2.6.28.10/arch/ubicom32/include/asm/user.h
  12890. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/user.h 1970-01-01 02:00:00.000000000 +0200
  12891. +++ linux-2.6.28.10/arch/ubicom32/include/asm/user.h 2009-08-12 13:08:37.000000000 +0300
  12892. @@ -0,0 +1,82 @@
  12893. +/*
  12894. + * arch/ubicom32/include/asm/user.h
  12895. + * Ubicom32 architecture core file definitions.
  12896. + *
  12897. + * (C) Copyright 2009, Ubicom, Inc.
  12898. + *
  12899. + * This file is part of the Ubicom32 Linux Kernel Port.
  12900. + *
  12901. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  12902. + * it and/or modify it under the terms of the GNU General Public License
  12903. + * as published by the Free Software Foundation, either version 2 of the
  12904. + * License, or (at your option) any later version.
  12905. + *
  12906. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  12907. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  12908. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  12909. + * the GNU General Public License for more details.
  12910. + *
  12911. + * You should have received a copy of the GNU General Public License
  12912. + * along with the Ubicom32 Linux Kernel Port. If not,
  12913. + * see <http://www.gnu.org/licenses/>.
  12914. + *
  12915. + * Ubicom32 implementation derived from (with many thanks):
  12916. + * arch/m68knommu
  12917. + * arch/blackfin
  12918. + * arch/parisc
  12919. + */
  12920. +#ifndef _ASM_UBICOM32_USER_H
  12921. +#define _ASM_UBICOM32_USER_H
  12922. +
  12923. +#include <asm/ptrace.h>
  12924. +#include <asm/page.h>
  12925. +/*
  12926. + * Adapted from <asm-powerpc/user.h>
  12927. + *
  12928. + * Core file format: The core file is written in such a way that gdb
  12929. + * can understand it and provide useful information to the user (under
  12930. + * linux we use the `trad-core' bfd, NOT the osf-core). The file contents
  12931. + * are as follows:
  12932. + *
  12933. + * upage: 1 page consisting of a user struct that tells gdb
  12934. + * what is present in the file. Directly after this is a
  12935. + * copy of the task_struct, which is currently not used by gdb,
  12936. + * but it may come in handy at some point. All of the registers
  12937. + * are stored as part of the upage. The upage should always be
  12938. + * only one page long.
  12939. + * data: The data segment follows next. We use current->end_text to
  12940. + * current->brk to pick up all of the user variables, plus any memory
  12941. + * that may have been sbrk'ed. No attempt is made to determine if a
  12942. + * page is demand-zero or if a page is totally unused, we just cover
  12943. + * the entire range. All of the addresses are rounded in such a way
  12944. + * that an integral number of pages is written.
  12945. + * stack: We need the stack information in order to get a meaningful
  12946. + * backtrace. We need to write the data from usp to
  12947. + * current->start_stack, so we round each of these in order to be able
  12948. + * to write an integer number of pages.
  12949. + */
  12950. +
  12951. +struct user_ubicom32fp_struct {
  12952. +};
  12953. +
  12954. +struct user {
  12955. + struct pt_regs regs; /* entire machine state */
  12956. + size_t u_tsize; /* text size (pages) */
  12957. + size_t u_dsize; /* data size (pages) */
  12958. + size_t u_ssize; /* stack size (pages) */
  12959. + unsigned long start_code; /* text starting address */
  12960. + unsigned long start_data; /* data starting address */
  12961. + unsigned long start_stack; /* stack starting address */
  12962. + long int signal; /* signal causing core dump */
  12963. + unsigned long u_ar0; /* help gdb find registers */
  12964. + unsigned long magic; /* identifies a core file */
  12965. + char u_comm[32]; /* user command name */
  12966. +};
  12967. +
  12968. +#define NBPG PAGE_SIZE
  12969. +#define UPAGES 1
  12970. +#define HOST_TEXT_START_ADDR (u.start_code)
  12971. +#define HOST_DATA_START_ADDR (u.start_data)
  12972. +#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
  12973. +
  12974. +#endif /* _ASM_UBICOM32_USER_H */
  12975. diff -ruN linux-2.6.28.10_o/arch/ubicom32/include/asm/xor.h linux-2.6.28.10/arch/ubicom32/include/asm/xor.h
  12976. --- linux-2.6.28.10_o/arch/ubicom32/include/asm/xor.h 1970-01-01 02:00:00.000000000 +0200
  12977. +++ linux-2.6.28.10/arch/ubicom32/include/asm/xor.h 2009-08-06 10:31:02.000000000 +0300
  12978. @@ -0,0 +1,33 @@
  12979. +/*
  12980. + * arch/ubicom32/include/asm/xor.h
  12981. + * Generic xor.h definitions for Ubicom32 architecture.
  12982. + *
  12983. + * (C) Copyright 2009, Ubicom, Inc.
  12984. + *
  12985. + * This file is part of the Ubicom32 Linux Kernel Port.
  12986. + *
  12987. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  12988. + * it and/or modify it under the terms of the GNU General Public License
  12989. + * as published by the Free Software Foundation, either version 2 of the
  12990. + * License, or (at your option) any later version.
  12991. + *
  12992. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  12993. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  12994. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  12995. + * the GNU General Public License for more details.
  12996. + *
  12997. + * You should have received a copy of the GNU General Public License
  12998. + * along with the Ubicom32 Linux Kernel Port. If not,
  12999. + * see <http://www.gnu.org/licenses/>.
  13000. + *
  13001. + * Ubicom32 implementation derived from (with many thanks):
  13002. + * arch/m68knommu
  13003. + * arch/blackfin
  13004. + * arch/parisc
  13005. + */
  13006. +#ifndef _ASM_UBICOM32_XOR_H
  13007. +#define _ASM_UBICOM32_XOR_H
  13008. +
  13009. +#include <asm-generic/xor.h>
  13010. +
  13011. +#endif /* _ASM_UBICOM32_XOR_H */
  13012. diff -ruN linux-2.6.28.10_o/arch/ubicom32/Kconfig linux-2.6.28.10/arch/ubicom32/Kconfig
  13013. --- linux-2.6.28.10_o/arch/ubicom32/Kconfig 1970-01-01 02:00:00.000000000 +0200
  13014. +++ linux-2.6.28.10/arch/ubicom32/Kconfig 2009-08-12 13:08:37.000000000 +0300
  13015. @@ -0,0 +1,457 @@
  13016. +#
  13017. +# For a description of the syntax of this configuration file,
  13018. +# see Documentation/kbuild/kconfig-language.txt.
  13019. +#
  13020. +
  13021. +mainmenu "uClinux/ubicom32 (w/o MMU) Kernel Configuration"
  13022. +
  13023. +config RAMBASE
  13024. + hex
  13025. + default "0x40000000"
  13026. + help
  13027. + Define the address that RAM starts at.
  13028. +
  13029. +config UBICOM32
  13030. + bool
  13031. + select HAVE_OPROFILE
  13032. + default y
  13033. +
  13034. +config RAMKERNEL
  13035. + bool
  13036. + default y
  13037. +
  13038. +config CPU_BIG_ENDIAN
  13039. + bool
  13040. + default y
  13041. +
  13042. +config FORCE_MAX_ZONEORDER
  13043. + int
  13044. + default "14"
  13045. +
  13046. +config HAVE_CLK
  13047. + bool
  13048. + default y
  13049. +
  13050. +config MMU
  13051. + bool
  13052. + default n
  13053. +
  13054. +config FPU
  13055. + bool
  13056. + default n
  13057. +
  13058. +config ZONE_DMA
  13059. + bool
  13060. + default y
  13061. +
  13062. +config RWSEM_GENERIC_SPINLOCK
  13063. + bool
  13064. + default y
  13065. +
  13066. +config RWSEM_XCHGADD_ALGORITHM
  13067. + bool
  13068. + default n
  13069. +
  13070. +config ARCH_HAS_ILOG2_U32
  13071. + bool
  13072. + default n
  13073. +
  13074. +config ARCH_HAS_ILOG2_U64
  13075. + bool
  13076. + default n
  13077. +
  13078. +config GENERIC_FIND_NEXT_BIT
  13079. + bool
  13080. + default y
  13081. +
  13082. +config GENERIC_GPIO
  13083. + bool
  13084. + default y
  13085. +
  13086. +config GPIOLIB
  13087. + bool
  13088. + default y
  13089. +
  13090. +config GENERIC_HWEIGHT
  13091. + bool
  13092. + default y
  13093. +
  13094. +config GENERIC_HARDIRQS
  13095. + bool
  13096. + default y
  13097. +
  13098. +config STACKTRACE_SUPPORT
  13099. + bool
  13100. + default y
  13101. +
  13102. +config LOCKDEP_SUPPORT
  13103. + bool
  13104. + default y
  13105. +
  13106. +config GENERIC_CALIBRATE_DELAY
  13107. + bool
  13108. + default y
  13109. +
  13110. +config GENERIC_TIME
  13111. + bool
  13112. + default y
  13113. +
  13114. +config TIME_LOW_RES
  13115. + bool
  13116. + default y
  13117. +
  13118. +config GENERIC_CLOCKEVENTS
  13119. + bool
  13120. + default y
  13121. +
  13122. +config GENERIC_CLOCKEVENTS_BROADCAST
  13123. + bool
  13124. + depends on GENERIC_CLOCKEVENTS
  13125. + default y if SMP && !LOCAL_TIMERS
  13126. +
  13127. +config NO_IOPORT
  13128. + def_bool y
  13129. +
  13130. +config ARCH_SUPPORTS_AOUT
  13131. + def_bool y
  13132. +
  13133. +config IRQ_PER_CPU
  13134. + bool
  13135. + default y
  13136. +
  13137. +config SCHED_NO_NO_OMIT_FRAME_POINTER
  13138. + bool
  13139. + default y
  13140. +
  13141. +menu "Processor type and features"
  13142. +
  13143. +config BRD_32MB
  13144. + bool
  13145. + depends on IP5160EVAL
  13146. + help
  13147. + Board has 32MB of RAM on it. It is a hidden option used to select default for size of RAM
  13148. + default n
  13149. +
  13150. +config BRD_64MB
  13151. + bool
  13152. + depends on IP7145DPF || IP7160RGW || IP7160BRINGUP || IP7160DPF || IP5170DPF || IP5160DEV
  13153. + help
  13154. + Board has 64MB of RAM on it. It is a hidden option used to select default for size of RAM
  13155. + default n
  13156. +
  13157. +config BRD_128MB
  13158. + bool
  13159. + depends on IP7500MODULE || IP7500AV || IP7500MEDIA
  13160. + help
  13161. + Board has 128MB of RAM on it. It is a hidden option used to select default for size of RAM
  13162. + default n
  13163. +
  13164. +comment "Processor type will be selected by Board"
  13165. +
  13166. +config UBICOM32_V3
  13167. + bool
  13168. + help
  13169. + Ubicom IP5xxx series processor support.
  13170. +
  13171. +config UBICOM32_V4
  13172. + bool
  13173. + help
  13174. + Ubicom IP7xxx series processor support.
  13175. +
  13176. +comment "Board"
  13177. +choice
  13178. + prompt "Board type"
  13179. + help
  13180. + Select your board.
  13181. +
  13182. +config NOBOARD
  13183. + bool "No board selected"
  13184. + help
  13185. + Default. Don't select any board specific config. Will not build unless you change!
  13186. +
  13187. +# Add your boards here
  13188. +source "arch/ubicom32/mach-ip5k/Kconfig"
  13189. +source "arch/ubicom32/mach-ip7k/Kconfig"
  13190. +
  13191. +endchoice
  13192. +
  13193. +comment "Kernel Options"
  13194. +config SMP
  13195. + bool "Symmetric multi-processing support"
  13196. + select USE_GENERIC_SMP_HELPERS
  13197. + default n
  13198. + help
  13199. + Enables multithreading support. Enabling SMP support increases
  13200. + the size of system data structures. SMP support can have either
  13201. + positive or negative impact on performance depending on workloads.
  13202. +
  13203. + If you do not know what to do here, say N.
  13204. +
  13205. +config NR_CPUS
  13206. + int "Number of configured CPUs"
  13207. + range 2 32
  13208. + default 2
  13209. + depends on SMP
  13210. + help
  13211. + Upper bound on the number of CPUs. Space is reserved
  13212. + at compile time for this many CPUs.
  13213. +
  13214. +config LOCAL_TIMERS
  13215. + bool "Use local timer interrupts"
  13216. + depends on SMP
  13217. + default y
  13218. + help
  13219. + Enable support for local timers on SMP platforms, rather then the
  13220. + legacy IPI broadcast method. Local timers allows the system
  13221. + accounting to be spread across the timer interval, preventing a
  13222. + "thundering herd" at every timer tick. A physical timer is allocated
  13223. + per cpu.
  13224. +
  13225. +config TIMER_EXTRA_ALLOC
  13226. + int "Number of additional physical timer events to create"
  13227. + depends on GENERIC_CLOCKEVENTS
  13228. + default 0
  13229. + help
  13230. + The Ubicom32 processor has a number of event timers that can be wrapped
  13231. + in Linux clock event structures (assuming that the timers are not being
  13232. + used for another purpose). Based on the value of LOCAL_TIMERS, either
  13233. + 2 timers will be used or a timer will be used for every CPU. This value
  13234. + allows the programmer to select additional timers over that amount.
  13235. +
  13236. +config IRQSTACKS
  13237. + bool "Create separate stacks for interrupt handling"
  13238. + default n
  13239. + help
  13240. + Selecting this causes interrupts to be created on a separate
  13241. + stack instead of nesting the interrupts on the kernel stack.
  13242. +
  13243. +config IRQSTACKS_USEOCM
  13244. + bool "Use OCM for interrupt stacks"
  13245. + default n
  13246. + depends on IRQSTACKS
  13247. + help
  13248. + Selecting this cause the interrupt stacks to be placed in OCM
  13249. + reducing cache misses at the expense of using the OCM for servicing
  13250. + interrupts.
  13251. +
  13252. +menu "OCM Instruction Heap"
  13253. +
  13254. +config OCM_MODULES_RESERVATION
  13255. + int "OCM Instruction heap reservation. 0-192 kB"
  13256. + range 0 192
  13257. + default "0"
  13258. + help
  13259. + The minimum amount of OCM memory to reserve for kernel loadable module
  13260. + code. If you are not using this memory it cannot be used for anything
  13261. + else. Leave it as 0 if you have prebuilt modules that are compiled with
  13262. + OCM support.
  13263. +
  13264. +config OCM_MODULES_MAY_CONSUME_REMAINING_CODESPACE
  13265. + bool "Give all unused ocm code space to the ocm instruction heap."
  13266. + default n
  13267. + help
  13268. + Allow the OCM instruction heap allocation to consume any remaining
  13269. + unused OCM code space. The result of this is that you will not have
  13270. + and deterministic results, but you will not have any waste either.
  13271. +
  13272. +config OCM_MODULES_FALLBACK_TO_DDR
  13273. + bool "Loadable Modules requiring OCM may fallback to use DDR."
  13274. + default n
  13275. + help
  13276. + If a module cannot get the OCM code it requires allow DDR to
  13277. + be used instead.
  13278. +endmenu
  13279. +
  13280. +config HZ
  13281. + int "Frequency of 'jiffies' (for polling)"
  13282. + default 1000
  13283. + help
  13284. + 100 is common for embedded systems, but 1000 allows
  13285. + you to do more drivers without actually having
  13286. + interrupts working properly.
  13287. +
  13288. +comment "RAM configuration"
  13289. +
  13290. +if BRD_32MB
  13291. +
  13292. +config RAMSIZE
  13293. + hex "Size of RAM (in bytes)"
  13294. + range 0x00000000 0x02000000
  13295. + default "0x02000000"
  13296. + help
  13297. + Define the size of the system RAM. If you select 0 then the
  13298. + kernel will try to probe the RAM size at runtime. This is not
  13299. + supported on all CPU types.
  13300. +
  13301. +endif
  13302. +
  13303. +if BRD_64MB
  13304. +
  13305. +config RAMSIZE
  13306. + hex "Size of RAM (in bytes)"
  13307. + range 0x00000000 0x04000000
  13308. + default "0x04000000"
  13309. + help
  13310. + Define the size of the system RAM. If you select 0 then the
  13311. + kernel will try to probe the RAM size at runtime. This is not
  13312. + supported on all CPU types.
  13313. +
  13314. +endif
  13315. +
  13316. +if BRD_128MB
  13317. +
  13318. +config RAMSIZE
  13319. + hex "Size of RAM (in bytes)"
  13320. + range 0x00000000 0x08000000
  13321. + default "0x08000000"
  13322. + help
  13323. + Define the size of the system RAM. If you select 0 then the
  13324. + kernel will try to probe the RAM size at runtime. This is not
  13325. + supported on all CPU types.
  13326. +
  13327. +endif
  13328. +
  13329. +config KERNELBASE
  13330. + hex "Address of the base of kernel code"
  13331. + default "0x40400000"
  13332. + help
  13333. + For the time being we are going to start the Kernel at a 4 meg offset.
  13334. +
  13335. +comment "Build options"
  13336. +config LINKER_RELAXATION
  13337. + bool "Linker Relaxation"
  13338. + default y
  13339. + help
  13340. + Turns on linker relaxation that will produce smaller
  13341. + faster code. Increases link time.
  13342. +
  13343. +comment "Driver options"
  13344. +menu "PCI Bus"
  13345. +config PCI
  13346. + bool "PCI bus"
  13347. + default true
  13348. + help
  13349. + Enable/Disable PCI bus
  13350. + source "drivers/pci/Kconfig"
  13351. +
  13352. +
  13353. +config PCI_DEV0_IDSEL
  13354. + hex "slot 0 address"
  13355. + depends on PCI
  13356. + default "0x01000000"
  13357. + help
  13358. + Slot 0 address. This address should correspond to the address line
  13359. + which the IDSEL bit for this slot is connected to.
  13360. +
  13361. +config PCI_DEV1_IDSEL
  13362. + hex "slot 1 address"
  13363. + depends on PCI
  13364. + default "0x02000000"
  13365. + help
  13366. + Slot 1 address. This address should correspond to the address line
  13367. + which the IDSEL bit for this slot is connected to.
  13368. +endmenu
  13369. +# End PCI
  13370. +
  13371. +menu "Input devices"
  13372. +config UBICOM_INPUT
  13373. + bool "Ubicom polled GPIO input driver"
  13374. + select INPUT
  13375. + select INPUT_POLLDEV
  13376. + help
  13377. + Polling input driver, much like the GPIO input driver, except that it doesn't
  13378. + rely on interrupts. It will report events via the input subsystem.
  13379. + default n
  13380. +
  13381. +config UBICOM_INPUT_I2C
  13382. + bool "Ubicom polled GPIO input driver over I2C"
  13383. + select INPUT
  13384. + select INPUT_POLLDEV
  13385. + help
  13386. + Polling input driver, much like the PCA953x driver, it can support a variety of
  13387. + different I2C I/O expanders. This device polls the I2C I/O expander for events
  13388. + and reports them via the input subsystem.
  13389. + default n
  13390. +endmenu
  13391. +# Input devices
  13392. +
  13393. +
  13394. +
  13395. +menu "Misc devices"
  13396. +config UBICOM_HID
  13397. + bool "Ubicom HID driver"
  13398. + select INPUT
  13399. + select INPUT_POLLDEV
  13400. + select LCD_CLASS_DEVICE
  13401. + help
  13402. + Driver for HID chip found on some Ubicom reference designs. This chip handles
  13403. + PWM, button input, and IR remote control. It registers as an input device and
  13404. + a backlight device.
  13405. + default n
  13406. +endmenu
  13407. +# Misc devices
  13408. +
  13409. +config CMDLINE_BOOL
  13410. + bool "Built-in kernel command line"
  13411. + default n
  13412. + help
  13413. + Allow for specifying boot arguments to the kernel at
  13414. + build time. On some systems (e.g. embedded ones), it is
  13415. + necessary or convenient to provide some or all of the
  13416. + kernel boot arguments with the kernel itself (that is,
  13417. + to not rely on the boot loader to provide them.)
  13418. +
  13419. + To compile command line arguments into the kernel,
  13420. + set this option to 'Y', then fill in the
  13421. + the boot arguments in CONFIG_CMDLINE.
  13422. +
  13423. + Systems with fully functional boot loaders (i.e. non-embedded)
  13424. + should leave this option set to 'N'.
  13425. +
  13426. +config CMDLINE
  13427. + string "Built-in kernel command string"
  13428. + depends on CMDLINE_BOOL
  13429. + default ""
  13430. + help
  13431. + Enter arguments here that should be compiled into the kernel
  13432. + image and used at boot time. If the boot loader provides a
  13433. + command line at boot time, it is appended to this string to
  13434. + form the full kernel command line, when the system boots.
  13435. +
  13436. + However, you can use the CONFIG_CMDLINE_OVERRIDE option to
  13437. + change this behavior.
  13438. +
  13439. + In most cases, the command line (whether built-in or provided
  13440. + by the boot loader) should specify the device for the root
  13441. + file system.
  13442. +
  13443. +config CMDLINE_OVERRIDE
  13444. + bool "Built-in command line overrides boot loader arguments"
  13445. + default n
  13446. + depends on CMDLINE_BOOL
  13447. + help
  13448. + Set this option to 'Y' to have the kernel ignore the boot loader
  13449. + command line, and use ONLY the built-in command line.
  13450. +
  13451. + This is used to work around broken boot loaders. This should
  13452. + be set to 'N' under normal conditions.
  13453. +
  13454. +endmenu
  13455. +# End Processor type and features
  13456. +
  13457. +source "arch/ubicom32/Kconfig.debug"
  13458. +
  13459. +menu "Executable file formats"
  13460. +source "fs/Kconfig.binfmt"
  13461. +endmenu
  13462. +
  13463. +source "init/Kconfig"
  13464. +source "kernel/Kconfig.preempt"
  13465. +source "kernel/time/Kconfig"
  13466. +source "mm/Kconfig"
  13467. +source "net/Kconfig"
  13468. +source "drivers/Kconfig"
  13469. +source "fs/Kconfig"
  13470. +source "security/Kconfig"
  13471. +source "crypto/Kconfig"
  13472. +source "lib/Kconfig"
  13473. diff -ruN linux-2.6.28.10_o/arch/ubicom32/Kconfig.debug linux-2.6.28.10/arch/ubicom32/Kconfig.debug
  13474. --- linux-2.6.28.10_o/arch/ubicom32/Kconfig.debug 1970-01-01 02:00:00.000000000 +0200
  13475. +++ linux-2.6.28.10/arch/ubicom32/Kconfig.debug 2009-08-06 10:31:02.000000000 +0300
  13476. @@ -0,0 +1,117 @@
  13477. +menu "Kernel hacking"
  13478. +
  13479. +config TRACE_IRQFLAGS_SUPPORT
  13480. + def_bool y
  13481. +
  13482. +config PROTECT_KERNEL
  13483. + default y
  13484. + bool 'Enable Kernel range register Protection'
  13485. + help
  13486. + Adds code to enable/disable range registers to protect static
  13487. + kernel code/data from userspace. Currently the ranges covered
  13488. + do no protect kernel loadable modules or dynamically allocated
  13489. + kernel data.
  13490. +
  13491. +config NO_KERNEL_MSG
  13492. + bool "Suppress Kernel BUG Messages"
  13493. + help
  13494. + Do not output any debug BUG messages within the kernel.
  13495. +
  13496. +config EARLY_PRINTK
  13497. + bool "Use the driver that you selected as console also for early printk (to debug kernel bootup)."
  13498. + default n
  13499. + help
  13500. + If you want to use the serdes driver (console=ttyUS0) for
  13501. + early printk, you must also supply an additional kernel boot
  13502. + parameter like this:
  13503. +
  13504. + serdes=ioportaddr,irq,clockrate,baud
  13505. +
  13506. + For an IP7160RGW eval board, you could use this:
  13507. +
  13508. + serdes=0x2004000,61,250000000,57600
  13509. +
  13510. + which will let you see early printk output at 57600 baud.
  13511. +
  13512. +config STOP_ON_TRAP
  13513. + bool "Enable stopping at the LDSR for all traps"
  13514. + default n
  13515. + help
  13516. + Cause the LDSR to stop all threads whenever a trap is about to be serviced
  13517. +
  13518. +config STOP_ON_BUG
  13519. + bool "Enable stopping on failed BUG_ON()"
  13520. + default n
  13521. + help
  13522. + Cause all BUG_ON failures to stop all threads
  13523. +
  13524. +config DEBUG_IRQMEASURE
  13525. + bool "Enable IRQ handler measurements"
  13526. + default n
  13527. + help
  13528. + When enabled each IRQ's min/avg/max times will be printed. If the handler
  13529. + re-enables interrupt, the times will show the full time including to service
  13530. + nested interrupts. See /proc/irq_measurements.
  13531. +
  13532. +config DEBUG_PCIMEASURE
  13533. + bool "Enable PCI transaction measurements"
  13534. + default n
  13535. + help
  13536. + When enabled the system will measure the min/avg/max timer for each PCI transactions.
  13537. + See /proc/pci_measurements.
  13538. +
  13539. +config ACCESS_OK_CHECKS_ENABLED
  13540. + bool "Enable user space access checks"
  13541. + default n
  13542. + help
  13543. + Enabling this check causes the kernel to verify that addresses passed
  13544. + to the kernel by the user space code are within the processes
  13545. + address space. On a no-mmu system, this is done by examining the
  13546. + processes memory data structures (adversly affecting performance) but
  13547. + ensuring that a process does not ask the kernel to violate another
  13548. + processes address space. Sadly, the kernel uses access_ok() for
  13549. + address that are in the kernel which results in a large volume of
  13550. + false positives.
  13551. +
  13552. +choice
  13553. + prompt "Unaligned Access Support"
  13554. + default UNALIGNED_ACCESS_ENABLED
  13555. + help
  13556. + Kernel / Userspace unaligned access handling.
  13557. +
  13558. +config UNALIGNED_ACCESS_ENABLED
  13559. + bool "Kernel and Userspace"
  13560. + help
  13561. +
  13562. +config UNALIGNED_ACCESS_USERSPACE_ONLY
  13563. + bool "Userspace Only"
  13564. + help
  13565. +
  13566. +config UNALIGNED_ACCESS_DISABLED
  13567. + bool "Disabled"
  13568. + help
  13569. +
  13570. +endchoice
  13571. +
  13572. +config DEBUG_STACKOVERFLOW
  13573. + bool "Check for stack overflows"
  13574. + default n
  13575. + depends on DEBUG_KERNEL
  13576. + help
  13577. + This option will cause messages to be printed if free kernel stack space
  13578. + drops below a certain limit (THREAD_SIZE /8).
  13579. +
  13580. +config DEBUG_STACK_USAGE
  13581. + bool "Stack utilization instrumentation"
  13582. + default n
  13583. + depends on DEBUG_KERNEL
  13584. + help
  13585. + Enables the display of the minimum amount of free kernel stack which each
  13586. + task has ever had available in the sysrq-T and sysrq-P debug output.
  13587. +
  13588. + This option will slow down process creation somewhat.
  13589. +
  13590. +source "lib/Kconfig.debug"
  13591. +
  13592. +endmenu
  13593. +
  13594. diff -ruN linux-2.6.28.10_o/arch/ubicom32/kernel/asm-offsets.c linux-2.6.28.10/arch/ubicom32/kernel/asm-offsets.c
  13595. --- linux-2.6.28.10_o/arch/ubicom32/kernel/asm-offsets.c 1970-01-01 02:00:00.000000000 +0200
  13596. +++ linux-2.6.28.10/arch/ubicom32/kernel/asm-offsets.c 2009-08-06 10:31:02.000000000 +0300
  13597. @@ -0,0 +1,162 @@
  13598. +/*
  13599. + * arch/ubicom32/kernel/asm-offsets.c
  13600. + * Ubicom32 architecture definitions needed by assembly language modules.
  13601. + *
  13602. + * (C) Copyright 2009, Ubicom, Inc.
  13603. + *
  13604. + * This file is part of the Ubicom32 Linux Kernel Port.
  13605. + *
  13606. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  13607. + * it and/or modify it under the terms of the GNU General Public License
  13608. + * as published by the Free Software Foundation, either version 2 of the
  13609. + * License, or (at your option) any later version.
  13610. + *
  13611. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  13612. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  13613. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  13614. + * the GNU General Public License for more details.
  13615. + *
  13616. + * You should have received a copy of the GNU General Public License
  13617. + * along with the Ubicom32 Linux Kernel Port. If not,
  13618. + * see <http://www.gnu.org/licenses/>.
  13619. + *
  13620. + * Ubicom32 implementation derived from (with many thanks):
  13621. + * arch/m68knommu
  13622. + * arch/blackfin
  13623. + * arch/parisc
  13624. + */
  13625. +/*
  13626. + * This program is used to generate definitions needed by
  13627. + * assembly language modules.
  13628. + *
  13629. + * We use the technique used in the OSF Mach kernel code:
  13630. + * generate asm statements containing #defines,
  13631. + * compile this file to assembler, and then extract the
  13632. + * #defines from the assembly-language output.
  13633. + */
  13634. +
  13635. +#include <linux/module.h>
  13636. +#include <linux/stddef.h>
  13637. +#include <linux/sched.h>
  13638. +#include <linux/kernel_stat.h>
  13639. +#include <linux/ptrace.h>
  13640. +#include <linux/hardirq.h>
  13641. +#include <asm/bootinfo.h>
  13642. +#include <asm/irq.h>
  13643. +#include <asm/thread_info.h>
  13644. +
  13645. +#define DEFINE(sym, val) \
  13646. + asm volatile("\n->" #sym " %0 " #val : : "i" (val))
  13647. +
  13648. +#define BLANK() asm volatile("\n->" : : )
  13649. +
  13650. +int main(void)
  13651. +{
  13652. + /* offsets into the task struct */
  13653. + DEFINE(TASK_STATE, offsetof(struct task_struct, state));
  13654. + DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags));
  13655. + DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace));
  13656. + DEFINE(TASK_BLOCKED, offsetof(struct task_struct, blocked));
  13657. + DEFINE(TASK_THREAD, offsetof(struct task_struct, thread));
  13658. + DEFINE(TASK_THREAD_INFO, offsetof(struct task_struct, stack));
  13659. + DEFINE(TASK_MM, offsetof(struct task_struct, mm));
  13660. + DEFINE(TASK_ACTIVE_MM, offsetof(struct task_struct, active_mm));
  13661. +
  13662. + /* offsets into the kernel_stat struct */
  13663. + DEFINE(STAT_IRQ, offsetof(struct kernel_stat, irqs));
  13664. +
  13665. + /* offsets into the irq_cpustat_t struct */
  13666. + DEFINE(CPUSTAT_SOFTIRQ_PENDING, offsetof(irq_cpustat_t, __softirq_pending));
  13667. +
  13668. + /* offsets into the thread struct */
  13669. + DEFINE(THREAD_D10, offsetof(struct thread_struct, d10));
  13670. + DEFINE(THREAD_D11, offsetof(struct thread_struct, d11));
  13671. + DEFINE(THREAD_D12, offsetof(struct thread_struct, d12));
  13672. + DEFINE(THREAD_D13, offsetof(struct thread_struct, d13));
  13673. + DEFINE(THREAD_A1, offsetof(struct thread_struct, a1));
  13674. + DEFINE(THREAD_A2, offsetof(struct thread_struct, a2));
  13675. + DEFINE(THREAD_A5, offsetof(struct thread_struct, a5));
  13676. + DEFINE(THREAD_A6, offsetof(struct thread_struct, a6));
  13677. + DEFINE(THREAD_SP, offsetof(struct thread_struct, sp));
  13678. +
  13679. + /* offsets into the pt_regs */
  13680. + DEFINE(PT_D0, offsetof(struct pt_regs, dn[0]));
  13681. + DEFINE(PT_D1, offsetof(struct pt_regs, dn[1]));
  13682. + DEFINE(PT_D2, offsetof(struct pt_regs, dn[2]));
  13683. + DEFINE(PT_D3, offsetof(struct pt_regs, dn[3]));
  13684. + DEFINE(PT_D4, offsetof(struct pt_regs, dn[4]));
  13685. + DEFINE(PT_D5, offsetof(struct pt_regs, dn[5]));
  13686. + DEFINE(PT_D6, offsetof(struct pt_regs, dn[6]));
  13687. + DEFINE(PT_D7, offsetof(struct pt_regs, dn[7]));
  13688. + DEFINE(PT_D8, offsetof(struct pt_regs, dn[8]));
  13689. + DEFINE(PT_D9, offsetof(struct pt_regs, dn[9]));
  13690. + DEFINE(PT_D10, offsetof(struct pt_regs, dn[10]));
  13691. + DEFINE(PT_D11, offsetof(struct pt_regs, dn[11]));
  13692. + DEFINE(PT_D12, offsetof(struct pt_regs, dn[12]));
  13693. + DEFINE(PT_D13, offsetof(struct pt_regs, dn[13]));
  13694. + DEFINE(PT_D14, offsetof(struct pt_regs, dn[14]));
  13695. + DEFINE(PT_D15, offsetof(struct pt_regs, dn[15]));
  13696. + DEFINE(PT_A0, offsetof(struct pt_regs, an[0]));
  13697. + DEFINE(PT_A1, offsetof(struct pt_regs, an[1]));
  13698. + DEFINE(PT_A2, offsetof(struct pt_regs, an[2]));
  13699. + DEFINE(PT_A3, offsetof(struct pt_regs, an[3]));
  13700. + DEFINE(PT_A4, offsetof(struct pt_regs, an[4]));
  13701. + DEFINE(PT_A5, offsetof(struct pt_regs, an[5]));
  13702. + DEFINE(PT_A6, offsetof(struct pt_regs, an[6]));
  13703. + DEFINE(PT_A7, offsetof(struct pt_regs, an[7]));
  13704. + DEFINE(PT_SP, offsetof(struct pt_regs, an[7]));
  13705. +
  13706. + DEFINE(PT_ACC0HI, offsetof(struct pt_regs, acc0[0]));
  13707. + DEFINE(PT_ACC0LO, offsetof(struct pt_regs, acc0[1]));
  13708. + DEFINE(PT_MAC_RC16, offsetof(struct pt_regs, mac_rc16));
  13709. +
  13710. + DEFINE(PT_ACC1HI, offsetof(struct pt_regs, acc1[0]));
  13711. + DEFINE(PT_ACC1LO, offsetof(struct pt_regs, acc1[1]));
  13712. +
  13713. + DEFINE(PT_SOURCE3, offsetof(struct pt_regs, source3));
  13714. + DEFINE(PT_INST_CNT, offsetof(struct pt_regs, inst_cnt));
  13715. + DEFINE(PT_CSR, offsetof(struct pt_regs, csr));
  13716. + DEFINE(PT_DUMMY_UNUSED, offsetof(struct pt_regs, dummy_unused));
  13717. +
  13718. + DEFINE(PT_INT_MASK0, offsetof(struct pt_regs, int_mask0));
  13719. + DEFINE(PT_INT_MASK1, offsetof(struct pt_regs, int_mask1));
  13720. +
  13721. + DEFINE(PT_PC, offsetof(struct pt_regs, pc));
  13722. +
  13723. + DEFINE(PT_TRAP_CAUSE, offsetof(struct pt_regs, trap_cause));
  13724. +
  13725. + DEFINE(PT_SIZE, sizeof(struct pt_regs));
  13726. +
  13727. + DEFINE(PT_FRAME_TYPE, offsetof(struct pt_regs, frame_type));
  13728. +
  13729. + DEFINE(PT_ORIGINAL_D0, offsetof(struct pt_regs, original_dn_0));
  13730. + DEFINE(PT_PREVIOUS_PC, offsetof(struct pt_regs, previous_pc));
  13731. +
  13732. + /* offsets into the kernel_stat struct */
  13733. + DEFINE(STAT_IRQ, offsetof(struct kernel_stat, irqs));
  13734. +
  13735. + /* signal defines */
  13736. + DEFINE(SIGSEGV, SIGSEGV);
  13737. + //DEFINE(SEGV_MAPERR, SEGV_MAPERR);
  13738. + DEFINE(SIGTRAP, SIGTRAP);
  13739. + //DEFINE(TRAP_TRACE, TRAP_TRACE);
  13740. +
  13741. + DEFINE(PT_PTRACED, PT_PTRACED);
  13742. + DEFINE(PT_DTRACE, PT_DTRACE);
  13743. +
  13744. + DEFINE(ASM_THREAD_SIZE, THREAD_SIZE);
  13745. +
  13746. + /* Offsets in thread_info structure */
  13747. + DEFINE(TI_TASK, offsetof(struct thread_info, task));
  13748. + DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain));
  13749. + DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
  13750. + DEFINE(TI_PREEMPTCOUNT, offsetof(struct thread_info, preempt_count));
  13751. + DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
  13752. + DEFINE(TI_INTR_NESTING, offsetof(struct thread_info, interrupt_nesting));
  13753. + DEFINE(ASM_TIF_NEED_RESCHED, TIF_NEED_RESCHED);
  13754. + DEFINE(ASM_TIF_SYSCALL_TRACE, TIF_SYSCALL_TRACE);
  13755. + DEFINE(ASM_TIF_SIGPENDING, TIF_SIGPENDING);
  13756. +
  13757. + DEFINE(ASM_RAM_END, (CONFIG_RAMBASE + CONFIG_RAMSIZE));
  13758. + return 0;
  13759. +}
  13760. diff -ruN linux-2.6.28.10_o/arch/ubicom32/kernel/Makefile linux-2.6.28.10/arch/ubicom32/kernel/Makefile
  13761. --- linux-2.6.28.10_o/arch/ubicom32/kernel/Makefile 1970-01-01 02:00:00.000000000 +0200
  13762. +++ linux-2.6.28.10/arch/ubicom32/kernel/Makefile 2009-08-06 10:31:02.000000000 +0300
  13763. @@ -0,0 +1,64 @@
  13764. +#
  13765. +# arch/ubicom32/kernel/Makefile
  13766. +# Main Makefile for the Ubicom32 arch directory.
  13767. +#
  13768. +# (C) Copyright 2009, Ubicom, Inc.
  13769. +#
  13770. +# This file is part of the Ubicom32 Linux Kernel Port.
  13771. +#
  13772. +# The Ubicom32 Linux Kernel Port is free software: you can redistribute
  13773. +# it and/or modify it under the terms of the GNU General Public License
  13774. +# as published by the Free Software Foundation, either version 2 of the
  13775. +# License, or (at your option) any later version.
  13776. +#
  13777. +# The Ubicom32 Linux Kernel Port is distributed in the hope that it
  13778. +# will be useful, but WITHOUT ANY WARRANTY; without even the implied
  13779. +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  13780. +# the GNU General Public License for more details.
  13781. +#
  13782. +# You should have received a copy of the GNU General Public License
  13783. +# along with the Ubicom32 Linux Kernel Port. If not,
  13784. +# see <http://www.gnu.org/licenses/>.
  13785. +#
  13786. +# Ubicom32 implementation derived from (with many thanks):
  13787. +# arch/m68knommu
  13788. +# arch/blackfin
  13789. +# arch/parisc
  13790. +#
  13791. +
  13792. +extra-y := head.o vmlinux.lds
  13793. +
  13794. +obj-y += \
  13795. + devtree.o \
  13796. + dma.o \
  13797. + flat.o \
  13798. + init_task.o \
  13799. + irq.o \
  13800. + ldsr.o \
  13801. + os_node.o \
  13802. + process.o \
  13803. + processor.o \
  13804. + ptrace.o \
  13805. + setup.o \
  13806. + signal.o \
  13807. + stacktrace.o \
  13808. + sys_ubicom32.o \
  13809. + syscalltable.o \
  13810. + thread.o \
  13811. + time.o \
  13812. + traps.o \
  13813. + ubicom32_context_switch.o \
  13814. + ubicom32_ksyms.o \
  13815. + ubicom32_syscall.o \
  13816. + unaligned_trap.o
  13817. +
  13818. +obj-$(CONFIG_MODULES) += module.o
  13819. +obj-$(CONFIG_COMEMPCI) += comempci.o
  13820. +obj-$(CONFIG_SMP) += smp.o topology.o
  13821. +obj-$(CONFIG_ACCESS_OK_CHECKS_ENABLED) += uaccess.o
  13822. +obj-$(CONFIG_GENERIC_CLOCKEVENTS) += timer_device.o
  13823. +obj-$(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) += timer_broadcast.o
  13824. +
  13825. +ifndef CONFIG_GENERIC_CLOCKEVENTS
  13826. +obj-y += timer_tick.o
  13827. +endif
  13828. diff -ruN linux-2.6.28.10_o/arch/ubicom32/kernel/syscalltable.S linux-2.6.28.10/arch/ubicom32/kernel/syscalltable.S
  13829. --- linux-2.6.28.10_o/arch/ubicom32/kernel/syscalltable.S 1970-01-01 02:00:00.000000000 +0200
  13830. +++ linux-2.6.28.10/arch/ubicom32/kernel/syscalltable.S 2009-08-06 10:31:02.000000000 +0300
  13831. @@ -0,0 +1,377 @@
  13832. +/*
  13833. + * arch/ubicom32/kernel/syscalltable.S
  13834. + * <TODO: Replace with short file description>
  13835. + *
  13836. + * (C) Copyright 2009, Ubicom, Inc.
  13837. + *
  13838. + * This file is part of the Ubicom32 Linux Kernel Port.
  13839. + *
  13840. + * The Ubicom32 Linux Kernel Port is free software: you can redistribute
  13841. + * it and/or modify it under the terms of the GNU General Public License
  13842. + * as published by the Free Software Foundation, either version 2 of the
  13843. + * License, or (at your option) any later version.
  13844. + *
  13845. + * The Ubicom32 Linux Kernel Port is distributed in the hope that it
  13846. + * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  13847. + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  13848. + * the GNU General Public License for more details.
  13849. + *
  13850. + * You should have received a copy of the GNU General Public License
  13851. + * along with the Ubicom32 Linux Kernel Port. If not,
  13852. + * see <http://www.gnu.org/licenses/>.
  13853. + *
  13854. + * Ubicom32 implementation derived from (with many thanks):
  13855. + * arch/m68knommu
  13856. + * arch/blackfin
  13857. + * arch/parisc
  13858. + */
  13859. +/*
  13860. + *
  13861. + * Copyright (C) 2002, Greg Ungerer ([email protected])
  13862. + * Copyright (C) 1998 D. Jeff Dionne <[email protected]>, Kenneth Albanowski <[email protected]>,
  13863. + * Copyright (C) 2000 Lineo Inc. (www.lineo.com)
  13864. + * Copyright (C) 1991, 1992 Linus Torvalds
  13865. + */
  13866. +
  13867. +#include <linux/sys.h>
  13868. +#include <linux/linkage.h>
  13869. +#include <asm/unistd.h>
  13870. +
  13871. +.text
  13872. +ALIGN
  13873. + .global sys_call_table
  13874. +sys_call_table:
  13875. + .long sys_ni_syscall /* 0 - old "setup()" system call*/
  13876. + .long sys_exit
  13877. + .long sys_fork
  13878. + .long sys_read
  13879. + .long sys_write
  13880. + .long sys_open /* 5 */
  13881. + .long sys_close
  13882. + .long sys_waitpid
  13883. + .long sys_creat
  13884. + .long sys_link
  13885. + .long sys_unlink /* 10 */
  13886. + .long execve_intercept
  13887. + .long sys_chdir
  13888. + .long sys_time
  13889. + .long sys_mknod
  13890. + .long sys_chmod /* 15 */
  13891. + .long sys_chown16
  13892. + .long sys_ni_syscall /* old break syscall holder */
  13893. + .long sys_stat
  13894. + .long sys_lseek
  13895. + .long sys_getpid /* 20 */
  13896. + .long sys_mount
  13897. + .long sys_oldumount
  13898. + .long sys_setuid16
  13899. + .long sys_getuid16
  13900. + .long sys_stime /* 25 */
  13901. + .long sys_ptrace
  13902. + .long sys_alarm
  13903. + .long sys_fstat
  13904. + .long sys_pause
  13905. + .long sys_utime /* 30 */
  13906. + .long sys_ni_syscall /* old stty syscall holder */
  13907. + .long sys_ni_syscall /* old gtty syscall holder */
  13908. + .long sys_access
  13909. + .long sys_nice
  13910. + .long sys_ni_syscall /* 35 */ /* old ftime syscall holder */
  13911. + .long sys_sync
  13912. + .long sys_kill
  13913. + .long sys_rename
  13914. + .long sys_mkdir
  13915. + .long sys_rmdir /* 40 */
  13916. + .long sys_dup
  13917. + .long sys_pipe
  13918. + .long sys_times
  13919. + .long sys_ni_syscall /* old prof syscall holder */
  13920. + .long sys_brk /* 45 */
  13921. + .long sys_setgid16
  13922. + .long sys_getgid16
  13923. + .long sys_signal
  13924. + .long sys_geteuid16
  13925. + .long sys_getegid16 /* 50 */
  13926. + .long sys_acct
  13927. + .long sys_umount /* recycled never used phys() */
  13928. + .long sys_ni_syscall /* old lock syscall holder */
  13929. + .long sys_ioctl
  13930. + .long sys_fcntl /* 55 */
  13931. + .long sys_ni_syscall /* old mpx syscall holder */
  13932. + .long sys_setpgid
  13933. + .long sys_ni_syscall /* old ulimit syscall holder */
  13934. + .long sys_ni_syscall
  13935. + .long sys_umask /* 60 */
  13936. + .long sys_chroot
  13937. + .long sys_ustat
  13938. + .long sys_dup2
  13939. + .long sys_getppid
  13940. + .long sys_getpgrp /* 65 */
  13941. + .long sys_setsid
  13942. + .long sys_sigaction
  13943. + .long sys_sgetmask
  13944. + .long sys_ssetmask
  13945. + .long sys_setreuid16 /* 70 */
  13946. + .long sys_setregid16
  13947. + .long sys_sigsuspend
  13948. + .long sys_sigpending
  13949. + .long sys_sethostname
  13950. + .long sys_setrlimit /* 75 */
  13951. + .long sys_old_getrlimit
  13952. + .long sys_getrusage
  13953. + .long sys_gettimeofday
  13954. + .long sys_settimeofday
  13955. + .long sys_getgroups16 /* 80 */
  13956. + .long sys_setgroups16
  13957. + .long old_select
  13958. + .long sys_symlink
  13959. + .long sys_lstat
  13960. + .long sys_readlink /* 85 */
  13961. + .long sys_uselib
  13962. + .long sys_ni_syscall /* _sys_swapon */
  13963. + .long sys_reboot
  13964. + .long sys_old_readdir
  13965. + .long old_mmap /* 90 */
  13966. + .long sys_munmap
  13967. + .long sys_truncate
  13968. + .long sys_ftruncate
  13969. + .long sys_fchmod
  13970. + .long sys_fchown16 /* 95 */
  13971. + .long sys_getpriority
  13972. + .long sys_setpriority
  13973. + .long sys_ni_syscall /* old profil syscall holder */
  13974. + .long sys_statfs
  13975. + .long sys_fstatfs /* 100 */
  13976. + .long sys_ni_syscall /* ioperm for i386 */
  13977. + .long sys_socketcall
  13978. + .long sys_syslog
  13979. + .long sys_setitimer
  13980. + .long sys_getitimer /* 105 */
  13981. + .long sys_newstat
  13982. + .long sys_newlstat
  13983. + .long sys_newfstat
  13984. + .long sys_ni_syscall
  13985. + .long sys_ni_syscall /* iopl for i386 */ /* 110 */
  13986. + .long sys_vhangup
  13987. + .long sys_ni_syscall /* obsolete idle() syscall */
  13988. + .long sys_ni_syscall /* vm86old for i386 */
  13989. + .long sys_wait4
  13990. + .long sys_ni_syscall /* 115 */ /* _sys_swapoff */
  13991. + .long sys_sysinfo
  13992. + .long sys_ipc
  13993. + .long sys_fsync
  13994. + .long sys_sigreturn
  13995. + .long clone_intercept /* 120 */
  13996. + .long sys_setdomainname
  13997. + .long sys_newuname
  13998. + .long sys_cacheflush /* modify_ldt for i386 */
  13999. + .long sys_adjtimex
  14000. + .long sys_ni_syscall /* 125 */ /* _sys_mprotect */
  14001. + .long sys_sigprocmask
  14002. + .long sys_ni_syscall /* old "creat_module" */
  14003. + .long sys_init_module
  14004. + .long sys_delete_module
  14005. + .long sys_ni_syscall /* 130: old "get_kernel_syms" */
  14006. + .long sys_quotactl
  14007. + .long sys_getpgid
  14008. + .long sys_fchdir
  14009. + .long sys_bdflush
  14010. + .long sys_sysfs /* 135 */
  14011. + .long sys_personality
  14012. + .long sys_ni_syscall /* for afs_syscall */
  14013. + .long sys_setfsuid16
  14014. + .long sys_setfsgid16
  14015. + .long sys_llseek /* 140 */
  14016. + .long sys_getdents
  14017. + .long sys_select
  14018. + .long sys_flock
  14019. + .long sys_ni_syscall /* _sys_msync */
  14020. + .long sys_readv /* 145 */
  14021. + .long sys_writev
  14022. + .long sys_getsid
  14023. + .long sys_fdatasync
  14024. + .long sys_sysctl
  14025. + .long sys_ni_syscall /* 150 */ /* _sys_mlock */
  14026. + .long sys_ni_syscall /* _sys_munlock */
  14027. + .long sys_ni_syscall /* _sys_mlockall */
  14028. + .long sys_ni_syscall /* _sys_munlockall */
  14029. + .long sys_sched_setparam
  14030. + .long sys_sched_getparam /* 155 */
  14031. + .long sys_sched_setscheduler
  14032. + .long sys_sched_getscheduler
  14033. + .long sys_sched_yield
  14034. + .long sys_sched_get_priority_max
  14035. + .long sys_sched_get_priority_min /* 160 */
  14036. + .long sys_sched_rr_get_interval
  14037. + .long sys_nanosleep
  14038. + .long sys_ni_syscall /* _sys_mremap */
  14039. + .long sys_setresuid16
  14040. + .long sys_getresuid16 /* 165 */
  14041. + .long sys_getpagesize /* _sys_getpagesize */
  14042. + .long sys_ni_syscall /* old "query_module" */
  14043. + .long sys_poll
  14044. + .long sys_ni_syscall /* _sys_nfsservctl */
  14045. + .long sys_setresgid16 /* 170 */
  14046. + .long sys_getresgid16
  14047. + .long sys_prctl
  14048. + .long sys_rt_sigreturn
  14049. + .long sys_rt_sigaction
  14050. + .long sys_rt_sigprocmask /* 175 */
  14051. + .long sys_rt_sigpending
  14052. + .long sys_rt_sigtimedwait
  14053. + .long sys_rt_sigqueueinfo
  14054. + .long sys_rt_sigsuspend
  14055. + .long sys_pread64 /* 180 */
  14056. + .long sys_pwrite64
  14057. + .long sys_lchown16
  14058. + .long sys_getcwd
  14059. + .long sys_capget
  14060. + .long sys_capset /* 185 */
  14061. + .long sys_sigaltstack
  14062. + .long sys_sendfile
  14063. + .long sys_ni_syscall /* streams1 */
  14064. + .long sys_ni_syscall /* streams2 */
  14065. + .long vfork_intercept /* 190 */
  14066. + .long sys_getrlimit
  14067. + .long sys_mmap2
  14068. + .long sys_truncate64
  14069. + .long sys_ftruncate64
  14070. + .long sys_stat64 /* 195 */
  14071. + .long sys_lstat64
  14072. + .long sys_fstat64
  14073. + .long sys_chown
  14074. + .long sys_getuid
  14075. + .long sys_getgid /* 200 */
  14076. + .long sys_geteuid
  14077. + .long sys_getegid
  14078. + .long sys_setreuid
  14079. + .long sys_setregid
  14080. + .long sys_getgroups /* 205 */
  14081. + .long sys_setgroups
  14082. + .long sys_fchown
  14083. + .long sys_setresuid
  14084. + .long sys_getresuid
  14085. + .long sys_setresgid /* 210 */
  14086. + .long sys_getresgid
  14087. + .long sys_lchown
  14088. + .long sys_setuid
  14089. + .long sys_setgid
  14090. + .long sys_setfsuid /* 215 */
  14091. + .long sys_setfsgid
  14092. + .long sys_pivot_root
  14093. + .long sys_ni_syscall
  14094. + .long sys_ni_syscall
  14095. + .long sys_getdents64 /* 220 */
  14096. + .long sys_gettid
  14097. + .long sys_tkill
  14098. + .long sys_setxattr
  14099. + .long sys_lsetxattr
  14100. + .long sys_fsetxattr /* 225 */
  14101. + .long sys_getxattr
  14102. + .long sys_lgetxattr
  14103. + .long sys_fgetxattr
  14104. + .long sys_listxattr
  14105. + .long sys_llistxattr /* 230 */
  14106. + .long sys_flistxattr
  14107. + .long sys_removexattr
  14108. + .long sys_lremovexattr
  14109. + .long sys_fremovexattr
  14110. + .long sys_futex /* 235 */
  14111. + .long sys_sendfile64
  14112. + .long sys_ni_syscall /* _sys_mincore */
  14113. + .long sys_ni_syscall /* _sys_madvise */
  14114. + .long sys_fcntl64
  14115. + .long sys_readahead /* 240 */
  14116. + .long sys_io_setup
  14117. + .long sys_io_destroy
  14118. + .long sys_io_getevents
  14119. + .long sys_io_submit
  14120. + .long sys_io_cancel /* 245 */
  14121. + .long sys_fadvise64
  14122. + .long sys_exit_group
  14123. + .long sys_lookup_dcookie
  14124. + .long sys_epoll_create
  14125. + .long sys_epoll_ctl /* 250 */
  14126. + .long sys_epoll_wait
  14127. + .long sys_ni_syscall /* _sys_remap_file_pages */
  14128. + .long sys_set_tid_address
  14129. + .long sys_timer_create
  14130. + .long sys_timer_settime /* 255 */
  14131. + .long sys_timer_gettime
  14132. + .long sys_timer_getoverrun
  14133. + .long sys_timer_delete
  14134. + .long sys_clock_settime
  14135. + .long sys_clock_gettime /* 260 */
  14136. + .long sys_clock_getres
  14137. + .long sys_clock_nanosleep
  14138. + .long sys_statfs64
  14139. + .long sys_fstatfs64
  14140. + .long sys_tgkill /* 265 */
  14141. + .long sys_utimes
  14142. + .long sys_fadvise64_64
  14143. + .long sys_mbind
  14144. + .long sys_get_mempolicy
  14145. + .long sys_set_mempolicy /* 270 */
  14146. + .long sys_mq_open
  14147. + .long sys_mq_unlink
  14148. + .long sys_mq_timedsend
  14149. + .long sys_mq_timedreceive
  14150. + .long sys_mq_notify /* 275 */
  14151. + .long sys_mq_getsetattr
  14152. + .long sys_waitid
  14153. + .long sys_ni_syscall /* for _sys_vserver */
  14154. + .long sys_add_key
  14155. + .long sys_request_key /* 280 */
  14156. + .long sys_keyctl
  14157. + .long sys_ioprio_set
  14158. + .long sys_ioprio_get
  14159. + .long sys_inotify_init
  14160. + .long sys_inotify_add_watch /* 285 */
  14161. + .long sys_inotify_rm_watch
  14162. + .long sys_migrate_pages
  14163. + .long sys_openat
  14164. + .long sys_mkdirat
  14165. + .long sys_mknodat /* 290 */
  14166. + .long sys_fchownat
  14167. + .long sys_futimesat
  14168. + .long sys_fstatat64
  14169. + .long sys_unlinkat
  14170. + .long sys_renameat /* 295 */
  14171. + .long sys_linkat
  14172. + .long sys_symlinkat
  14173. + .long sys_readlinkat
  14174. + .long sys_fchmodat
  14175. + .long sys_faccessat /* 300 */
  14176. + .long sys_ni_syscall /* Reserved for pselect6 */
  14177. + .long sys_ni_syscall /* Reserved for ppoll */
  14178. + .long sys_unshare
  14179. + .long sys_set_robust_list
  14180. + .long sys_get_robust_list /* 305 */
  14181. + .long sys_splice
  14182. + .long sys_sync_file_range
  14183. + .long sys_tee
  14184. + .long sys_vmsplice
  14185. + .long sys_move_pages /* 310 */
  14186. + .long sys_sched_setaffinity
  14187. + .long sys_sched_getaffinity
  14188. + .long sys_kexec_load
  14189. + .long sys_getcpu
  14190. + .long sys_epoll_pwait /* 315 */
  14191. + .long sys_utimensat
  14192. + .long sys_signalfd
  14193. + .long sys_timerfd_create
  14194. + .long sys_eventfd
  14195. + .long sys_fallocate /* 320 */
  14196. + .long sys_timerfd_settime
  14197. + .long sys_timerfd_gettime
  14198. + .long sys_ni_syscall /* sys_signalfd4 */
  14199. + .long sys_ni_syscall /* sys_eventfd2 */
  14200. + .long sys_ni_syscall /* sys_epoll_create1 */
  14201. + /* 325 */
  14202. + .long sys_ni_syscall /* sys_dup3 */
  14203. + .long sys_ni_syscall /* sys_pipe2 */
  14204. + .long sys_ni_syscall /* sys_inotify_init1 */
  14205. + .rept NR_syscalls-(.-sys_call_table)/4
  14206. + .long sys_ni_syscall
  14207. + .endr
  14208. +
  14209. diff -ruN linux-2.6.28.10_o/arch/ubicom32/lib/Makefile linux-2.6.28.10/arch/ubicom32/lib/Makefile
  14210. --- linux-2.6.28.10_o/arch/ubicom32/lib/Makefile 1970-01-01 02:00:00.000000000 +0200
  14211. +++ linux-2.6.28.10/arch/ubicom32/lib/Makefile 2009-08-06 10:31:02.000000000 +0300
  14212. @@ -0,0 +1,32 @@
  14213. +#
  14214. +# arch/ubicom32/lib/Makefile
  14215. +# <TODO: Replace with short file description>
  14216. +#
  14217. +# (C) Copyright 2009, Ubicom, Inc.
  14218. +#
  14219. +# This file is part of the Ubicom32 Linux Kernel Port.
  14220. +#
  14221. +# The Ubicom32 Linux Kernel Port is free software: you can redistribute
  14222. +# it and/or modify it under the terms of the GNU General Public License
  14223. +# as published by the Free Software Foundation, either version 2 of the
  14224. +# License, or (at your option) any later version.
  14225. +#
  14226. +# The Ubicom32 Linux Kernel Port is distributed in the hope that it
  14227. +# will be useful, but WITHOUT ANY WARRANTY; without even the implied
  14228. +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  14229. +# the GNU General Public License for more details.
  14230. +#
  14231. +# You should have received a copy of the GNU General Public License
  14232. +# along with the Ubicom32 Linux Kernel Port. If not,
  14233. +# see <http://www.gnu.org/licenses/>.
  14234. +#
  14235. +# Ubicom32 implementation derived from (with many thanks):
  14236. +# arch/m68knommu
  14237. +# arch/blackfin
  14238. +# arch/parisc
  14239. +#
  14240. +#
  14241. +# Makefile for m68knommu specific library files..
  14242. +#
  14243. +
  14244. +lib-y := checksum.o delay.o mem_ubicom32.o
  14245. diff -ruN linux-2.6.28.10_o/arch/ubicom32/mach-common/Makefile linux-2.6.28.10/arch/ubicom32/mach-common/Makefile
  14246. --- linux-2.6.28.10_o/arch/ubicom32/mach-common/Makefile 1970-01-01 02:00:00.000000000 +0200
  14247. +++ linux-2.6.28.10/arch/ubicom32/mach-common/Makefile 2009-08-06 10:31:02.000000000 +0300
  14248. @@ -0,0 +1,40 @@
  14249. +#
  14250. +# arch/ubicom32/mach-common/Makefile
  14251. +# Makefile for Ubicom32 generic drivers/code.
  14252. +#
  14253. +# (C) Copyright 2009, Ubicom, Inc.
  14254. +#
  14255. +# This file is part of the Ubicom32 Linux Kernel Port.
  14256. +#
  14257. +# The Ubicom32 Linux Kernel Port is free software: you can redistribute
  14258. +# it and/or modify it under the terms of the GNU General Public License
  14259. +# as published by the Free Software Foundation, either version 2 of the
  14260. +# License, or (at your option) any later version.
  14261. +#
  14262. +# The Ubicom32 Linux Kernel Port is distributed in the hope that it
  14263. +# will be useful, but WITHOUT ANY WARRANTY; without even the implied
  14264. +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  14265. +# the GNU General Public License for more details.
  14266. +#
  14267. +# You should have received a copy of the GNU General Public License
  14268. +# along with the Ubicom32 Linux Kernel Port. If not,
  14269. +# see <http://www.gnu.org/licenses/>.
  14270. +#
  14271. +# Ubicom32 implementation derived from (with many thanks):
  14272. +# arch/m68knommu
  14273. +# arch/blackfin
  14274. +# arch/parisc
  14275. +#
  14276. +
  14277. +obj-y += cachectl.o common.o usb_tio.o usb.o ubi32-gpio.o board.o bootargs.o
  14278. +obj-$(CONFIG_PCI) += pci.o io.o
  14279. +
  14280. +obj-$(CONFIG_FB_UBICOM32) += vdc_tio.o
  14281. +obj-$(CONFIG_UBICOM_HID) += ubicom32hid.o
  14282. +obj-$(CONFIG_UBICOM_INPUT) += ubicom32input.o
  14283. +obj-$(CONFIG_UBICOM_INPUT_I2C) += ubicom32input_i2c.o
  14284. +obj-$(CONFIG_UBICOM_SWITCH) += switch-core.o
  14285. +obj-$(CONFIG_UBICOM_SWITCH_BCM539X) += switch-bcm539x.o
  14286. +obj-$(CONFIG_UIO_UBICOM32RING) += ring_tio.o
  14287. +obj-$(CONFIG_SND_UBI32) += audio_tio.o
  14288. +
  14289. diff -ruN linux-2.6.28.10_o/arch/ubicom32/mach-ip5k/Kconfig linux-2.6.28.10/arch/ubicom32/mach-ip5k/Kconfig
  14290. --- linux-2.6.28.10_o/arch/ubicom32/mach-ip5k/Kconfig 1970-01-01 02:00:00.000000000 +0200
  14291. +++ linux-2.6.28.10/arch/ubicom32/mach-ip5k/Kconfig 2009-08-06 10:31:02.000000000 +0300
  14292. @@ -0,0 +1,32 @@
  14293. +
  14294. +config IP5170DPF
  14295. + bool "IP5170DPF"
  14296. + select UBICOM32_V3
  14297. + select I2C
  14298. + select I2C_GPIO
  14299. + select FB
  14300. + select FB_UBICOM32
  14301. + select BACKLIGHT_LCD_SUPPORT
  14302. + select BACKLIGHT_CLASS_DEVICE
  14303. + select UBICOM_HID
  14304. + select NEW_LEDS
  14305. + select LEDS_CLASS
  14306. + select LEDS_GPIO
  14307. + select BRD_64MB
  14308. + help
  14309. + IP5170 Digital Picture Frame board, 8005-1113, IP5K-BEV-0011-13 v1.3
  14310. +
  14311. +config IP5160DEV
  14312. + bool "IP5160Dev_Ver1Dot1"
  14313. + select UBICOM32_V3
  14314. + select BRD_64MB
  14315. + help
  14316. + Ubicom StreamEngine 5000 Development Board, IP5K-BDV-0004-11 v1.1
  14317. +
  14318. +config IP5160EVAL
  14319. + bool "IP5160RGWEval_Ver2Rev2"
  14320. + select UBICOM32_V3
  14321. + select BRD_32MB
  14322. + help
  14323. + Ubicom StreamEngine 5000 RGW Evaluation Board, IP5K-RGW-0004-11 v2.2
  14324. +
  14325. diff -ruN linux-2.6.28.10_o/arch/ubicom32/mach-ip5k/Makefile linux-2.6.28.10/arch/ubicom32/mach-ip5k/Makefile
  14326. --- linux-2.6.28.10_o/arch/ubicom32/mach-ip5k/Makefile 1970-01-01 02:00:00.000000000 +0200
  14327. +++ linux-2.6.28.10/arch/ubicom32/mach-ip5k/Makefile 2009-08-06 10:31:02.000000000 +0300
  14328. @@ -0,0 +1,32 @@
  14329. +#
  14330. +# arch/ubicom32/mach-ip5k/Makefile
  14331. +# Makefile for boards which have an ip5k on them.
  14332. +#
  14333. +# (C) Copyright 2009, Ubicom, Inc.
  14334. +#
  14335. +# This file is part of the Ubicom32 Linux Kernel Port.
  14336. +#
  14337. +# The Ubicom32 Linux Kernel Port is free software: you can redistribute
  14338. +# it and/or modify it under the terms of the GNU General Public License
  14339. +# as published by the Free Software Foundation, either version 2 of the
  14340. +# License, or (at your option) any later version.
  14341. +#
  14342. +# The Ubicom32 Linux Kernel Port is distributed in the hope that it
  14343. +# will be useful, but WITHOUT ANY WARRANTY; without even the implied
  14344. +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  14345. +# the GNU General Public License for more details.
  14346. +#
  14347. +# You should have received a copy of the GNU General Public License
  14348. +# along with the Ubicom32 Linux Kernel Port. If not,
  14349. +# see <http://www.gnu.org/licenses/>.
  14350. +#
  14351. +# Ubicom32 implementation derived from (with many thanks):
  14352. +# arch/m68knommu
  14353. +# arch/blackfin
  14354. +# arch/parisc
  14355. +#
  14356. +
  14357. +obj-$(CONFIG_IP5170DPF) += board-ip5170dpf.o
  14358. +obj-$(CONFIG_IP5160DEV) += board-ip5160dev.o
  14359. +obj-$(CONFIG_IP5160EVAL) += board-ip5160rgw.o
  14360. +
  14361. diff -ruN linux-2.6.28.10_o/arch/ubicom32/mach-ip7k/Kconfig linux-2.6.28.10/arch/ubicom32/mach-ip7k/Kconfig
  14362. --- linux-2.6.28.10_o/arch/ubicom32/mach-ip7k/Kconfig 1970-01-01 02:00:00.000000000 +0200
  14363. +++ linux-2.6.28.10/arch/ubicom32/mach-ip7k/Kconfig 2009-08-06 10:31:02.000000000 +0300
  14364. @@ -0,0 +1,132 @@
  14365. +config IP7145DPF
  14366. + bool "IP7145DPF"
  14367. + select UBICOM32_V4
  14368. + select UBICOM_INPUT
  14369. + select UBICOM_INPUT_I2C
  14370. + select RTC_CLASS
  14371. + select RTC_DRV_S35390A
  14372. + select I2C
  14373. + select I2C_GPIO
  14374. + select GPIO_PCA953X
  14375. + select FB
  14376. + select FB_UBICOM32
  14377. + select BACKLIGHT_LCD_SUPPORT
  14378. + select LCD_CLASS_DEVICE
  14379. + select LCD_UBICOM32
  14380. + select BACKLIGHT_CLASS_DEVICE
  14381. + select BACKLIGHT_UBICOM32
  14382. + select SND_UBI32
  14383. + select MMC_UBICOM32
  14384. + select MMC
  14385. + select MMC_BLOCK
  14386. + select BRD_64MB
  14387. + help
  14388. + IP7145 Digital Picture Frame reference design, supports:
  14389. + 8007-0410 v1.0
  14390. +
  14391. +config IP7160RGW
  14392. + bool "IP7160RGW"
  14393. + select UBICOM32_V4
  14394. + select UBICOM_INPUT
  14395. + select NEW_LEDS
  14396. + select LEDS_CLASS
  14397. + select LEDS_GPIO
  14398. + select BRD_64MB
  14399. + select SPI
  14400. + select SPI_UBICOM32_GPIO
  14401. + select VLAN_8021Q
  14402. + select UBICOM_SWITCH
  14403. + select UBICOM_SWITCH_BCM539X
  14404. + help
  14405. + Ubicom IP7160 RGW Eval, supports:
  14406. + 8007-0110 v1.0
  14407. + 8007-0111 v1.1
  14408. + 8007-0112 v1.2
  14409. +
  14410. +config IP7160BRINGUP
  14411. + bool "IP7160BRINGUP"
  14412. + select UBICOM32_V4
  14413. + select NEW_LEDS
  14414. + select LEDS_CLASS
  14415. + select LEDS_GPIO
  14416. + select BRD_64MB
  14417. + help
  14418. + Ubicom IP7160 Bringup, supports:
  14419. + 8007-0010 v1.0
  14420. +
  14421. +config IP7160DPF
  14422. + bool "IP7160DPF"
  14423. + select UBICOM32_V4
  14424. + select I2C
  14425. + select I2C_GPIO
  14426. + select FB
  14427. + select FB_UBICOM32
  14428. + select BACKLIGHT_LCD_SUPPORT
  14429. + select BACKLIGHT_CLASS_DEVICE
  14430. + select SND_UBI32
  14431. + select SND_UBI32_AUDIO_CS4350
  14432. + select UBICOM_HID
  14433. + select BRD_64MB
  14434. + help
  14435. + IP7160 Digital Picture Frame board, supports:
  14436. + 8007-0211 Rev 1.1
  14437. +
  14438. +config IP7500MODULE
  14439. + bool "IP7500MODULE"
  14440. + select UBICOM32_V4
  14441. + select BRD_128MB
  14442. + help
  14443. + Ubicom IP7500 CPU Module board, supports:
  14444. + 8007-0510 v1.0
  14445. + 8007-0510A v1.0
  14446. +
  14447. + Please see ip7500module.c for more details.
  14448. +
  14449. +config IP7500AV
  14450. + bool "IP7500AV"
  14451. + select UBICOM32_V4
  14452. + select BRD_128MB
  14453. + select I2C
  14454. + select I2C_GPIO
  14455. + select SND_UBI32
  14456. + select SND_UBI32_AUDIO_CS4384
  14457. + select FB
  14458. + select FB_UBICOM32
  14459. + help
  14460. + Ubicom IP7500 Audio Video board, supports:
  14461. + 8007-0810 v1.0
  14462. +
  14463. + With Ubicom IP7500 CPU Module board:
  14464. + 8007-0510 v1.0 -or-
  14465. + 8007-0510A v1.0
  14466. +
  14467. + Please see ip7500av.c for more details.
  14468. +
  14469. +config IP7500MEDIA
  14470. + bool "IP7500MEDIA"
  14471. + select UBICOM32_V4
  14472. + select UBICOM_INPUT_I2C
  14473. + select RTC_CLASS
  14474. + select RTC_DRV_S35390A
  14475. + select I2C
  14476. + select I2C_GPIO
  14477. + select GPIO_PCA953X
  14478. + select FB
  14479. + select FB_UBICOM32
  14480. + select BACKLIGHT_LCD_SUPPORT
  14481. + select LCD_CLASS_DEVICE
  14482. + select LCD_UBICOM32
  14483. + select BACKLIGHT_CLASS_DEVICE
  14484. + select BACKLIGHT_UBICOM32
  14485. + select SND_UBI32
  14486. + select SND_UBI32_AUDIO_CS4350
  14487. + select MMC_UBICOM32
  14488. + select MMC
  14489. + select MMC_BLOCK
  14490. + select BRD_128MB
  14491. + help
  14492. + IP7500 Media Board w/ IP7500 CPU Module board, supports:
  14493. + 8007-0610 v1.0 w/ 8007-0510 v1.0
  14494. +
  14495. + Please see ip7500media.c for more details.
  14496. +
  14497. diff -ruN linux-2.6.28.10_o/arch/ubicom32/mach-ip7k/Makefile linux-2.6.28.10/arch/ubicom32/mach-ip7k/Makefile
  14498. --- linux-2.6.28.10_o/arch/ubicom32/mach-ip7k/Makefile 1970-01-01 02:00:00.000000000 +0200
  14499. +++ linux-2.6.28.10/arch/ubicom32/mach-ip7k/Makefile 2009-08-06 10:31:02.000000000 +0300
  14500. @@ -0,0 +1,35 @@
  14501. +#
  14502. +# arch/ubicom32/mach-ip7k/Makefile
  14503. +# Makefile for ip7k based boards.
  14504. +#
  14505. +# (C) Copyright 2009, Ubicom, Inc.
  14506. +#
  14507. +# This file is part of the Ubicom32 Linux Kernel Port.
  14508. +#
  14509. +# The Ubicom32 Linux Kernel Port is free software: you can redistribute
  14510. +# it and/or modify it under the terms of the GNU General Public License
  14511. +# as published by the Free Software Foundation, either version 2 of the
  14512. +# License, or (at your option) any later version.
  14513. +#
  14514. +# The Ubicom32 Linux Kernel Port is distributed in the hope that it
  14515. +# will be useful, but WITHOUT ANY WARRANTY; without even the implied
  14516. +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  14517. +# the GNU General Public License for more details.
  14518. +#
  14519. +# You should have received a copy of the GNU General Public License
  14520. +# along with the Ubicom32 Linux Kernel Port. If not,
  14521. +# see <http://www.gnu.org/licenses/>.
  14522. +#
  14523. +# Ubicom32 implementation derived from (with many thanks):
  14524. +# arch/m68knommu
  14525. +# arch/blackfin
  14526. +# arch/parisc
  14527. +#
  14528. +
  14529. +obj-$(CONFIG_IP7145DPF) += board-ip7145dpf.o
  14530. +obj-$(CONFIG_IP7160RGW) += board-ip7160rgw.o
  14531. +obj-$(CONFIG_IP7160BRINGUP) += board-ip7160bringup.o
  14532. +obj-$(CONFIG_IP7160DPF) += board-ip7160dpf.o
  14533. +obj-$(CONFIG_IP7500MODULE) += board-ip7500module.o
  14534. +obj-$(CONFIG_IP7500MEDIA) += board-ip7500media.o
  14535. +obj-$(CONFIG_IP7500AV) += board-ip7500av.o
  14536. diff -ruN linux-2.6.28.10_o/arch/ubicom32/Makefile linux-2.6.28.10/arch/ubicom32/Makefile
  14537. --- linux-2.6.28.10_o/arch/ubicom32/Makefile 1970-01-01 02:00:00.000000000 +0200
  14538. +++ linux-2.6.28.10/arch/ubicom32/Makefile 2009-08-06 10:31:02.000000000 +0300
  14539. @@ -0,0 +1,105 @@
  14540. +#
  14541. +# arch/ubicom32/Makefile
  14542. +# <TODO: Replace with short file description>
  14543. +#
  14544. +# (C) Copyright 2009, Ubicom, Inc.
  14545. +#
  14546. +# This file is part of the Ubicom32 Linux Kernel Port.
  14547. +#
  14548. +# The Ubicom32 Linux Kernel Port is free software: you can redistribute
  14549. +# it and/or modify it under the terms of the GNU General Public License
  14550. +# as published by the Free Software Foundation, either version 2 of the
  14551. +# License, or (at your option) any later version.
  14552. +#
  14553. +# The Ubicom32 Linux Kernel Port is distributed in the hope that it
  14554. +# will be useful, but WITHOUT ANY WARRANTY; without even the implied
  14555. +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  14556. +# the GNU General Public License for more details.
  14557. +#
  14558. +# You should have received a copy of the GNU General Public License
  14559. +# along with the Ubicom32 Linux Kernel Port. If not,
  14560. +# see <http://www.gnu.org/licenses/>.
  14561. +#
  14562. +# Ubicom32 implementation derived from (with many thanks):
  14563. +# arch/m68knommu
  14564. +# arch/blackfin
  14565. +# arch/parisc
  14566. +#
  14567. +
  14568. +KBUILD_DEFCONFIG :=
  14569. +
  14570. +# setup the machine name and machine dependent settings
  14571. +machine-$(CONFIG_UBICOM32_V3) := ip5k
  14572. +machine-$(CONFIG_UBICOM32_V4) := ip7k
  14573. +MACHINE := $(machine-y)
  14574. +export MACHINE
  14575. +
  14576. +model-$(CONFIG_RAMKERNEL) := ram
  14577. +model-$(CONFIG_ROMKERNEL) := rom
  14578. +MODEL := $(model-y)
  14579. +export MODEL
  14580. +
  14581. +CPUCLASS := $(cpuclass-y)
  14582. +
  14583. +export CPUCLASS
  14584. +
  14585. +#
  14586. +# We want the core kernel built using the fastcall ABI but modules need
  14587. +# to be built using the slower calling convention because they could be
  14588. +# loaded out of range for fast calls.
  14589. +#
  14590. +CFLAGS_KERNEL += -mfastcall
  14591. +CFLAGS_MODULE += -mno-fastcall
  14592. +
  14593. +#
  14594. +# Some CFLAG additions based on specific CPU type.
  14595. +#
  14596. +cflags-$(CONFIG_UBICOM32_V3) := -march=ubicom32v3 -DIP5000
  14597. +cflags-$(CONFIG_UBICOM32_V4) := -march=ubicom32v4 -DIP7000
  14598. +
  14599. +ldflags-$(CONFIG_LINKER_RELAXATION) := --relax
  14600. +LDFLAGS_vmlinux := $(ldflags-y)
  14601. +
  14602. +GCCLIBDIR := $(dir $(shell $(CC) $(cflags-y) -print-libgcc-file-name))
  14603. +GCC_LIBS := $(GCCLIBDIR)/libgcc.a
  14604. +
  14605. +KBUILD_CFLAGS += $(cflags-y) -ffunction-sections
  14606. +KBUILD_AFLAGS += $(cflags-y)
  14607. +
  14608. +KBUILD_CFLAGS += -D__linux__ -Dlinux
  14609. +KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
  14610. +
  14611. +# include any machine specific directory
  14612. +ifneq ($(machine-y),)
  14613. +core-y += arch/$(ARCH)/mach-$(MACHINE)/
  14614. +endif
  14615. +
  14616. +head-y := arch/$(ARCH)/kernel/head.o
  14617. +
  14618. +core-y += arch/$(ARCH)/kernel/ \
  14619. + arch/$(ARCH)/mm/ \
  14620. + arch/$(ARCH)/crypto/ \
  14621. + arch/$(ARCH)/mach-common/
  14622. +
  14623. +drivers-$(CONFIG_OPROFILE) += arch/ubicom32/oprofile/
  14624. +
  14625. +libs-y += arch/$(ARCH)/lib/
  14626. +libs-y += $(GCC_LIBS)
  14627. +
  14628. +archclean:
  14629. +
  14630. +# make sure developer has selected a valid board
  14631. +ifeq ($(CONFIG_NOBOARD),y)
  14632. +# $(error have to select a valid board file $(CONFIG_NOBOARD), please run kernel config again)
  14633. +_all: config_board_error
  14634. +endif
  14635. +
  14636. +config_board_error:
  14637. + @echo "*************************************************"
  14638. + @echo "You have not selected a proper board."
  14639. + @echo "Please run menuconfig (or config) against your"
  14640. + @echo "kernel and choose your board under Processor"
  14641. + @echo "options"
  14642. + @echo "*************************************************"
  14643. + @exit 1
  14644. +
  14645. diff -ruN linux-2.6.28.10_o/arch/ubicom32/mm/Makefile linux-2.6.28.10/arch/ubicom32/mm/Makefile
  14646. --- linux-2.6.28.10_o/arch/ubicom32/mm/Makefile 1970-01-01 02:00:00.000000000 +0200
  14647. +++ linux-2.6.28.10/arch/ubicom32/mm/Makefile 2009-08-12 13:08:37.000000000 +0300
  14648. @@ -0,0 +1,32 @@
  14649. +#
  14650. +# arch/ubicom32/mm/Makefile
  14651. +# <TODO: Replace with short file description>
  14652. +#
  14653. +# (C) Copyright 2009, Ubicom, Inc.
  14654. +#
  14655. +# This file is part of the Ubicom32 Linux Kernel Port.
  14656. +#
  14657. +# The Ubicom32 Linux Kernel Port is free software: you can redistribute
  14658. +# it and/or modify it under the terms of the GNU General Public License
  14659. +# as published by the Free Software Foundation, either version 2 of the
  14660. +# License, or (at your option) any later version.
  14661. +#
  14662. +# The Ubicom32 Linux Kernel Port is distributed in the hope that it
  14663. +# will be useful, but WITHOUT ANY WARRANTY; without even the implied
  14664. +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  14665. +# the GNU General Public License for more details.
  14666. +#
  14667. +# You should have received a copy of the GNU General Public License
  14668. +# along with the Ubicom32 Linux Kernel Port. If not,
  14669. +# see <http://www.gnu.org/licenses/>.
  14670. +#
  14671. +# Ubicom32 implementation derived from (with many thanks):
  14672. +# arch/m68knommu
  14673. +# arch/blackfin
  14674. +# arch/parisc
  14675. +#
  14676. +#
  14677. +# Makefile for the linux m68knommu specific parts of the memory manager.
  14678. +#
  14679. +
  14680. +obj-y += init.o fault.o memory.o kmap.o ocm-alloc.o
  14681. diff -ruN linux-2.6.28.10_o/include/linux/elf-em.h linux-2.6.28.10/include/linux/elf-em.h
  14682. --- linux-2.6.28.10_o/include/linux/elf-em.h 2009-05-02 21:54:43.000000000 +0300
  14683. +++ linux-2.6.28.10/include/linux/elf-em.h 2009-08-06 10:31:10.000000000 +0300
  14684. @@ -41,6 +41,7 @@
  14685. * up with a final number.
  14686. */
  14687. #define EM_ALPHA 0x9026
  14688. +#define EM_UBICOM32 0xde3d /* Ubicom32; no ABI */
  14689. /* Bogus old v850 magic number, used by old tools. */
  14690. #define EM_CYGNUS_V850 0x9080
  14691. diff -ruN linux-2.6.28.10_o/lib/Kconfig.debug linux-2.6.28.10/lib/Kconfig.debug
  14692. --- linux-2.6.28.10_o/lib/Kconfig.debug 2009-05-02 21:54:43.000000000 +0300
  14693. +++ linux-2.6.28.10/lib/Kconfig.debug 2009-08-06 10:31:11.000000000 +0300
  14694. @@ -549,7 +549,7 @@
  14695. bool "Compile the kernel with frame pointers"
  14696. depends on DEBUG_KERNEL && \
  14697. (X86 || CRIS || M68K || M68KNOMMU || FRV || UML || S390 || \
  14698. - AVR32 || SUPERH || BLACKFIN || MN10300)
  14699. + AVR32 || SUPERH || BLACKFIN || MN10300 || UBICOM32)
  14700. default y if DEBUG_INFO && UML
  14701. help
  14702. If you say Y here the resulting kernel image will be slightly larger
  14703. diff -ruN linux-2.6.28.10_o/scripts/mod/file2alias.c linux-2.6.28.10/scripts/mod/file2alias.c
  14704. --- linux-2.6.28.10_o/scripts/mod/file2alias.c 2009-05-02 21:54:43.000000000 +0300
  14705. +++ linux-2.6.28.10/scripts/mod/file2alias.c 2009-08-06 10:31:12.000000000 +0300
  14706. @@ -753,6 +753,15 @@
  14707. + sym->st_value;
  14708. }
  14709. + /*
  14710. + * somehow our gcc is not generating st_size correctly and set 0 for some symbols.
  14711. + * and 0 size will break do_table since it adjust size to (size - id_size)
  14712. + * this is to make sure st_size fall in range.
  14713. + */
  14714. + if (sym->st_size == 0 || sym->st_size > info->sechdrs[sym->st_shndx].sh_size) {
  14715. + sym->st_size = info->sechdrs[sym->st_shndx].sh_size;
  14716. + }
  14717. +
  14718. if (sym_is(symname, "__mod_pci_device_table"))
  14719. do_table(symval, sym->st_size,
  14720. sizeof(struct pci_device_id), "pci",