0025-NET-MIPS-lantiq-adds-xrx200-net.patch 156 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339
  1. From fb0c9601f4414c39ff68e26b88681bef0bb04954 Mon Sep 17 00:00:00 2001
  2. From: John Crispin <blogic@openwrt.org>
  3. Date: Mon, 22 Oct 2012 12:22:23 +0200
  4. Subject: [PATCH 25/36] NET: MIPS: lantiq: adds xrx200-net
  5. ---
  6. drivers/net/ethernet/Kconfig | 8 +-
  7. drivers/net/ethernet/Makefile | 1 +
  8. drivers/net/ethernet/lantiq_pce.h | 163 +++
  9. drivers/net/ethernet/lantiq_xrx200.c | 1798 +++++++++++++++++++++++++++++++
  10. drivers/net/ethernet/lantiq_xrx200_sw.h | 1328 +++++++++++++++++++++++
  11. 5 files changed, 3297 insertions(+), 1 deletion(-)
  12. create mode 100644 drivers/net/ethernet/lantiq_pce.h
  13. create mode 100644 drivers/net/ethernet/lantiq_xrx200.c
  14. create mode 100644 drivers/net/ethernet/lantiq_xrx200_sw.h
  15. --- a/drivers/net/ethernet/Kconfig
  16. +++ b/drivers/net/ethernet/Kconfig
  17. @@ -101,7 +101,13 @@ config LANTIQ_ETOP
  18. tristate "Lantiq SoC ETOP driver"
  19. depends on SOC_TYPE_XWAY
  20. ---help---
  21. - Support for the MII0 inside the Lantiq SoC
  22. + Support for the MII0 inside the Lantiq ADSL SoC
  23. +
  24. +config LANTIQ_XRX200
  25. + tristate "Lantiq SoC XRX200 driver"
  26. + depends on SOC_TYPE_XWAY
  27. + ---help---
  28. + Support for the MII0 inside the Lantiq VDSL SoC
  29. source "drivers/net/ethernet/marvell/Kconfig"
  30. source "drivers/net/ethernet/mellanox/Kconfig"
  31. --- a/drivers/net/ethernet/Makefile
  32. +++ b/drivers/net/ethernet/Makefile
  33. @@ -43,6 +43,7 @@ obj-$(CONFIG_IP1000) += icplus/
  34. obj-$(CONFIG_JME) += jme.o
  35. obj-$(CONFIG_KORINA) += korina.o
  36. obj-$(CONFIG_LANTIQ_ETOP) += lantiq_etop.o
  37. +obj-$(CONFIG_LANTIQ_XRX200) += lantiq_xrx200.o
  38. obj-$(CONFIG_NET_VENDOR_MARVELL) += marvell/
  39. obj-$(CONFIG_NET_VENDOR_MELLANOX) += mellanox/
  40. obj-$(CONFIG_NET_VENDOR_MICREL) += micrel/
  41. --- /dev/null
  42. +++ b/drivers/net/ethernet/lantiq_pce.h
  43. @@ -0,0 +1,163 @@
  44. +/*
  45. + * This program is free software; you can redistribute it and/or modify it
  46. + * under the terms of the GNU General Public License version 2 as published
  47. + * by the Free Software Foundation.
  48. + *
  49. + * This program is distributed in the hope that it will be useful,
  50. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  51. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  52. + * GNU General Public License for more details.
  53. + *
  54. + * You should have received a copy of the GNU General Public License
  55. + * along with this program; if not, write to the Free Software
  56. + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
  57. + *
  58. + * Copyright (C) 2010 Lantiq Deutschland GmbH
  59. + * Copyright (C) 2012 John Crispin <blogic@openwrt.org>
  60. + *
  61. + * PCE microcode extracted from UGW5.2 switch api
  62. + */
  63. +
  64. +/* Switch API Micro Code V0.3 */
  65. +enum {
  66. + OUT_MAC0 = 0,
  67. + OUT_MAC1,
  68. + OUT_MAC2,
  69. + OUT_MAC3,
  70. + OUT_MAC4,
  71. + OUT_MAC5,
  72. + OUT_ETHTYP,
  73. + OUT_VTAG0,
  74. + OUT_VTAG1,
  75. + OUT_ITAG0,
  76. + OUT_ITAG1, /*10 */
  77. + OUT_ITAG2,
  78. + OUT_ITAG3,
  79. + OUT_IP0,
  80. + OUT_IP1,
  81. + OUT_IP2,
  82. + OUT_IP3,
  83. + OUT_SIP0,
  84. + OUT_SIP1,
  85. + OUT_SIP2,
  86. + OUT_SIP3, /*20*/
  87. + OUT_SIP4,
  88. + OUT_SIP5,
  89. + OUT_SIP6,
  90. + OUT_SIP7,
  91. + OUT_DIP0,
  92. + OUT_DIP1,
  93. + OUT_DIP2,
  94. + OUT_DIP3,
  95. + OUT_DIP4,
  96. + OUT_DIP5, /*30*/
  97. + OUT_DIP6,
  98. + OUT_DIP7,
  99. + OUT_SESID,
  100. + OUT_PROT,
  101. + OUT_APP0,
  102. + OUT_APP1,
  103. + OUT_IGMP0,
  104. + OUT_IGMP1,
  105. + OUT_IPOFF, /*39*/
  106. + OUT_NONE = 63
  107. +};
  108. +
  109. +/* parser's microcode length type */
  110. +#define INSTR 0
  111. +#define IPV6 1
  112. +#define LENACCU 2
  113. +
  114. +/* parser's microcode flag type */
  115. +enum {
  116. + FLAG_ITAG = 0,
  117. + FLAG_VLAN,
  118. + FLAG_SNAP,
  119. + FLAG_PPPOE,
  120. + FLAG_IPV6,
  121. + FLAG_IPV6FL,
  122. + FLAG_IPV4,
  123. + FLAG_IGMP,
  124. + FLAG_TU,
  125. + FLAG_HOP,
  126. + FLAG_NN1, /*10 */
  127. + FLAG_NN2,
  128. + FLAG_END,
  129. + FLAG_NO, /*13*/
  130. +};
  131. +
  132. +/* Micro code version V2_11 (extension for parsing IPv6 in PPPoE) */
  133. +#define MC_ENTRY(val, msk, ns, out, len, type, flags, ipv4_len) \
  134. + { {val, msk, (ns<<10 | out<<4 | len>>1), (len&1)<<15 | type<<13 | flags<<9 | ipv4_len<<8 }}
  135. +struct pce_microcode {
  136. + unsigned short val[4];
  137. +/* unsigned short val_2;
  138. + unsigned short val_1;
  139. + unsigned short val_0;*/
  140. +} pce_microcode[] = {
  141. + /* value mask ns fields L type flags ipv4_len */
  142. + MC_ENTRY(0x88c3, 0xFFFF, 1, OUT_ITAG0, 4, INSTR, FLAG_ITAG, 0),
  143. + MC_ENTRY(0x8100, 0xFFFF, 2, OUT_VTAG0, 2, INSTR, FLAG_VLAN, 0),
  144. + MC_ENTRY(0x88A8, 0xFFFF, 1, OUT_VTAG0, 2, INSTR, FLAG_VLAN, 0),
  145. + MC_ENTRY(0x8100, 0xFFFF, 1, OUT_VTAG0, 2, INSTR, FLAG_VLAN, 0),
  146. + MC_ENTRY(0x8864, 0xFFFF, 17, OUT_ETHTYP, 1, INSTR, FLAG_NO, 0),
  147. + MC_ENTRY(0x0800, 0xFFFF, 21, OUT_ETHTYP, 1, INSTR, FLAG_NO, 0),
  148. + MC_ENTRY(0x86DD, 0xFFFF, 22, OUT_ETHTYP, 1, INSTR, FLAG_NO, 0),
  149. + MC_ENTRY(0x8863, 0xFFFF, 16, OUT_ETHTYP, 1, INSTR, FLAG_NO, 0),
  150. + MC_ENTRY(0x0000, 0xF800, 10, OUT_NONE, 0, INSTR, FLAG_NO, 0),
  151. + MC_ENTRY(0x0000, 0x0000, 38, OUT_ETHTYP, 1, INSTR, FLAG_NO, 0),
  152. + MC_ENTRY(0x0600, 0x0600, 38, OUT_ETHTYP, 1, INSTR, FLAG_NO, 0),
  153. + MC_ENTRY(0x0000, 0x0000, 12, OUT_NONE, 1, INSTR, FLAG_NO, 0),
  154. + MC_ENTRY(0xAAAA, 0xFFFF, 14, OUT_NONE, 1, INSTR, FLAG_NO, 0),
  155. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_NO, 0),
  156. + MC_ENTRY(0x0300, 0xFF00, 39, OUT_NONE, 0, INSTR, FLAG_SNAP, 0),
  157. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_NO, 0),
  158. + MC_ENTRY(0x0000, 0x0000, 39, OUT_DIP7, 3, INSTR, FLAG_NO, 0),
  159. + MC_ENTRY(0x0000, 0x0000, 18, OUT_DIP7, 3, INSTR, FLAG_PPPOE, 0),
  160. + MC_ENTRY(0x0021, 0xFFFF, 21, OUT_NONE, 1, INSTR, FLAG_NO, 0),
  161. + MC_ENTRY(0x0057, 0xFFFF, 22, OUT_NONE, 1, INSTR, FLAG_NO, 0),
  162. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_NO, 0),
  163. + MC_ENTRY(0x4000, 0xF000, 24, OUT_IP0, 4, INSTR, FLAG_IPV4, 1),
  164. + MC_ENTRY(0x6000, 0xF000, 27, OUT_IP0, 3, INSTR, FLAG_IPV6, 0),
  165. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_NO, 0),
  166. + MC_ENTRY(0x0000, 0x0000, 25, OUT_IP3, 2, INSTR, FLAG_NO, 0),
  167. + MC_ENTRY(0x0000, 0x0000, 26, OUT_SIP0, 4, INSTR, FLAG_NO, 0),
  168. + MC_ENTRY(0x0000, 0x0000, 38, OUT_NONE, 0, LENACCU, FLAG_NO, 0),
  169. + MC_ENTRY(0x1100, 0xFF00, 37, OUT_PROT, 1, INSTR, FLAG_NO, 0),
  170. + MC_ENTRY(0x0600, 0xFF00, 37, OUT_PROT, 1, INSTR, FLAG_NO, 0),
  171. + MC_ENTRY(0x0000, 0xFF00, 33, OUT_IP3, 17, INSTR, FLAG_HOP, 0),
  172. + MC_ENTRY(0x2B00, 0xFF00, 33, OUT_IP3, 17, INSTR, FLAG_NN1, 0),
  173. + MC_ENTRY(0x3C00, 0xFF00, 33, OUT_IP3, 17, INSTR, FLAG_NN2, 0),
  174. + MC_ENTRY(0x0000, 0x0000, 37, OUT_PROT, 1, INSTR, FLAG_NO, 0),
  175. + MC_ENTRY(0x0000, 0xFF00, 33, OUT_NONE, 0, IPV6, FLAG_HOP, 0),
  176. + MC_ENTRY(0x2B00, 0xFF00, 33, OUT_NONE, 0, IPV6, FLAG_NN1, 0),
  177. + MC_ENTRY(0x3C00, 0xFF00, 33, OUT_NONE, 0, IPV6, FLAG_NN2, 0),
  178. + MC_ENTRY(0x0000, 0x0000, 38, OUT_PROT, 1, IPV6, FLAG_NO, 0),
  179. + MC_ENTRY(0x0000, 0x0000, 38, OUT_SIP0, 16, INSTR, FLAG_NO, 0),
  180. + MC_ENTRY(0x0000, 0x0000, 39, OUT_APP0, 4, INSTR, FLAG_IGMP, 0),
  181. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  182. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  183. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  184. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  185. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  186. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  187. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  188. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  189. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  190. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  191. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  192. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  193. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  194. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  195. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  196. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  197. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  198. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  199. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  200. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  201. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  202. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  203. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  204. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  205. + MC_ENTRY(0x0000, 0x0000, 39, OUT_NONE, 0, INSTR, FLAG_END, 0),
  206. +};
  207. --- /dev/null
  208. +++ b/drivers/net/ethernet/lantiq_xrx200.c
  209. @@ -0,0 +1,1796 @@
  210. +/*
  211. + * This program is free software; you can redistribute it and/or modify it
  212. + * under the terms of the GNU General Public License version 2 as published
  213. + * by the Free Software Foundation.
  214. + *
  215. + * This program is distributed in the hope that it will be useful,
  216. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  217. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  218. + * GNU General Public License for more details.
  219. + *
  220. + * You should have received a copy of the GNU General Public License
  221. + * along with this program; if not, write to the Free Software
  222. + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
  223. + *
  224. + * Copyright (C) 2010 Lantiq Deutschland
  225. + * Copyright (C) 2012 John Crispin <blogic@openwrt.org>
  226. + */
  227. +
  228. +#include <linux/switch.h>
  229. +#include <linux/etherdevice.h>
  230. +#include <linux/module.h>
  231. +#include <linux/platform_device.h>
  232. +#include <linux/interrupt.h>
  233. +#include <linux/clk.h>
  234. +#include <asm/delay.h>
  235. +
  236. +#include <linux/of_net.h>
  237. +#include <linux/of_mdio.h>
  238. +#include <linux/of_gpio.h>
  239. +
  240. +#include <xway_dma.h>
  241. +#include <lantiq_soc.h>
  242. +
  243. +#include "lantiq_pce.h"
  244. +#include "lantiq_xrx200_sw.h"
  245. +
  246. +#define SW_POLLING
  247. +#define SW_ROUTING
  248. +/*#define SW_PORTMAP*/
  249. +
  250. +#ifdef SW_ROUTING
  251. + #ifdef SW_PORTMAP
  252. +#define XRX200_MAX_DEV 2
  253. + #else
  254. +#define XRX200_MAX_DEV 2
  255. + #endif
  256. +#else
  257. +#define XRX200_MAX_DEV 1
  258. +#endif
  259. +
  260. +#define XRX200_MAX_VLAN 64
  261. +#define XRX200_PCE_ACTVLAN_IDX 0x01
  262. +#define XRX200_PCE_VLANMAP_IDX 0x02
  263. +
  264. +#define XRX200_MAX_PORT 7
  265. +#define XRX200_MAX_DMA 8
  266. +
  267. +#define XRX200_HEADROOM 4
  268. +
  269. +#define XRX200_TX_TIMEOUT (10 * HZ)
  270. +
  271. +/* port type */
  272. +#define XRX200_PORT_TYPE_PHY 1
  273. +#define XRX200_PORT_TYPE_MAC 2
  274. +
  275. +/* DMA */
  276. +#define XRX200_DMA_DATA_LEN 0x600
  277. +#define XRX200_DMA_IRQ INT_NUM_IM2_IRL0
  278. +#define XRX200_DMA_RX 0
  279. +#define XRX200_DMA_TX 1
  280. +#define XRX200_DMA_IS_TX(x) (x%2)
  281. +#define XRX200_DMA_IS_RX(x) (!XRX200_DMA_IS_TX(x))
  282. +
  283. +/* fetch / store dma */
  284. +#define FDMA_PCTRL0 0x2A00
  285. +#define FDMA_PCTRLx(x) (FDMA_PCTRL0 + (x * 0x18))
  286. +#define SDMA_PCTRL0 0x2F00
  287. +#define SDMA_PCTRLx(x) (SDMA_PCTRL0 + (x * 0x18))
  288. +
  289. +/* buffer management */
  290. +#define BM_PCFG0 0x200
  291. +#define BM_PCFGx(x) (BM_PCFG0 + (x * 8))
  292. +
  293. +/* MDIO */
  294. +#define MDIO_GLOB 0x0000
  295. +#define MDIO_CTRL 0x0020
  296. +#define MDIO_READ 0x0024
  297. +#define MDIO_WRITE 0x0028
  298. +#define MDIO_PHY0 0x0054
  299. +#define MDIO_PHY(x) (0x0054 - (x * sizeof(unsigned)))
  300. +#define MDIO_CLK_CFG0 0x002C
  301. +#define MDIO_CLK_CFG1 0x0030
  302. +
  303. +#define MDIO_GLOB_ENABLE 0x8000
  304. +#define MDIO_BUSY BIT(12)
  305. +#define MDIO_RD BIT(11)
  306. +#define MDIO_WR BIT(10)
  307. +#define MDIO_MASK 0x1f
  308. +#define MDIO_ADDRSHIFT 5
  309. +#define MDIO1_25MHZ 9
  310. +
  311. +#define MDIO_PHY_LINK_DOWN 0x4000
  312. +#define MDIO_PHY_LINK_UP 0x2000
  313. +
  314. +#define MDIO_PHY_SPEED_M10 0x0000
  315. +#define MDIO_PHY_SPEED_M100 0x0800
  316. +#define MDIO_PHY_SPEED_G1 0x1000
  317. +
  318. +#define MDIO_PHY_FDUP_EN 0x0200
  319. +#define MDIO_PHY_FDUP_DIS 0x0600
  320. +
  321. +#define MDIO_PHY_LINK_MASK 0x6000
  322. +#define MDIO_PHY_SPEED_MASK 0x1800
  323. +#define MDIO_PHY_FDUP_MASK 0x0600
  324. +#define MDIO_PHY_ADDR_MASK 0x001f
  325. +#define MDIO_UPDATE_MASK MDIO_PHY_ADDR_MASK | MDIO_PHY_LINK_MASK | \
  326. + MDIO_PHY_SPEED_MASK | MDIO_PHY_FDUP_MASK
  327. +
  328. +/* MII */
  329. +#define MII_CFG(p) (p * 8)
  330. +
  331. +#define MII_CFG_EN BIT(14)
  332. +
  333. +#define MII_CFG_MODE_MIIP 0x0
  334. +#define MII_CFG_MODE_MIIM 0x1
  335. +#define MII_CFG_MODE_RMIIP 0x2
  336. +#define MII_CFG_MODE_RMIIM 0x3
  337. +#define MII_CFG_MODE_RGMII 0x4
  338. +#define MII_CFG_MODE_MASK 0xf
  339. +
  340. +#define MII_CFG_RATE_M2P5 0x00
  341. +#define MII_CFG_RATE_M25 0x10
  342. +#define MII_CFG_RATE_M125 0x20
  343. +#define MII_CFG_RATE_M50 0x30
  344. +#define MII_CFG_RATE_AUTO 0x40
  345. +#define MII_CFG_RATE_MASK 0x70
  346. +
  347. +/* cpu port mac */
  348. +#define PMAC_HD_CTL 0x0000
  349. +#define PMAC_RX_IPG 0x0024
  350. +#define PMAC_EWAN 0x002c
  351. +
  352. +#define PMAC_IPG_MASK 0xf
  353. +#define PMAC_HD_CTL_AS 0x0008
  354. +#define PMAC_HD_CTL_AC 0x0004
  355. +#define PMAC_HD_CTL_RXSH 0x0040
  356. +#define PMAC_HD_CTL_AST 0x0080
  357. +#define PMAC_HD_CTL_RST 0x0100
  358. +
  359. +/* PCE */
  360. +#define PCE_TBL_KEY(x) (0x1100 + ((7 - x) * 4))
  361. +#define PCE_TBL_MASK 0x1120
  362. +#define PCE_TBL_VAL(x) (0x1124 + ((4 - x) * 4))
  363. +#define PCE_TBL_ADDR 0x1138
  364. +#define PCE_TBL_CTRL 0x113c
  365. +#define PCE_PMAP1 0x114c
  366. +#define PCE_PMAP2 0x1150
  367. +#define PCE_PMAP3 0x1154
  368. +#define PCE_GCTRL_REG(x) (0x1158 + (x * 4))
  369. +#define PCE_PCTRL_REG(p, x) (0x1200 + (((p * 0xa) + x) * 4))
  370. +
  371. +#define PCE_TBL_BUSY BIT(15)
  372. +#define PCE_TBL_CFG_ADDR_MASK 0x1f
  373. +#define PCE_TBL_CFG_ADWR 0x20
  374. +#define PCE_TBL_CFG_ADWR_MASK 0x60
  375. +#define PCE_INGRESS BIT(11)
  376. +
  377. +/* MAC */
  378. +#define MAC_FLEN_REG (0x2314)
  379. +#define MAC_CTRL_REG(p, x) (0x240c + (((p * 0xc) + x) * 4))
  380. +
  381. +/* buffer management */
  382. +#define BM_PCFG(p) (0x200 + (p * 8))
  383. +
  384. +/* special tag in TX path header */
  385. +#define SPID_SHIFT 24
  386. +#define DPID_SHIFT 16
  387. +#define DPID_ENABLE 1
  388. +#define SPID_CPU_PORT 2
  389. +#define PORT_MAP_SEL BIT(15)
  390. +#define PORT_MAP_EN BIT(14)
  391. +#define PORT_MAP_SHIFT 1
  392. +#define PORT_MAP_MASK 0x3f
  393. +
  394. +#define SPPID_MASK 0x7
  395. +#define SPPID_SHIFT 4
  396. +
  397. +/* MII regs not yet in linux */
  398. +#define MDIO_DEVAD_NONE (-1)
  399. +#define ADVERTIZE_MPD (1 << 10)
  400. +
  401. +struct xrx200_port {
  402. + u8 num;
  403. + u8 phy_addr;
  404. + u16 flags;
  405. + phy_interface_t phy_if;
  406. +
  407. + int link;
  408. + int gpio;
  409. + enum of_gpio_flags gpio_flags;
  410. +
  411. + struct phy_device *phydev;
  412. + struct device_node *phy_node;
  413. +};
  414. +
  415. +struct xrx200_chan {
  416. + int idx;
  417. + int refcount;
  418. + int tx_free;
  419. +
  420. + struct net_device dummy_dev;
  421. + struct net_device *devs[XRX200_MAX_DEV];
  422. +
  423. + struct tasklet_struct tasklet;
  424. + struct napi_struct napi;
  425. + struct ltq_dma_channel dma;
  426. + struct sk_buff *skb[LTQ_DESC_NUM];
  427. +};
  428. +
  429. +struct xrx200_hw {
  430. + struct clk *clk;
  431. + struct mii_bus *mii_bus;
  432. +
  433. + struct xrx200_chan chan[XRX200_MAX_DMA];
  434. +
  435. + struct net_device *devs[XRX200_MAX_DEV];
  436. + int num_devs;
  437. +
  438. + int port_map[XRX200_MAX_PORT];
  439. + unsigned short wan_map;
  440. +
  441. + spinlock_t lock;
  442. +
  443. + struct switch_dev swdev;
  444. +};
  445. +
  446. +struct xrx200_priv {
  447. + struct net_device_stats stats;
  448. + int id;
  449. +
  450. + struct xrx200_port port[XRX200_MAX_PORT];
  451. + int num_port;
  452. + bool wan;
  453. + bool sw;
  454. + unsigned short port_map;
  455. + unsigned char mac[6];
  456. +
  457. + struct xrx200_hw *hw;
  458. +};
  459. +
  460. +static __iomem void *xrx200_switch_membase;
  461. +static __iomem void *xrx200_mii_membase;
  462. +static __iomem void *xrx200_mdio_membase;
  463. +static __iomem void *xrx200_pmac_membase;
  464. +
  465. +#define ltq_switch_r32(x) ltq_r32(xrx200_switch_membase + (x))
  466. +#define ltq_switch_w32(x, y) ltq_w32(x, xrx200_switch_membase + (y))
  467. +#define ltq_switch_w32_mask(x, y, z) \
  468. + ltq_w32_mask(x, y, xrx200_switch_membase + (z))
  469. +
  470. +#define ltq_mdio_r32(x) ltq_r32(xrx200_mdio_membase + (x))
  471. +#define ltq_mdio_w32(x, y) ltq_w32(x, xrx200_mdio_membase + (y))
  472. +#define ltq_mdio_w32_mask(x, y, z) \
  473. + ltq_w32_mask(x, y, xrx200_mdio_membase + (z))
  474. +
  475. +#define ltq_mii_r32(x) ltq_r32(xrx200_mii_membase + (x))
  476. +#define ltq_mii_w32(x, y) ltq_w32(x, xrx200_mii_membase + (y))
  477. +#define ltq_mii_w32_mask(x, y, z) \
  478. + ltq_w32_mask(x, y, xrx200_mii_membase + (z))
  479. +
  480. +#define ltq_pmac_r32(x) ltq_r32(xrx200_pmac_membase + (x))
  481. +#define ltq_pmac_w32(x, y) ltq_w32(x, xrx200_pmac_membase + (y))
  482. +#define ltq_pmac_w32_mask(x, y, z) \
  483. + ltq_w32_mask(x, y, xrx200_pmac_membase + (z))
  484. +
  485. +#define XRX200_GLOBAL_REGATTR(reg) \
  486. + .id = reg, \
  487. + .type = SWITCH_TYPE_INT, \
  488. + .set = xrx200_set_global_attr, \
  489. + .get = xrx200_get_global_attr
  490. +
  491. +#define XRX200_PORT_REGATTR(reg) \
  492. + .id = reg, \
  493. + .type = SWITCH_TYPE_INT, \
  494. + .set = xrx200_set_port_attr, \
  495. + .get = xrx200_get_port_attr
  496. +
  497. +static int xrx200sw_read_x(int reg, int x)
  498. +{
  499. + int value, mask, addr;
  500. +
  501. + addr = xrx200sw_reg[reg].offset + (xrx200sw_reg[reg].mult * x);
  502. + value = ltq_switch_r32(addr);
  503. + mask = (1 << xrx200sw_reg[reg].size) - 1;
  504. + value = (value >> xrx200sw_reg[reg].shift);
  505. +
  506. + return (value & mask);
  507. +}
  508. +
  509. +static int xrx200sw_read(int reg)
  510. +{
  511. + return xrx200sw_read_x(reg, 0);
  512. +}
  513. +
  514. +static void xrx200sw_write_x(int value, int reg, int x)
  515. +{
  516. + int mask, addr;
  517. +
  518. + addr = xrx200sw_reg[reg].offset + (xrx200sw_reg[reg].mult * x);
  519. + mask = (1 << xrx200sw_reg[reg].size) - 1;
  520. + mask = (mask << xrx200sw_reg[reg].shift);
  521. + value = (value << xrx200sw_reg[reg].shift) & mask;
  522. +
  523. + ltq_switch_w32_mask(mask, value, addr);
  524. +}
  525. +
  526. +static void xrx200sw_write(int value, int reg)
  527. +{
  528. + xrx200sw_write_x(value, reg, 0);
  529. +}
  530. +
  531. +struct xrx200_pce_table_entry {
  532. + int index; // PCE_TBL_ADDR.ADDR = pData->table_index
  533. + int table; // PCE_TBL_CTRL.ADDR = pData->table
  534. + unsigned short key[8];
  535. + unsigned short val[5];
  536. + unsigned short mask;
  537. + unsigned short type;
  538. + unsigned short valid;
  539. + unsigned short gmap;
  540. +};
  541. +
  542. +static int xrx200_pce_table_entry_read(struct xrx200_pce_table_entry *tbl)
  543. +{
  544. + // wait until hardware is ready
  545. + while (xrx200sw_read(XRX200_PCE_TBL_CTRL_BAS)) {};
  546. +
  547. + // prepare the table access:
  548. + // PCE_TBL_ADDR.ADDR = pData->table_index
  549. + xrx200sw_write(tbl->index, XRX200_PCE_TBL_ADDR_ADDR);
  550. + // PCE_TBL_CTRL.ADDR = pData->table
  551. + xrx200sw_write(tbl->table, XRX200_PCE_TBL_CTRL_ADDR);
  552. +
  553. + //(address-based read)
  554. + xrx200sw_write(0, XRX200_PCE_TBL_CTRL_OPMOD); // OPMOD_ADRD
  555. +
  556. + xrx200sw_write(1, XRX200_PCE_TBL_CTRL_BAS); // start access
  557. +
  558. + // wait until hardware is ready
  559. + while (xrx200sw_read(XRX200_PCE_TBL_CTRL_BAS)) {};
  560. +
  561. + // read the keys
  562. + tbl->key[7] = xrx200sw_read(XRX200_PCE_TBL_KEY_7);
  563. + tbl->key[6] = xrx200sw_read(XRX200_PCE_TBL_KEY_6);
  564. + tbl->key[5] = xrx200sw_read(XRX200_PCE_TBL_KEY_5);
  565. + tbl->key[4] = xrx200sw_read(XRX200_PCE_TBL_KEY_4);
  566. + tbl->key[3] = xrx200sw_read(XRX200_PCE_TBL_KEY_3);
  567. + tbl->key[2] = xrx200sw_read(XRX200_PCE_TBL_KEY_2);
  568. + tbl->key[1] = xrx200sw_read(XRX200_PCE_TBL_KEY_1);
  569. + tbl->key[0] = xrx200sw_read(XRX200_PCE_TBL_KEY_0);
  570. +
  571. + // read the values
  572. + tbl->val[4] = xrx200sw_read(XRX200_PCE_TBL_VAL_4);
  573. + tbl->val[3] = xrx200sw_read(XRX200_PCE_TBL_VAL_3);
  574. + tbl->val[2] = xrx200sw_read(XRX200_PCE_TBL_VAL_2);
  575. + tbl->val[1] = xrx200sw_read(XRX200_PCE_TBL_VAL_1);
  576. + tbl->val[0] = xrx200sw_read(XRX200_PCE_TBL_VAL_0);
  577. +
  578. + // read the mask
  579. + tbl->mask = xrx200sw_read(XRX200_PCE_TBL_MASK_0);
  580. + // read the type
  581. + tbl->type = xrx200sw_read(XRX200_PCE_TBL_CTRL_TYPE);
  582. + // read the valid flag
  583. + tbl->valid = xrx200sw_read(XRX200_PCE_TBL_CTRL_VLD);
  584. + // read the group map
  585. + tbl->gmap = xrx200sw_read(XRX200_PCE_TBL_CTRL_GMAP);
  586. +
  587. + return 0;
  588. +}
  589. +
  590. +static int xrx200_pce_table_entry_write(struct xrx200_pce_table_entry *tbl)
  591. +{
  592. + // wait until hardware is ready
  593. + while (xrx200sw_read(XRX200_PCE_TBL_CTRL_BAS)) {};
  594. +
  595. + // prepare the table access:
  596. + // PCE_TBL_ADDR.ADDR = pData->table_index
  597. + xrx200sw_write(tbl->index, XRX200_PCE_TBL_ADDR_ADDR);
  598. + // PCE_TBL_CTRL.ADDR = pData->table
  599. + xrx200sw_write(tbl->table, XRX200_PCE_TBL_CTRL_ADDR);
  600. +
  601. + //(address-based write)
  602. + xrx200sw_write(1, XRX200_PCE_TBL_CTRL_OPMOD); // OPMOD_ADRD
  603. +
  604. + // read the keys
  605. + xrx200sw_write(tbl->key[7], XRX200_PCE_TBL_KEY_7);
  606. + xrx200sw_write(tbl->key[6], XRX200_PCE_TBL_KEY_6);
  607. + xrx200sw_write(tbl->key[5], XRX200_PCE_TBL_KEY_5);
  608. + xrx200sw_write(tbl->key[4], XRX200_PCE_TBL_KEY_4);
  609. + xrx200sw_write(tbl->key[3], XRX200_PCE_TBL_KEY_3);
  610. + xrx200sw_write(tbl->key[2], XRX200_PCE_TBL_KEY_2);
  611. + xrx200sw_write(tbl->key[1], XRX200_PCE_TBL_KEY_1);
  612. + xrx200sw_write(tbl->key[0], XRX200_PCE_TBL_KEY_0);
  613. +
  614. + // read the values
  615. + xrx200sw_write(tbl->val[4], XRX200_PCE_TBL_VAL_4);
  616. + xrx200sw_write(tbl->val[3], XRX200_PCE_TBL_VAL_3);
  617. + xrx200sw_write(tbl->val[2], XRX200_PCE_TBL_VAL_2);
  618. + xrx200sw_write(tbl->val[1], XRX200_PCE_TBL_VAL_1);
  619. + xrx200sw_write(tbl->val[0], XRX200_PCE_TBL_VAL_0);
  620. +
  621. + // read the mask
  622. + xrx200sw_write(tbl->mask, XRX200_PCE_TBL_MASK_0);
  623. + // read the type
  624. + xrx200sw_write(tbl->type, XRX200_PCE_TBL_CTRL_TYPE);
  625. + // read the valid flag
  626. + xrx200sw_write(tbl->valid, XRX200_PCE_TBL_CTRL_VLD);
  627. + // read the group map
  628. + xrx200sw_write(tbl->gmap, XRX200_PCE_TBL_CTRL_GMAP);
  629. +
  630. + xrx200sw_write(1, XRX200_PCE_TBL_CTRL_BAS); // start access
  631. +
  632. + // wait until hardware is ready
  633. + while (xrx200sw_read(XRX200_PCE_TBL_CTRL_BAS)) {};
  634. +
  635. + return 0;
  636. +}
  637. +
  638. +static void xrx200sw_fixup_pvids(void)
  639. +{
  640. + int index, p, portmap, untagged;
  641. + struct xrx200_pce_table_entry tem;
  642. + struct xrx200_pce_table_entry tev;
  643. +
  644. + portmap = 0;
  645. + for (p = 0; p < XRX200_MAX_PORT; p++)
  646. + portmap |= BIT(p);
  647. +
  648. + tem.table = XRX200_PCE_VLANMAP_IDX;
  649. + tev.table = XRX200_PCE_ACTVLAN_IDX;
  650. +
  651. + for (index = XRX200_MAX_VLAN; index-- > 0;)
  652. + {
  653. + tev.index = index;
  654. + xrx200_pce_table_entry_read(&tev);
  655. +
  656. + if (tev.valid == 0)
  657. + continue;
  658. +
  659. + tem.index = index;
  660. + xrx200_pce_table_entry_read(&tem);
  661. +
  662. + if (tem.val[0] == 0)
  663. + continue;
  664. +
  665. + untagged = portmap & (tem.val[1] ^ tem.val[2]);
  666. +
  667. + for (p = 0; p < XRX200_MAX_PORT; p++)
  668. + if (untagged & BIT(p))
  669. + {
  670. + portmap &= ~BIT(p);
  671. + xrx200sw_write_x(index, XRX200_PCE_DEFPVID_PVID, p);
  672. + }
  673. +
  674. + for (p = 0; p < XRX200_MAX_PORT; p++)
  675. + if (portmap & BIT(p))
  676. + xrx200sw_write_x(index, XRX200_PCE_DEFPVID_PVID, p);
  677. + }
  678. +}
  679. +
  680. +// swconfig interface
  681. +static void xrx200_hw_init(struct xrx200_hw *hw);
  682. +
  683. +// global
  684. +static int xrx200sw_reset_switch(struct switch_dev *dev)
  685. +{
  686. + struct xrx200_hw *hw = container_of(dev, struct xrx200_hw, swdev);
  687. +
  688. + xrx200_hw_init(hw);
  689. +
  690. + return 0;
  691. +}
  692. +
  693. +static int xrx200_set_vlan_mode_enable(struct switch_dev *dev, const struct switch_attr *attr, struct switch_val *val)
  694. +{
  695. + int p;
  696. +
  697. + if ((attr->max > 0) && (val->value.i > attr->max))
  698. + return -EINVAL;
  699. +
  700. + for (p = 0; p < XRX200_MAX_PORT; p++) {
  701. + xrx200sw_write_x(val->value.i, XRX200_PCE_VCTRL_VEMR, p);
  702. + xrx200sw_write_x(val->value.i, XRX200_PCE_VCTRL_VIMR, p);
  703. + }
  704. +
  705. + xrx200sw_write(val->value.i, XRX200_PCE_GCTRL_0_VLAN);
  706. + return 0;
  707. +}
  708. +
  709. +static int xrx200_get_vlan_mode_enable(struct switch_dev *dev, const struct switch_attr *attr, struct switch_val *val)
  710. +{
  711. + val->value.i = xrx200sw_read(attr->id);
  712. + return 0;
  713. +}
  714. +
  715. +static int xrx200_set_global_attr(struct switch_dev *dev, const struct switch_attr *attr, struct switch_val *val)
  716. +{
  717. + if ((attr->max > 0) && (val->value.i > attr->max))
  718. + return -EINVAL;
  719. +
  720. + xrx200sw_write(val->value.i, attr->id);
  721. + return 0;
  722. +}
  723. +
  724. +static int xrx200_get_global_attr(struct switch_dev *dev, const struct switch_attr *attr, struct switch_val *val)
  725. +{
  726. + val->value.i = xrx200sw_read(attr->id);
  727. + return 0;
  728. +}
  729. +
  730. +// vlan
  731. +static int xrx200sw_set_vlan_vid(struct switch_dev *dev, const struct switch_attr *attr,
  732. + struct switch_val *val)
  733. +{
  734. + int i;
  735. + struct xrx200_pce_table_entry tev;
  736. + struct xrx200_pce_table_entry tem;
  737. +
  738. + tev.table = XRX200_PCE_ACTVLAN_IDX;
  739. +
  740. + for (i = 0; i < XRX200_MAX_VLAN; i++)
  741. + {
  742. + tev.index = i;
  743. + xrx200_pce_table_entry_read(&tev);
  744. + if (tev.key[0] == val->value.i && i != val->port_vlan)
  745. + return -EINVAL;
  746. + }
  747. +
  748. + tev.index = val->port_vlan;
  749. + xrx200_pce_table_entry_read(&tev);
  750. + tev.key[0] = val->value.i;
  751. + tev.valid = val->value.i > 0;
  752. + xrx200_pce_table_entry_write(&tev);
  753. +
  754. + tem.table = XRX200_PCE_VLANMAP_IDX;
  755. + tem.index = val->port_vlan;
  756. + xrx200_pce_table_entry_read(&tem);
  757. + tem.val[0] = val->value.i;
  758. + xrx200_pce_table_entry_write(&tem);
  759. +
  760. + xrx200sw_fixup_pvids();
  761. + return 0;
  762. +}
  763. +
  764. +static int xrx200sw_get_vlan_vid(struct switch_dev *dev, const struct switch_attr *attr,
  765. + struct switch_val *val)
  766. +{
  767. + struct xrx200_pce_table_entry te;
  768. +
  769. + te.table = XRX200_PCE_ACTVLAN_IDX;
  770. + te.index = val->port_vlan;
  771. + xrx200_pce_table_entry_read(&te);
  772. + val->value.i = te.key[0];
  773. +
  774. + return 0;
  775. +}
  776. +
  777. +static int xrx200sw_set_vlan_ports(struct switch_dev *dev, struct switch_val *val)
  778. +{
  779. + int i, portmap, tagmap, untagged;
  780. + struct xrx200_pce_table_entry tem;
  781. +
  782. + portmap = 0;
  783. + tagmap = 0;
  784. + for (i = 0; i < val->len; i++)
  785. + {
  786. + struct switch_port *p = &val->value.ports[i];
  787. +
  788. + portmap |= (1 << p->id);
  789. + if (p->flags & (1 << SWITCH_PORT_FLAG_TAGGED))
  790. + tagmap |= (1 << p->id);
  791. + }
  792. +
  793. + tem.table = XRX200_PCE_VLANMAP_IDX;
  794. +
  795. + untagged = portmap ^ tagmap;
  796. + for (i = 0; i < XRX200_MAX_VLAN; i++)
  797. + {
  798. + tem.index = i;
  799. + xrx200_pce_table_entry_read(&tem);
  800. +
  801. + if (tem.val[0] == 0)
  802. + continue;
  803. +
  804. + if ((untagged & (tem.val[1] ^ tem.val[2])) && (val->port_vlan != i))
  805. + return -EINVAL;
  806. + }
  807. +
  808. + tem.index = val->port_vlan;
  809. + xrx200_pce_table_entry_read(&tem);
  810. +
  811. + // auto-enable this vlan if not enabled already
  812. + if (tem.val[0] == 0)
  813. + {
  814. + struct switch_val v;
  815. + v.port_vlan = val->port_vlan;
  816. + v.value.i = val->port_vlan;
  817. + if(xrx200sw_set_vlan_vid(dev, NULL, &v))
  818. + return -EINVAL;
  819. +
  820. + //read updated tem
  821. + tem.index = val->port_vlan;
  822. + xrx200_pce_table_entry_read(&tem);
  823. + }
  824. +
  825. + tem.val[1] = portmap;
  826. + tem.val[2] = tagmap;
  827. + xrx200_pce_table_entry_write(&tem);
  828. +
  829. + xrx200sw_fixup_pvids();
  830. +
  831. + return 0;
  832. +}
  833. +
  834. +static int xrx200sw_get_vlan_ports(struct switch_dev *dev, struct switch_val *val)
  835. +{
  836. + int i;
  837. + unsigned short ports, tags;
  838. + struct xrx200_pce_table_entry tem;
  839. +
  840. + tem.table = XRX200_PCE_VLANMAP_IDX;
  841. + tem.index = val->port_vlan;
  842. + xrx200_pce_table_entry_read(&tem);
  843. +
  844. + ports = tem.val[1];
  845. + tags = tem.val[2];
  846. +
  847. + for (i = 0; i < XRX200_MAX_PORT; i++) {
  848. + struct switch_port *p;
  849. +
  850. + if (!(ports & (1 << i)))
  851. + continue;
  852. +
  853. + p = &val->value.ports[val->len++];
  854. + p->id = i;
  855. + if (tags & (1 << i))
  856. + p->flags = (1 << SWITCH_PORT_FLAG_TAGGED);
  857. + else
  858. + p->flags = 0;
  859. + }
  860. +
  861. + return 0;
  862. +}
  863. +
  864. +static int xrx200sw_set_vlan_enable(struct switch_dev *dev, const struct switch_attr *attr,
  865. + struct switch_val *val)
  866. +{
  867. + struct xrx200_pce_table_entry tev;
  868. +
  869. + tev.table = XRX200_PCE_ACTVLAN_IDX;
  870. + tev.index = val->port_vlan;
  871. + xrx200_pce_table_entry_read(&tev);
  872. +
  873. + if (tev.key[0] == 0)
  874. + return -EINVAL;
  875. +
  876. + tev.valid = val->value.i;
  877. + xrx200_pce_table_entry_write(&tev);
  878. +
  879. + xrx200sw_fixup_pvids();
  880. + return 0;
  881. +}
  882. +
  883. +static int xrx200sw_get_vlan_enable(struct switch_dev *dev, const struct switch_attr *attr,
  884. + struct switch_val *val)
  885. +{
  886. + struct xrx200_pce_table_entry tev;
  887. +
  888. + tev.table = XRX200_PCE_ACTVLAN_IDX;
  889. + tev.index = val->port_vlan;
  890. + xrx200_pce_table_entry_read(&tev);
  891. + val->value.i = tev.valid;
  892. +
  893. + return 0;
  894. +}
  895. +
  896. +// port
  897. +static int xrx200sw_get_port_pvid(struct switch_dev *dev, int port, int *val)
  898. +{
  899. + struct xrx200_pce_table_entry tev;
  900. +
  901. + if (port >= XRX200_MAX_PORT)
  902. + return -EINVAL;
  903. +
  904. + tev.table = XRX200_PCE_ACTVLAN_IDX;
  905. + tev.index = xrx200sw_read_x(XRX200_PCE_DEFPVID_PVID, port);
  906. + xrx200_pce_table_entry_read(&tev);
  907. +
  908. + *val = tev.key[0];
  909. + return 0;
  910. +}
  911. +
  912. +static int xrx200sw_get_port_link(struct switch_dev *dev,
  913. + int port,
  914. + struct switch_port_link *link)
  915. +{
  916. + if (port >= XRX200_MAX_PORT)
  917. + return -EINVAL;
  918. +
  919. + link->link = xrx200sw_read_x(XRX200_MAC_PSTAT_LSTAT, port);
  920. + if (!link->link)
  921. + return 0;
  922. +
  923. + link->duplex = xrx200sw_read_x(XRX200_MAC_PSTAT_FDUP, port);
  924. +
  925. + link->rx_flow = !!(xrx200sw_read_x(XRX200_MAC_CTRL_0_FCON, port) && 0x0010);
  926. + link->tx_flow = !!(xrx200sw_read_x(XRX200_MAC_CTRL_0_FCON, port) && 0x0020);
  927. + link->aneg = !(xrx200sw_read_x(XRX200_MAC_CTRL_0_FCON, port));
  928. +
  929. + link->speed = SWITCH_PORT_SPEED_10;
  930. + if (xrx200sw_read_x(XRX200_MAC_PSTAT_MBIT, port))
  931. + link->speed = SWITCH_PORT_SPEED_100;
  932. + if (xrx200sw_read_x(XRX200_MAC_PSTAT_GBIT, port))
  933. + link->speed = SWITCH_PORT_SPEED_1000;
  934. +
  935. + return 0;
  936. +}
  937. +
  938. +static int xrx200_set_port_attr(struct switch_dev *dev, const struct switch_attr *attr, struct switch_val *val)
  939. +{
  940. + printk("%s %s(%d)\n", __FILE__, __func__, __LINE__);
  941. + if (val->port_vlan >= XRX200_MAX_PORT)
  942. + return -EINVAL;
  943. +
  944. + if ((attr->max > 0) && (val->value.i > attr->max))
  945. + return -EINVAL;
  946. +
  947. + xrx200sw_write_x(val->value.i, attr->id, val->port_vlan);
  948. + return 0;
  949. +}
  950. +
  951. +static int xrx200_get_port_attr(struct switch_dev *dev, const struct switch_attr *attr, struct switch_val *val)
  952. +{
  953. + if (val->port_vlan >= XRX200_MAX_PORT)
  954. + return -EINVAL;
  955. +
  956. + val->value.i = xrx200sw_read_x(attr->id, val->port_vlan);
  957. + return 0;
  958. +}
  959. +
  960. +// attributes
  961. +static struct switch_attr xrx200sw_globals[] = {
  962. + {
  963. + .type = SWITCH_TYPE_INT,
  964. + .set = xrx200_set_vlan_mode_enable,
  965. + .get = xrx200_get_vlan_mode_enable,
  966. + .name = "enable_vlan",
  967. + .description = "Enable VLAN mode",
  968. + .max = 1},
  969. +};
  970. +
  971. +static struct switch_attr xrx200sw_port[] = {
  972. + {
  973. + XRX200_PORT_REGATTR(XRX200_PCE_VCTRL_UVR),
  974. + .name = "uvr",
  975. + .description = "Unknown VLAN Rule",
  976. + .max = 1,
  977. + },
  978. + {
  979. + XRX200_PORT_REGATTR(XRX200_PCE_VCTRL_VSR),
  980. + .name = "vsr",
  981. + .description = "VLAN Security Rule",
  982. + .max = 1,
  983. + },
  984. + {
  985. + XRX200_PORT_REGATTR(XRX200_PCE_VCTRL_VINR),
  986. + .name = "vinr",
  987. + .description = "VLAN Ingress Tag Rule",
  988. + .max = 2,
  989. + },
  990. + {
  991. + XRX200_PORT_REGATTR(XRX200_PCE_PCTRL_0_TVM),
  992. + .name = "tvm",
  993. + .description = "Transparent VLAN Mode",
  994. + .max = 1,
  995. + },
  996. +};
  997. +
  998. +static struct switch_attr xrx200sw_vlan[] = {
  999. + {
  1000. + .type = SWITCH_TYPE_INT,
  1001. + .name = "vid",
  1002. + .description = "VLAN ID (0-4094)",
  1003. + .set = xrx200sw_set_vlan_vid,
  1004. + .get = xrx200sw_get_vlan_vid,
  1005. + .max = 4094,
  1006. + },
  1007. + {
  1008. + .type = SWITCH_TYPE_INT,
  1009. + .name = "enable",
  1010. + .description = "Enable VLAN",
  1011. + .set = xrx200sw_set_vlan_enable,
  1012. + .get = xrx200sw_get_vlan_enable,
  1013. + .max = 1,
  1014. + },
  1015. +};
  1016. +
  1017. +static const struct switch_dev_ops xrx200sw_ops = {
  1018. + .attr_global = {
  1019. + .attr = xrx200sw_globals,
  1020. + .n_attr = ARRAY_SIZE(xrx200sw_globals),
  1021. + },
  1022. + .attr_port = {
  1023. + .attr = xrx200sw_port,
  1024. + .n_attr = ARRAY_SIZE(xrx200sw_port),
  1025. + },
  1026. + .attr_vlan = {
  1027. + .attr = xrx200sw_vlan,
  1028. + .n_attr = ARRAY_SIZE(xrx200sw_vlan),
  1029. + },
  1030. + .get_vlan_ports = xrx200sw_get_vlan_ports,
  1031. + .set_vlan_ports = xrx200sw_set_vlan_ports,
  1032. + .get_port_pvid = xrx200sw_get_port_pvid,
  1033. + .reset_switch = xrx200sw_reset_switch,
  1034. + .get_port_link = xrx200sw_get_port_link,
  1035. +// .get_port_stats = xrx200sw_get_port_stats, //TODO
  1036. +};
  1037. +
  1038. +static int xrx200sw_init(struct xrx200_hw *hw)
  1039. +{
  1040. + int netdev_num;
  1041. +
  1042. + for (netdev_num = 0; netdev_num < hw->num_devs; netdev_num++)
  1043. + {
  1044. + struct switch_dev *swdev;
  1045. + struct net_device *dev = hw->devs[netdev_num];
  1046. + struct xrx200_priv *priv = netdev_priv(dev);
  1047. + if (!priv->sw)
  1048. + continue;
  1049. +
  1050. + swdev = &hw->swdev;
  1051. +
  1052. + swdev->name = "Lantiq XRX200 Switch";
  1053. + swdev->vlans = XRX200_MAX_VLAN;
  1054. + swdev->ports = XRX200_MAX_PORT;
  1055. + swdev->cpu_port = 6;
  1056. + swdev->ops = &xrx200sw_ops;
  1057. +
  1058. + register_switch(swdev, dev);
  1059. + return 0; // enough switches
  1060. + }
  1061. + return 0;
  1062. +}
  1063. +
  1064. +static int xrx200_open(struct net_device *dev)
  1065. +{
  1066. + struct xrx200_priv *priv = netdev_priv(dev);
  1067. + unsigned long flags;
  1068. + int i;
  1069. +
  1070. + for (i = 0; i < XRX200_MAX_DMA; i++) {
  1071. + if (!priv->hw->chan[i].dma.irq)
  1072. + continue;
  1073. + spin_lock_irqsave(&priv->hw->lock, flags);
  1074. + if (!priv->hw->chan[i].refcount) {
  1075. + if (XRX200_DMA_IS_RX(i))
  1076. + napi_enable(&priv->hw->chan[i].napi);
  1077. + ltq_dma_open(&priv->hw->chan[i].dma);
  1078. + }
  1079. + priv->hw->chan[i].refcount++;
  1080. + spin_unlock_irqrestore(&priv->hw->lock, flags);
  1081. + }
  1082. + for (i = 0; i < priv->num_port; i++)
  1083. + if (priv->port[i].phydev)
  1084. + phy_start(priv->port[i].phydev);
  1085. + netif_start_queue(dev);
  1086. +
  1087. + return 0;
  1088. +}
  1089. +
  1090. +static int xrx200_close(struct net_device *dev)
  1091. +{
  1092. + struct xrx200_priv *priv = netdev_priv(dev);
  1093. + unsigned long flags;
  1094. + int i;
  1095. +
  1096. + netif_stop_queue(dev);
  1097. +
  1098. + for (i = 0; i < priv->num_port; i++)
  1099. + if (priv->port[i].phydev)
  1100. + phy_stop(priv->port[i].phydev);
  1101. +
  1102. + for (i = 0; i < XRX200_MAX_DMA; i++) {
  1103. + if (!priv->hw->chan[i].dma.irq)
  1104. + continue;
  1105. + spin_lock_irqsave(&priv->hw->lock, flags);
  1106. + priv->hw->chan[i].refcount--;
  1107. + if (!priv->hw->chan[i].refcount) {
  1108. + if (XRX200_DMA_IS_RX(i))
  1109. + napi_disable(&priv->hw->chan[i].napi);
  1110. + ltq_dma_close(&priv->hw->chan[XRX200_DMA_RX].dma);
  1111. + }
  1112. + spin_unlock_irqrestore(&priv->hw->lock, flags);
  1113. + }
  1114. +
  1115. + return 0;
  1116. +}
  1117. +
  1118. +static int xrx200_alloc_skb(struct xrx200_chan *ch)
  1119. +{
  1120. +#define DMA_PAD (NET_IP_ALIGN + NET_SKB_PAD)
  1121. + ch->skb[ch->dma.desc] = dev_alloc_skb(XRX200_DMA_DATA_LEN + DMA_PAD);
  1122. + if (!ch->skb[ch->dma.desc])
  1123. + return -ENOMEM;
  1124. +
  1125. + skb_reserve(ch->skb[ch->dma.desc], NET_SKB_PAD);
  1126. + ch->dma.desc_base[ch->dma.desc].addr = dma_map_single(NULL,
  1127. + ch->skb[ch->dma.desc]->data, XRX200_DMA_DATA_LEN,
  1128. + DMA_FROM_DEVICE);
  1129. + ch->dma.desc_base[ch->dma.desc].addr =
  1130. + CPHYSADDR(ch->skb[ch->dma.desc]->data);
  1131. + ch->dma.desc_base[ch->dma.desc].ctl =
  1132. + LTQ_DMA_OWN | LTQ_DMA_RX_OFFSET(NET_IP_ALIGN) |
  1133. + XRX200_DMA_DATA_LEN;
  1134. + skb_reserve(ch->skb[ch->dma.desc], NET_IP_ALIGN);
  1135. +
  1136. + return 0;
  1137. +}
  1138. +
  1139. +static void xrx200_hw_receive(struct xrx200_chan *ch, int id)
  1140. +{
  1141. + struct net_device *dev = ch->devs[id];
  1142. + struct xrx200_priv *priv = netdev_priv(dev);
  1143. + struct ltq_dma_desc *desc = &ch->dma.desc_base[ch->dma.desc];
  1144. + struct sk_buff *skb = ch->skb[ch->dma.desc];
  1145. + int len = (desc->ctl & LTQ_DMA_SIZE_MASK);
  1146. + unsigned long flags;
  1147. +
  1148. + spin_lock_irqsave(&priv->hw->lock, flags);
  1149. + if (xrx200_alloc_skb(ch)) {
  1150. + netdev_err(dev,
  1151. + "failed to allocate new rx buffer, stopping DMA\n");
  1152. + ltq_dma_close(&ch->dma);
  1153. + }
  1154. +
  1155. + ch->dma.desc++;
  1156. + ch->dma.desc %= LTQ_DESC_NUM;
  1157. + spin_unlock_irqrestore(&priv->hw->lock, flags);
  1158. +
  1159. + skb_put(skb, len);
  1160. +#ifdef SW_ROUTING
  1161. + skb_pull(skb, 8);
  1162. +#endif
  1163. + skb->dev = dev;
  1164. + skb->protocol = eth_type_trans(skb, dev);
  1165. + netif_receive_skb(skb);
  1166. + priv->stats.rx_packets++;
  1167. + priv->stats.rx_bytes+=len;
  1168. +}
  1169. +
  1170. +static int xrx200_poll_rx(struct napi_struct *napi, int budget)
  1171. +{
  1172. + struct xrx200_chan *ch = container_of(napi,
  1173. + struct xrx200_chan, napi);
  1174. + struct xrx200_priv *priv = netdev_priv(ch->devs[0]);
  1175. + int rx = 0;
  1176. + int complete = 0;
  1177. + unsigned long flags;
  1178. +
  1179. + while ((rx < budget) && !complete) {
  1180. + struct ltq_dma_desc *desc = &ch->dma.desc_base[ch->dma.desc];
  1181. + if ((desc->ctl & (LTQ_DMA_OWN | LTQ_DMA_C)) == LTQ_DMA_C) {
  1182. +#ifdef SW_ROUTING
  1183. + struct sk_buff *skb = ch->skb[ch->dma.desc];
  1184. + u32 *special_tag = (u32*)skb->data;
  1185. + int port = (special_tag[1] >> SPPID_SHIFT) & SPPID_MASK;
  1186. + xrx200_hw_receive(ch, priv->hw->port_map[port]);
  1187. +#else
  1188. + xrx200_hw_receive(ch, 0);
  1189. +#endif
  1190. + rx++;
  1191. + } else {
  1192. + complete = 1;
  1193. + }
  1194. + }
  1195. + if (complete || !rx) {
  1196. + napi_complete(&ch->napi);
  1197. + spin_lock_irqsave(&priv->hw->lock, flags);
  1198. + ltq_dma_ack_irq(&ch->dma);
  1199. + spin_unlock_irqrestore(&priv->hw->lock, flags);
  1200. + }
  1201. + return rx;
  1202. +}
  1203. +
  1204. +static void xrx200_tx_housekeeping(unsigned long ptr)
  1205. +{
  1206. + struct xrx200_hw *hw = (struct xrx200_hw *) ptr;
  1207. + struct xrx200_chan *ch = &hw->chan[XRX200_DMA_TX];
  1208. + unsigned long flags;
  1209. + int i;
  1210. +
  1211. + spin_lock_irqsave(&hw->lock, flags);
  1212. + while ((ch->dma.desc_base[ch->tx_free].ctl & (LTQ_DMA_OWN | LTQ_DMA_C)) == LTQ_DMA_C) {
  1213. + dev_kfree_skb_any(ch->skb[ch->tx_free]);
  1214. + ch->skb[ch->tx_free] = NULL;
  1215. + memset(&ch->dma.desc_base[ch->tx_free], 0,
  1216. + sizeof(struct ltq_dma_desc));
  1217. + ch->tx_free++;
  1218. + ch->tx_free %= LTQ_DESC_NUM;
  1219. + }
  1220. + spin_unlock_irqrestore(&hw->lock, flags);
  1221. +
  1222. + for (i = 0; i < XRX200_MAX_DEV && ch->devs[i]; i++) {
  1223. + struct netdev_queue *txq =
  1224. + netdev_get_tx_queue(ch->devs[i], 0);
  1225. + if (netif_tx_queue_stopped(txq))
  1226. + netif_tx_start_queue(txq);
  1227. + }
  1228. +
  1229. + spin_lock_irqsave(&hw->lock, flags);
  1230. + ltq_dma_ack_irq(&ch->dma);
  1231. + spin_unlock_irqrestore(&hw->lock, flags);
  1232. +}
  1233. +
  1234. +static struct net_device_stats *xrx200_get_stats (struct net_device *dev)
  1235. +{
  1236. + struct xrx200_priv *priv = netdev_priv(dev);
  1237. +
  1238. + return &priv->stats;
  1239. +}
  1240. +
  1241. +static void xrx200_tx_timeout(struct net_device *dev)
  1242. +{
  1243. + struct xrx200_priv *priv = netdev_priv(dev);
  1244. +
  1245. + printk(KERN_ERR "%s: transmit timed out, disable the dma channel irq\n", dev->name);
  1246. +
  1247. + priv->stats.tx_errors++;
  1248. + netif_wake_queue(dev);
  1249. +}
  1250. +
  1251. +static int xrx200_start_xmit(struct sk_buff *skb, struct net_device *dev)
  1252. +{
  1253. + int queue = skb_get_queue_mapping(skb);
  1254. + struct netdev_queue *txq = netdev_get_tx_queue(dev, queue);
  1255. + struct xrx200_priv *priv = netdev_priv(dev);
  1256. + struct xrx200_chan *ch = &priv->hw->chan[XRX200_DMA_TX];
  1257. + struct ltq_dma_desc *desc = &ch->dma.desc_base[ch->dma.desc];
  1258. + unsigned long flags;
  1259. + u32 byte_offset;
  1260. + int len;
  1261. +#ifdef SW_ROUTING
  1262. + #ifdef SW_PORTMAP
  1263. + u32 special_tag = (SPID_CPU_PORT << SPID_SHIFT) | PORT_MAP_SEL | PORT_MAP_EN | DPID_ENABLE;
  1264. + #else
  1265. + u32 special_tag = (SPID_CPU_PORT << SPID_SHIFT) | DPID_ENABLE;
  1266. + #endif
  1267. +#endif
  1268. +
  1269. + len = skb->len < ETH_ZLEN ? ETH_ZLEN : skb->len;
  1270. +
  1271. + if ((desc->ctl & (LTQ_DMA_OWN | LTQ_DMA_C)) || ch->skb[ch->dma.desc]) {
  1272. + netdev_err(dev, "tx ring full\n");
  1273. + netif_tx_stop_queue(txq);
  1274. + return NETDEV_TX_BUSY;
  1275. + }
  1276. +#ifdef SW_ROUTING
  1277. + #ifdef SW_PORTMAP
  1278. + special_tag |= priv->port_map << PORT_MAP_SHIFT;
  1279. + #else
  1280. + if(priv->id)
  1281. + special_tag |= (1 << DPID_SHIFT);
  1282. + #endif
  1283. + if(skb_headroom(skb) < 4) {
  1284. + struct sk_buff *tmp = skb_realloc_headroom(skb, 4);
  1285. + dev_kfree_skb_any(skb);
  1286. + skb = tmp;
  1287. + }
  1288. + skb_push(skb, 4);
  1289. + memcpy(skb->data, &special_tag, sizeof(u32));
  1290. + len += 4;
  1291. +#endif
  1292. +
  1293. + /* dma needs to start on a 16 byte aligned address */
  1294. + byte_offset = CPHYSADDR(skb->data) % 16;
  1295. + ch->skb[ch->dma.desc] = skb;
  1296. +
  1297. + dev->trans_start = jiffies;
  1298. +
  1299. + spin_lock_irqsave(&priv->hw->lock, flags);
  1300. + desc->addr = ((unsigned int) dma_map_single(NULL, skb->data, len,
  1301. + DMA_TO_DEVICE)) - byte_offset;
  1302. + wmb();
  1303. + desc->ctl = LTQ_DMA_OWN | LTQ_DMA_SOP | LTQ_DMA_EOP |
  1304. + LTQ_DMA_TX_OFFSET(byte_offset) | (len & LTQ_DMA_SIZE_MASK);
  1305. + ch->dma.desc++;
  1306. + ch->dma.desc %= LTQ_DESC_NUM;
  1307. + spin_unlock_irqrestore(&priv->hw->lock, flags);
  1308. +
  1309. + if (ch->dma.desc_base[ch->dma.desc].ctl & LTQ_DMA_OWN)
  1310. + netif_tx_stop_queue(txq);
  1311. +
  1312. + priv->stats.tx_packets++;
  1313. + priv->stats.tx_bytes+=len;
  1314. +
  1315. + return NETDEV_TX_OK;
  1316. +}
  1317. +
  1318. +static irqreturn_t xrx200_dma_irq(int irq, void *priv)
  1319. +{
  1320. + struct xrx200_hw *hw = priv;
  1321. + int ch = irq - XRX200_DMA_IRQ;
  1322. +
  1323. + if (ch % 2)
  1324. + tasklet_schedule(&hw->chan[ch].tasklet);
  1325. + else
  1326. + napi_schedule(&hw->chan[ch].napi);
  1327. +
  1328. + return IRQ_HANDLED;
  1329. +}
  1330. +
  1331. +static int xrx200_dma_init(struct xrx200_hw *hw)
  1332. +{
  1333. + int i, err = 0;
  1334. +
  1335. + ltq_dma_init_port(DMA_PORT_ETOP);
  1336. +
  1337. + for (i = 0; i < 8 && !err; i++) {
  1338. + int irq = XRX200_DMA_IRQ + i;
  1339. + struct xrx200_chan *ch = &hw->chan[i];
  1340. +
  1341. + ch->idx = ch->dma.nr = i;
  1342. +
  1343. + if (i == XRX200_DMA_TX) {
  1344. + ltq_dma_alloc_tx(&ch->dma);
  1345. + err = request_irq(irq, xrx200_dma_irq, 0, "vrx200_tx", hw);
  1346. + } else if (i == XRX200_DMA_RX) {
  1347. + ltq_dma_alloc_rx(&ch->dma);
  1348. + for (ch->dma.desc = 0; ch->dma.desc < LTQ_DESC_NUM;
  1349. + ch->dma.desc++)
  1350. + if (xrx200_alloc_skb(ch))
  1351. + err = -ENOMEM;
  1352. + ch->dma.desc = 0;
  1353. + err = request_irq(irq, xrx200_dma_irq, 0, "vrx200_rx", hw);
  1354. + } else
  1355. + continue;
  1356. +
  1357. + if (!err)
  1358. + ch->dma.irq = irq;
  1359. + }
  1360. +
  1361. + return err;
  1362. +}
  1363. +
  1364. +#ifdef SW_POLLING
  1365. +static void xrx200_gmac_update(struct xrx200_port *port)
  1366. +{
  1367. + u16 phyaddr = port->phydev->addr & MDIO_PHY_ADDR_MASK;
  1368. + u16 miimode = ltq_mii_r32(MII_CFG(port->num)) & MII_CFG_MODE_MASK;
  1369. + u16 miirate = 0;
  1370. +
  1371. + switch (port->phydev->speed) {
  1372. + case SPEED_1000:
  1373. + phyaddr |= MDIO_PHY_SPEED_G1;
  1374. + miirate = MII_CFG_RATE_M125;
  1375. + break;
  1376. +
  1377. + case SPEED_100:
  1378. + phyaddr |= MDIO_PHY_SPEED_M100;
  1379. + switch (miimode) {
  1380. + case MII_CFG_MODE_RMIIM:
  1381. + case MII_CFG_MODE_RMIIP:
  1382. + miirate = MII_CFG_RATE_M50;
  1383. + break;
  1384. + default:
  1385. + miirate = MII_CFG_RATE_M25;
  1386. + break;
  1387. + }
  1388. + break;
  1389. +
  1390. + default:
  1391. + phyaddr |= MDIO_PHY_SPEED_M10;
  1392. + miirate = MII_CFG_RATE_M2P5;
  1393. + break;
  1394. + }
  1395. +
  1396. + if (port->phydev->link)
  1397. + phyaddr |= MDIO_PHY_LINK_UP;
  1398. + else
  1399. + phyaddr |= MDIO_PHY_LINK_DOWN;
  1400. +
  1401. + if (port->phydev->duplex == DUPLEX_FULL)
  1402. + phyaddr |= MDIO_PHY_FDUP_EN;
  1403. + else
  1404. + phyaddr |= MDIO_PHY_FDUP_DIS;
  1405. +
  1406. + ltq_mdio_w32_mask(MDIO_UPDATE_MASK, phyaddr, MDIO_PHY(port->num));
  1407. + ltq_mii_w32_mask(MII_CFG_RATE_MASK, miirate, MII_CFG(port->num));
  1408. + udelay(1);
  1409. +}
  1410. +#else
  1411. +static void xrx200_gmac_update(struct xrx200_port *port)
  1412. +{
  1413. +
  1414. +}
  1415. +#endif
  1416. +
  1417. +static void xrx200_mdio_link(struct net_device *dev)
  1418. +{
  1419. + struct xrx200_priv *priv = netdev_priv(dev);
  1420. + int i;
  1421. +
  1422. + for (i = 0; i < priv->num_port; i++) {
  1423. + if (!priv->port[i].phydev)
  1424. + continue;
  1425. +
  1426. + if (priv->port[i].link != priv->port[i].phydev->link) {
  1427. + xrx200_gmac_update(&priv->port[i]);
  1428. + priv->port[i].link = priv->port[i].phydev->link;
  1429. + netdev_info(dev, "port %d %s link\n",
  1430. + priv->port[i].num,
  1431. + (priv->port[i].link)?("got"):("lost"));
  1432. + }
  1433. + }
  1434. +}
  1435. +
  1436. +static inline int xrx200_mdio_poll(struct mii_bus *bus)
  1437. +{
  1438. + unsigned cnt = 10000;
  1439. +
  1440. + while (likely(cnt--)) {
  1441. + unsigned ctrl = ltq_mdio_r32(MDIO_CTRL);
  1442. + if ((ctrl & MDIO_BUSY) == 0)
  1443. + return 0;
  1444. + }
  1445. +
  1446. + return 1;
  1447. +}
  1448. +
  1449. +static int xrx200_mdio_wr(struct mii_bus *bus, int addr, int reg, u16 val)
  1450. +{
  1451. + if (xrx200_mdio_poll(bus))
  1452. + return 1;
  1453. +
  1454. + ltq_mdio_w32(val, MDIO_WRITE);
  1455. + ltq_mdio_w32(MDIO_BUSY | MDIO_WR |
  1456. + ((addr & MDIO_MASK) << MDIO_ADDRSHIFT) |
  1457. + (reg & MDIO_MASK),
  1458. + MDIO_CTRL);
  1459. +
  1460. + return 0;
  1461. +}
  1462. +
  1463. +static int xrx200_mdio_rd(struct mii_bus *bus, int addr, int reg)
  1464. +{
  1465. + if (xrx200_mdio_poll(bus))
  1466. + return -1;
  1467. +
  1468. + ltq_mdio_w32(MDIO_BUSY | MDIO_RD |
  1469. + ((addr & MDIO_MASK) << MDIO_ADDRSHIFT) |
  1470. + (reg & MDIO_MASK),
  1471. + MDIO_CTRL);
  1472. +
  1473. + if (xrx200_mdio_poll(bus))
  1474. + return -1;
  1475. +
  1476. + return ltq_mdio_r32(MDIO_READ);
  1477. +}
  1478. +
  1479. +static int xrx200_mdio_probe(struct net_device *dev, struct xrx200_port *port)
  1480. +{
  1481. + struct xrx200_priv *priv = netdev_priv(dev);
  1482. + struct phy_device *phydev = NULL;
  1483. + unsigned val;
  1484. +
  1485. + phydev = priv->hw->mii_bus->phy_map[port->phy_addr];
  1486. +
  1487. + if (!phydev) {
  1488. + netdev_err(dev, "no PHY found\n");
  1489. + return -ENODEV;
  1490. + }
  1491. +
  1492. + phydev = phy_connect(dev, dev_name(&phydev->dev), &xrx200_mdio_link,
  1493. + port->phy_if);
  1494. +
  1495. + if (IS_ERR(phydev)) {
  1496. + netdev_err(dev, "Could not attach to PHY\n");
  1497. + return PTR_ERR(phydev);
  1498. + }
  1499. +
  1500. + phydev->supported &= (SUPPORTED_10baseT_Half
  1501. + | SUPPORTED_10baseT_Full
  1502. + | SUPPORTED_100baseT_Half
  1503. + | SUPPORTED_100baseT_Full
  1504. + | SUPPORTED_1000baseT_Half
  1505. + | SUPPORTED_1000baseT_Full
  1506. + | SUPPORTED_Autoneg
  1507. + | SUPPORTED_MII
  1508. + | SUPPORTED_TP);
  1509. + phydev->advertising = phydev->supported;
  1510. + port->phydev = phydev;
  1511. +
  1512. + pr_info("%s: attached PHY [%s] (phy_addr=%s, irq=%d)\n",
  1513. + dev->name, phydev->drv->name,
  1514. + dev_name(&phydev->dev), phydev->irq);
  1515. +
  1516. +#ifdef SW_POLLING
  1517. + phy_read_status(phydev);
  1518. +
  1519. + val = xrx200_mdio_rd(priv->hw->mii_bus, MDIO_DEVAD_NONE, MII_CTRL1000);
  1520. + val |= ADVERTIZE_MPD;
  1521. + xrx200_mdio_wr(priv->hw->mii_bus, MDIO_DEVAD_NONE, MII_CTRL1000, val);
  1522. + xrx200_mdio_wr(priv->hw->mii_bus, 0, 0, 0x1040);
  1523. +
  1524. + phy_start_aneg(phydev);
  1525. +#endif
  1526. + return 0;
  1527. +}
  1528. +
  1529. +static void xrx200_port_config(struct xrx200_priv *priv,
  1530. + const struct xrx200_port *port)
  1531. +{
  1532. + u16 miimode = 0;
  1533. +
  1534. + switch (port->num) {
  1535. + case 0: /* xMII0 */
  1536. + case 1: /* xMII1 */
  1537. + switch (port->phy_if) {
  1538. + case PHY_INTERFACE_MODE_MII:
  1539. + if (port->flags & XRX200_PORT_TYPE_PHY)
  1540. + /* MII MAC mode, connected to external PHY */
  1541. + miimode = MII_CFG_MODE_MIIM;
  1542. + else
  1543. + /* MII PHY mode, connected to external MAC */
  1544. + miimode = MII_CFG_MODE_MIIP;
  1545. + break;
  1546. + case PHY_INTERFACE_MODE_RMII:
  1547. + if (port->flags & XRX200_PORT_TYPE_PHY)
  1548. + /* RMII MAC mode, connected to external PHY */
  1549. + miimode = MII_CFG_MODE_RMIIM;
  1550. + else
  1551. + /* RMII PHY mode, connected to external MAC */
  1552. + miimode = MII_CFG_MODE_RMIIP;
  1553. + break;
  1554. + case PHY_INTERFACE_MODE_RGMII:
  1555. + /* RGMII MAC mode, connected to external PHY */
  1556. + miimode = MII_CFG_MODE_RGMII;
  1557. + break;
  1558. + default:
  1559. + break;
  1560. + }
  1561. + break;
  1562. + case 2: /* internal GPHY0 */
  1563. + case 3: /* internal GPHY0 */
  1564. + case 4: /* internal GPHY1 */
  1565. + switch (port->phy_if) {
  1566. + case PHY_INTERFACE_MODE_MII:
  1567. + case PHY_INTERFACE_MODE_GMII:
  1568. + /* MII MAC mode, connected to internal GPHY */
  1569. + miimode = MII_CFG_MODE_MIIM;
  1570. + break;
  1571. + default:
  1572. + break;
  1573. + }
  1574. + break;
  1575. + case 5: /* internal GPHY1 or xMII2 */
  1576. + switch (port->phy_if) {
  1577. + case PHY_INTERFACE_MODE_MII:
  1578. + /* MII MAC mode, connected to internal GPHY */
  1579. + miimode = MII_CFG_MODE_MIIM;
  1580. + break;
  1581. + case PHY_INTERFACE_MODE_RGMII:
  1582. + /* RGMII MAC mode, connected to external PHY */
  1583. + miimode = MII_CFG_MODE_RGMII;
  1584. + break;
  1585. + default:
  1586. + break;
  1587. + }
  1588. + break;
  1589. + default:
  1590. + break;
  1591. + }
  1592. +
  1593. + ltq_mii_w32_mask(MII_CFG_MODE_MASK, miimode | MII_CFG_EN,
  1594. + MII_CFG(port->num));
  1595. +}
  1596. +
  1597. +static int xrx200_init(struct net_device *dev)
  1598. +{
  1599. + struct xrx200_priv *priv = netdev_priv(dev);
  1600. + struct sockaddr mac;
  1601. + int err, i;
  1602. +
  1603. +#ifndef SW_POLLING
  1604. + unsigned int reg = 0;
  1605. +
  1606. + /* enable auto polling */
  1607. + for (i = 0; i < priv->num_port; i++)
  1608. + reg |= BIT(priv->port[i].num);
  1609. + ltq_mdio_w32(reg, MDIO_CLK_CFG0);
  1610. + ltq_mdio_w32(MDIO1_25MHZ, MDIO_CLK_CFG1);
  1611. +#endif
  1612. +
  1613. + /* setup each port */
  1614. + for (i = 0; i < priv->num_port; i++)
  1615. + xrx200_port_config(priv, &priv->port[i]);
  1616. +
  1617. + memcpy(&mac.sa_data, priv->mac, ETH_ALEN);
  1618. + if (!is_valid_ether_addr(mac.sa_data)) {
  1619. + pr_warn("net-xrx200: invalid MAC, using random\n");
  1620. + eth_random_addr(mac.sa_data);
  1621. + dev->addr_assign_type |= NET_ADDR_RANDOM;
  1622. + }
  1623. +
  1624. + err = eth_mac_addr(dev, &mac);
  1625. + if (err)
  1626. + goto err_netdev;
  1627. +
  1628. + for (i = 0; i < priv->num_port; i++)
  1629. + if (xrx200_mdio_probe(dev, &priv->port[i]))
  1630. + pr_warn("xrx200-mdio: probing phy of port %d failed\n",
  1631. + priv->port[i].num);
  1632. +
  1633. + return 0;
  1634. +
  1635. +err_netdev:
  1636. + unregister_netdev(dev);
  1637. + free_netdev(dev);
  1638. + return err;
  1639. +}
  1640. +
  1641. +static void xrx200_pci_microcode(void)
  1642. +{
  1643. + int i;
  1644. +
  1645. + ltq_switch_w32_mask(PCE_TBL_CFG_ADDR_MASK | PCE_TBL_CFG_ADWR_MASK,
  1646. + PCE_TBL_CFG_ADWR, PCE_TBL_CTRL);
  1647. + ltq_switch_w32(0, PCE_TBL_MASK);
  1648. +
  1649. + for (i = 0; i < ARRAY_SIZE(pce_microcode); i++) {
  1650. + ltq_switch_w32(i, PCE_TBL_ADDR);
  1651. + ltq_switch_w32(pce_microcode[i].val[3], PCE_TBL_VAL(0));
  1652. + ltq_switch_w32(pce_microcode[i].val[2], PCE_TBL_VAL(1));
  1653. + ltq_switch_w32(pce_microcode[i].val[1], PCE_TBL_VAL(2));
  1654. + ltq_switch_w32(pce_microcode[i].val[0], PCE_TBL_VAL(3));
  1655. +
  1656. + // start the table access:
  1657. + ltq_switch_w32_mask(0, PCE_TBL_BUSY, PCE_TBL_CTRL);
  1658. + while (ltq_switch_r32(PCE_TBL_CTRL) & PCE_TBL_BUSY);
  1659. + }
  1660. +
  1661. + /* tell the switch that the microcode is loaded */
  1662. + ltq_switch_w32_mask(0, BIT(3), PCE_GCTRL_REG(0));
  1663. +}
  1664. +
  1665. +static void xrx200_hw_init(struct xrx200_hw *hw)
  1666. +{
  1667. + int i;
  1668. +
  1669. + /* enable clock gate */
  1670. + clk_enable(hw->clk);
  1671. +
  1672. + ltq_switch_w32(1, 0);
  1673. + mdelay(100);
  1674. + ltq_switch_w32(0, 0);
  1675. + /*
  1676. + * TODO: we should really disbale all phys/miis here and explicitly
  1677. + * enable them in the device secific init function
  1678. + */
  1679. +
  1680. + /* disable port fetch/store dma */
  1681. + for (i = 0; i < 7; i++ ) {
  1682. + ltq_switch_w32(0, FDMA_PCTRLx(i));
  1683. + ltq_switch_w32(0, SDMA_PCTRLx(i));
  1684. + }
  1685. +
  1686. + /* enable Switch */
  1687. + ltq_mdio_w32_mask(0, MDIO_GLOB_ENABLE, MDIO_GLOB);
  1688. +
  1689. + /* load the pce microcode */
  1690. + xrx200_pci_microcode();
  1691. +
  1692. + /* Default unknown Broadcat/Multicast/Unicast port maps */
  1693. + ltq_switch_w32(0x7f, PCE_PMAP1);
  1694. + ltq_switch_w32(0x7f, PCE_PMAP2);
  1695. + ltq_switch_w32(0x7f, PCE_PMAP3);
  1696. +
  1697. + /* RMON Counter Enable for all physical ports */
  1698. + for (i = 0; i < 7; i++)
  1699. + ltq_switch_w32(0x1, BM_PCFG(i));
  1700. +
  1701. + /* disable auto polling */
  1702. + ltq_mdio_w32(0x0, MDIO_CLK_CFG0);
  1703. +
  1704. + /* enable port statistic counters */
  1705. + for (i = 0; i < 7; i++)
  1706. + ltq_switch_w32(0x1, BM_PCFGx(i));
  1707. +
  1708. + /* set IPG to 12 */
  1709. + ltq_pmac_w32_mask(PMAC_IPG_MASK, 0xb, PMAC_RX_IPG);
  1710. +
  1711. +#ifdef SW_ROUTING
  1712. + /* enable status header, enable CRC */
  1713. + ltq_pmac_w32_mask(0,
  1714. + PMAC_HD_CTL_RST | PMAC_HD_CTL_AST | PMAC_HD_CTL_RXSH | PMAC_HD_CTL_AS | PMAC_HD_CTL_AC,
  1715. + PMAC_HD_CTL);
  1716. +#else
  1717. + /* disable status header, enable CRC */
  1718. + ltq_pmac_w32_mask(PMAC_HD_CTL_AST | PMAC_HD_CTL_RXSH | PMAC_HD_CTL_AS,
  1719. + PMAC_HD_CTL_AC,
  1720. + PMAC_HD_CTL);
  1721. +#endif
  1722. +
  1723. + /* enable port fetch/store dma & VLAN Modification */
  1724. + for (i = 0; i < 7; i++ ) {
  1725. + ltq_switch_w32_mask(0, 0x19, FDMA_PCTRLx(i));
  1726. + ltq_switch_w32_mask(0, 0x01, SDMA_PCTRLx(i));
  1727. + ltq_switch_w32_mask(0, PCE_INGRESS, PCE_PCTRL_REG(i, 0));
  1728. + }
  1729. +
  1730. + /* enable special tag insertion on cpu port */
  1731. + ltq_switch_w32_mask(0, 0x02, FDMA_PCTRLx(6));
  1732. + ltq_switch_w32_mask(0, PCE_INGRESS, PCE_PCTRL_REG(6, 0));
  1733. + ltq_switch_w32_mask(0, BIT(3), MAC_CTRL_REG(6, 2));
  1734. + ltq_switch_w32(1518 + 8 + 4 * 2, MAC_FLEN_REG);
  1735. +}
  1736. +
  1737. +static void xrx200_hw_cleanup(struct xrx200_hw *hw)
  1738. +{
  1739. + int i;
  1740. +
  1741. + /* disable the switch */
  1742. + ltq_mdio_w32_mask(MDIO_GLOB_ENABLE, 0, MDIO_GLOB);
  1743. +
  1744. + /* free the channels and IRQs */
  1745. + for (i = 0; i < 2; i++) {
  1746. + ltq_dma_free(&hw->chan[i].dma);
  1747. + if (hw->chan[i].dma.irq)
  1748. + free_irq(hw->chan[i].dma.irq, hw);
  1749. + }
  1750. +
  1751. + /* free the allocated RX ring */
  1752. + for (i = 0; i < LTQ_DESC_NUM; i++)
  1753. + dev_kfree_skb_any(hw->chan[XRX200_DMA_RX].skb[i]);
  1754. +
  1755. + /* clear the mdio bus */
  1756. + mdiobus_unregister(hw->mii_bus);
  1757. + mdiobus_free(hw->mii_bus);
  1758. +
  1759. + /* release the clock */
  1760. + clk_disable(hw->clk);
  1761. + clk_put(hw->clk);
  1762. +}
  1763. +
  1764. +static int xrx200_of_mdio(struct xrx200_hw *hw, struct device_node *np)
  1765. +{
  1766. + hw->mii_bus = mdiobus_alloc();
  1767. + if (!hw->mii_bus)
  1768. + return -ENOMEM;
  1769. +
  1770. + hw->mii_bus->read = xrx200_mdio_rd;
  1771. + hw->mii_bus->write = xrx200_mdio_wr;
  1772. + hw->mii_bus->name = "lantiq,xrx200-mdio";
  1773. + snprintf(hw->mii_bus->id, MII_BUS_ID_SIZE, "%x", 0);
  1774. +
  1775. + if (of_mdiobus_register(hw->mii_bus, np)) {
  1776. + mdiobus_free(hw->mii_bus);
  1777. + return -ENXIO;
  1778. + }
  1779. +
  1780. + return 0;
  1781. +}
  1782. +
  1783. +static void xrx200_of_port(struct xrx200_priv *priv, struct device_node *port)
  1784. +{
  1785. + const __be32 *addr, *id = of_get_property(port, "reg", NULL);
  1786. + struct xrx200_port *p = &priv->port[priv->num_port];
  1787. +
  1788. + if (!id)
  1789. + return;
  1790. +
  1791. + memset(p, 0, sizeof(struct xrx200_port));
  1792. + p->phy_node = of_parse_phandle(port, "phy-handle", 0);
  1793. + addr = of_get_property(p->phy_node, "reg", NULL);
  1794. + if (!addr)
  1795. + return;
  1796. +
  1797. + p->num = *id;
  1798. + p->phy_addr = *addr;
  1799. + p->phy_if = of_get_phy_mode(port);
  1800. + if (p->phy_addr > 0x10)
  1801. + p->flags = XRX200_PORT_TYPE_MAC;
  1802. + else
  1803. + p->flags = XRX200_PORT_TYPE_PHY;
  1804. + priv->num_port++;
  1805. +
  1806. + p->gpio = of_get_gpio_flags(port, 0, &p->gpio_flags);
  1807. + if (gpio_is_valid(p->gpio))
  1808. + if (!gpio_request(p->gpio, "phy-reset")) {
  1809. + gpio_direction_output(p->gpio,
  1810. + (p->gpio_flags & OF_GPIO_ACTIVE_LOW) ? (1) : (0));
  1811. + udelay(100);
  1812. + gpio_set_value(p->gpio, (p->gpio_flags & OF_GPIO_ACTIVE_LOW) ? (0) : (1));
  1813. + }
  1814. + /* is this port a wan port ? */
  1815. + if (priv->wan)
  1816. + priv->hw->wan_map |= BIT(p->num);
  1817. +
  1818. + priv->port_map |= BIT(p->num);
  1819. +
  1820. + /* store the port id in the hw struct so we can map ports -> devices */
  1821. + priv->hw->port_map[p->num] = priv->hw->num_devs;
  1822. +}
  1823. +
  1824. +static const struct net_device_ops xrx200_netdev_ops = {
  1825. + .ndo_init = xrx200_init,
  1826. + .ndo_open = xrx200_open,
  1827. + .ndo_stop = xrx200_close,
  1828. + .ndo_start_xmit = xrx200_start_xmit,
  1829. + .ndo_set_mac_address = eth_mac_addr,
  1830. + .ndo_validate_addr = eth_validate_addr,
  1831. + .ndo_change_mtu = eth_change_mtu,
  1832. + .ndo_get_stats = xrx200_get_stats,
  1833. + .ndo_tx_timeout = xrx200_tx_timeout,
  1834. +};
  1835. +
  1836. +static void xrx200_of_iface(struct xrx200_hw *hw, struct device_node *iface)
  1837. +{
  1838. + struct xrx200_priv *priv;
  1839. + struct device_node *port;
  1840. + const __be32 *wan;
  1841. +
  1842. + /* alloc the network device */
  1843. + hw->devs[hw->num_devs] = alloc_etherdev(sizeof(struct xrx200_priv));
  1844. + if (!hw->devs[hw->num_devs])
  1845. + return;
  1846. +
  1847. + /* setup the network device */
  1848. + strcpy(hw->devs[hw->num_devs]->name, "eth%d");
  1849. + hw->devs[hw->num_devs]->netdev_ops = &xrx200_netdev_ops;
  1850. + hw->devs[hw->num_devs]->watchdog_timeo = XRX200_TX_TIMEOUT;
  1851. + hw->devs[hw->num_devs]->needed_headroom = XRX200_HEADROOM;
  1852. +
  1853. + /* setup our private data */
  1854. + priv = netdev_priv(hw->devs[hw->num_devs]);
  1855. + priv->hw = hw;
  1856. + of_get_mac_address_mtd(iface, priv->mac);
  1857. + priv->id = hw->num_devs;
  1858. +
  1859. + /* is this the wan interface ? */
  1860. + wan = of_get_property(iface, "lantiq,wan", NULL);
  1861. + if (wan && (*wan == 1))
  1862. + priv->wan = 1;
  1863. +
  1864. + /* should the switch be enabled on this interface ? */
  1865. + if (of_find_property(iface, "lantiq,switch", NULL))
  1866. + priv->sw = 1;
  1867. +
  1868. + /* load the ports that are part of the interface */
  1869. + for_each_child_of_node(iface, port)
  1870. + if (of_device_is_compatible(port, "lantiq,xrx200-pdi-port"))
  1871. + xrx200_of_port(priv, port);
  1872. +
  1873. + /* register the actual device */
  1874. + if (!register_netdev(hw->devs[hw->num_devs]))
  1875. + hw->num_devs++;
  1876. +}
  1877. +
  1878. +static struct xrx200_hw xrx200_hw;
  1879. +
  1880. +static int xrx200_probe(struct platform_device *pdev)
  1881. +{
  1882. + struct resource *res[4];
  1883. + struct device_node *mdio_np, *iface_np;
  1884. + int i;
  1885. +
  1886. + /* load the memory ranges */
  1887. + for (i = 0; i < 4; i++) {
  1888. + res[i] = platform_get_resource(pdev, IORESOURCE_MEM, i);
  1889. + if (!res[i]) {
  1890. + dev_err(&pdev->dev, "failed to get resources\n");
  1891. + return -ENOENT;
  1892. + }
  1893. + }
  1894. + xrx200_switch_membase = devm_ioremap_resource(&pdev->dev, res[0]);
  1895. + xrx200_mdio_membase = devm_ioremap_resource(&pdev->dev, res[1]);
  1896. + xrx200_mii_membase = devm_ioremap_resource(&pdev->dev, res[2]);
  1897. + xrx200_pmac_membase = devm_ioremap_resource(&pdev->dev, res[3]);
  1898. + if (!xrx200_switch_membase || !xrx200_mdio_membase ||
  1899. + !xrx200_mii_membase || !xrx200_pmac_membase) {
  1900. + dev_err(&pdev->dev, "failed to request and remap io ranges \n");
  1901. + return -ENOMEM;
  1902. + }
  1903. +
  1904. + /* get the clock */
  1905. + xrx200_hw.clk = clk_get(&pdev->dev, NULL);
  1906. + if (IS_ERR(xrx200_hw.clk)) {
  1907. + dev_err(&pdev->dev, "failed to get clock\n");
  1908. + return PTR_ERR(xrx200_hw.clk);
  1909. + }
  1910. +
  1911. + /* bring up the dma engine and IP core */
  1912. + spin_lock_init(&xrx200_hw.lock);
  1913. + xrx200_dma_init(&xrx200_hw);
  1914. + xrx200_hw_init(&xrx200_hw);
  1915. + tasklet_init(&xrx200_hw.chan[XRX200_DMA_TX].tasklet, xrx200_tx_housekeeping, (u32) &xrx200_hw);
  1916. +
  1917. + /* bring up the mdio bus */
  1918. + mdio_np = of_find_compatible_node(pdev->dev.of_node, NULL,
  1919. + "lantiq,xrx200-mdio");
  1920. + if (mdio_np)
  1921. + if (xrx200_of_mdio(&xrx200_hw, mdio_np))
  1922. + dev_err(&pdev->dev, "mdio probe failed\n");
  1923. +
  1924. + /* load the interfaces */
  1925. + for_each_child_of_node(pdev->dev.of_node, iface_np)
  1926. + if (of_device_is_compatible(iface_np, "lantiq,xrx200-pdi")) {
  1927. + if (xrx200_hw.num_devs < XRX200_MAX_DEV)
  1928. + xrx200_of_iface(&xrx200_hw, iface_np);
  1929. + else
  1930. + dev_err(&pdev->dev,
  1931. + "only %d interfaces allowed\n",
  1932. + XRX200_MAX_DEV);
  1933. + }
  1934. +
  1935. + if (!xrx200_hw.num_devs) {
  1936. + xrx200_hw_cleanup(&xrx200_hw);
  1937. + dev_err(&pdev->dev, "failed to load interfaces\n");
  1938. + return -ENOENT;
  1939. + }
  1940. +
  1941. + xrx200sw_init(&xrx200_hw);
  1942. +
  1943. + /* set wan port mask */
  1944. + ltq_pmac_w32(xrx200_hw.wan_map, PMAC_EWAN);
  1945. +
  1946. + for (i = 0; i < xrx200_hw.num_devs; i++) {
  1947. + xrx200_hw.chan[XRX200_DMA_RX].devs[i] = xrx200_hw.devs[i];
  1948. + xrx200_hw.chan[XRX200_DMA_TX].devs[i] = xrx200_hw.devs[i];
  1949. + }
  1950. +
  1951. + /* setup NAPI */
  1952. + init_dummy_netdev(&xrx200_hw.chan[XRX200_DMA_RX].dummy_dev);
  1953. + netif_napi_add(&xrx200_hw.chan[XRX200_DMA_RX].dummy_dev,
  1954. + &xrx200_hw.chan[XRX200_DMA_RX].napi, xrx200_poll_rx, 32);
  1955. +
  1956. + platform_set_drvdata(pdev, &xrx200_hw);
  1957. +
  1958. + return 0;
  1959. +}
  1960. +
  1961. +static int xrx200_remove(struct platform_device *pdev)
  1962. +{
  1963. + struct net_device *dev = platform_get_drvdata(pdev);
  1964. + struct xrx200_priv *priv;
  1965. +
  1966. + if (!dev)
  1967. + return 0;
  1968. +
  1969. + priv = netdev_priv(dev);
  1970. +
  1971. + /* free stack related instances */
  1972. + netif_stop_queue(dev);
  1973. + netif_napi_del(&xrx200_hw.chan[XRX200_DMA_RX].napi);
  1974. +
  1975. + /* shut down hardware */
  1976. + xrx200_hw_cleanup(&xrx200_hw);
  1977. +
  1978. + /* remove the actual device */
  1979. + unregister_netdev(dev);
  1980. + free_netdev(dev);
  1981. +
  1982. + return 0;
  1983. +}
  1984. +
  1985. +static const struct of_device_id xrx200_match[] = {
  1986. + { .compatible = "lantiq,xrx200-net" },
  1987. + {},
  1988. +};
  1989. +MODULE_DEVICE_TABLE(of, xrx200_match);
  1990. +
  1991. +static struct platform_driver xrx200_driver = {
  1992. + .probe = xrx200_probe,
  1993. + .remove = xrx200_remove,
  1994. + .driver = {
  1995. + .name = "lantiq,xrx200-net",
  1996. + .of_match_table = xrx200_match,
  1997. + .owner = THIS_MODULE,
  1998. + },
  1999. +};
  2000. +
  2001. +module_platform_driver(xrx200_driver);
  2002. +
  2003. +MODULE_AUTHOR("John Crispin <blogic@openwrt.org>");
  2004. +MODULE_DESCRIPTION("Lantiq SoC XRX200 ethernet");
  2005. +MODULE_LICENSE("GPL");
  2006. --- /dev/null
  2007. +++ b/drivers/net/ethernet/lantiq_xrx200_sw.h
  2008. @@ -0,0 +1,1328 @@
  2009. +/*
  2010. + * This program is free software; you can redistribute it and/or modify it
  2011. + * under the terms of the GNU General Public License version 2 as published
  2012. + * by the Free Software Foundation.
  2013. + *
  2014. + * This program is distributed in the hope that it will be useful,
  2015. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2016. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2017. + * GNU General Public License for more details.
  2018. + *
  2019. + * You should have received a copy of the GNU General Public License
  2020. + * along with this program; if not, write to the Free Software
  2021. + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
  2022. + *
  2023. + * Copyright (C) 2010 Lantiq Deutschland GmbH
  2024. + * Copyright (C) 2013 Antonios Vamporakis <vamporakis@yahoo.com>
  2025. + *
  2026. + * VR9 switch registers extracted from 310TUJ0 switch api
  2027. + * WARNING mult values of 0x00 may not be correct
  2028. + *
  2029. + */
  2030. +
  2031. +enum {
  2032. +// XRX200_ETHSW_SWRES, /* Ethernet Switch ResetControl Register */
  2033. +// XRX200_ETHSW_SWRES_R1, /* Hardware Reset */
  2034. +// XRX200_ETHSW_SWRES_R0, /* Register Configuration */
  2035. +// XRX200_ETHSW_CLK_MAC_GAT, /* Ethernet Switch Clock ControlRegister */
  2036. +// XRX200_ETHSW_CLK_EXP_SLEEP, /* Exponent to put system into sleep */
  2037. +// XRX200_ETHSW_CLK_EXP_WAKE, /* Exponent to wake up system */
  2038. +// XRX200_ETHSW_CLK_CLK2_EN, /* CLK2 Input for MAC */
  2039. +// XRX200_ETHSW_CLK_EXT_DIV_EN, /* External Clock Divider Enable */
  2040. +// XRX200_ETHSW_CLK_RAM_DBG_EN, /* Clock Gating Enable */
  2041. +// XRX200_ETHSW_CLK_REG_GAT_EN, /* Clock Gating Enable */
  2042. +// XRX200_ETHSW_CLK_GAT_EN, /* Clock Gating Enable */
  2043. +// XRX200_ETHSW_CLK_MAC_GAT_EN, /* Clock Gating Enable */
  2044. +// XRX200_ETHSW_DBG_STEP, /* Ethernet Switch Debug ControlRegister */
  2045. +// XRX200_ETHSW_DBG_CLK_SEL, /* Trigger Enable */
  2046. +// XRX200_ETHSW_DBG_MON_EN, /* Monitoring Enable */
  2047. +// XRX200_ETHSW_DBG_TRIG_EN, /* Trigger Enable */
  2048. +// XRX200_ETHSW_DBG_MODE, /* Debug Mode */
  2049. +// XRX200_ETHSW_DBG_STEP_TIME, /* Clock Step Size */
  2050. +// XRX200_ETHSW_SSB_MODE, /* Ethernet Switch SharedSegment Buffer Mode Register */
  2051. +// XRX200_ETHSW_SSB_MODE_ADDE, /* Memory Address */
  2052. +// XRX200_ETHSW_SSB_MODE_MODE, /* Memory Access Mode */
  2053. +// XRX200_ETHSW_SSB_ADDR, /* Ethernet Switch SharedSegment Buffer Address Register */
  2054. +// XRX200_ETHSW_SSB_ADDR_ADDE, /* Memory Address */
  2055. +// XRX200_ETHSW_SSB_DATA, /* Ethernet Switch SharedSegment Buffer Data Register */
  2056. +// XRX200_ETHSW_SSB_DATA_DATA, /* Data Value */
  2057. +// XRX200_ETHSW_CAP_0, /* Ethernet Switch CapabilityRegister 0 */
  2058. +// XRX200_ETHSW_CAP_0_SPEED, /* Clock frequency */
  2059. +// XRX200_ETHSW_CAP_1, /* Ethernet Switch CapabilityRegister 1 */
  2060. +// XRX200_ETHSW_CAP_1_GMAC, /* MAC operation mode */
  2061. +// XRX200_ETHSW_CAP_1_QUEUE, /* Number of queues */
  2062. +// XRX200_ETHSW_CAP_1_VPORTS, /* Number of virtual ports */
  2063. +// XRX200_ETHSW_CAP_1_PPORTS, /* Number of physical ports */
  2064. +// XRX200_ETHSW_CAP_2, /* Ethernet Switch CapabilityRegister 2 */
  2065. +// XRX200_ETHSW_CAP_2_PACKETS, /* Number of packets */
  2066. +// XRX200_ETHSW_CAP_3, /* Ethernet Switch CapabilityRegister 3 */
  2067. +// XRX200_ETHSW_CAP_3_METERS, /* Number of traffic meters */
  2068. +// XRX200_ETHSW_CAP_3_SHAPERS, /* Number of traffic shapers */
  2069. +// XRX200_ETHSW_CAP_4, /* Ethernet Switch CapabilityRegister 4 */
  2070. +// XRX200_ETHSW_CAP_4_PPPOE, /* PPPoE table size */
  2071. +// XRX200_ETHSW_CAP_4_VLAN, /* Active VLAN table size */
  2072. +// XRX200_ETHSW_CAP_5, /* Ethernet Switch CapabilityRegister 5 */
  2073. +// XRX200_ETHSW_CAP_5_IPPLEN, /* IP packet length table size */
  2074. +// XRX200_ETHSW_CAP_5_PROT, /* Protocol table size */
  2075. +// XRX200_ETHSW_CAP_6, /* Ethernet Switch CapabilityRegister 6 */
  2076. +// XRX200_ETHSW_CAP_6_MACDASA, /* MAC DA/SA table size */
  2077. +// XRX200_ETHSW_CAP_6_APPL, /* Application table size */
  2078. +// XRX200_ETHSW_CAP_7, /* Ethernet Switch CapabilityRegister 7 */
  2079. +// XRX200_ETHSW_CAP_7_IPDASAM, /* IP DA/SA MSB table size */
  2080. +// XRX200_ETHSW_CAP_7_IPDASAL, /* IP DA/SA LSB table size */
  2081. +// XRX200_ETHSW_CAP_8, /* Ethernet Switch CapabilityRegister 8 */
  2082. +// XRX200_ETHSW_CAP_8_MCAST, /* Multicast table size */
  2083. +// XRX200_ETHSW_CAP_9, /* Ethernet Switch CapabilityRegister 9 */
  2084. +// XRX200_ETHSW_CAP_9_FLAGG, /* Flow Aggregation table size */
  2085. +// XRX200_ETHSW_CAP_10, /* Ethernet Switch CapabilityRegister 10 */
  2086. +// XRX200_ETHSW_CAP_10_MACBT, /* MAC bridging table size */
  2087. +// XRX200_ETHSW_CAP_11, /* Ethernet Switch CapabilityRegister 11 */
  2088. +// XRX200_ETHSW_CAP_11_BSIZEL, /* Packet buffer size (lower part, in byte) */
  2089. +// XRX200_ETHSW_CAP_12, /* Ethernet Switch CapabilityRegister 12 */
  2090. +// XRX200_ETHSW_CAP_12_BSIZEH, /* Packet buffer size (higher part, in byte) */
  2091. +// XRX200_ETHSW_VERSION_REV, /* Ethernet Switch VersionRegister */
  2092. +// XRX200_ETHSW_VERSION_MOD_ID, /* Module Identification */
  2093. +// XRX200_ETHSW_VERSION_REV_ID, /* Hardware Revision Identification */
  2094. +// XRX200_ETHSW_IER, /* Interrupt Enable Register */
  2095. +// XRX200_ETHSW_IER_FDMAIE, /* Fetch DMA Interrupt Enable */
  2096. +// XRX200_ETHSW_IER_SDMAIE, /* Store DMA Interrupt Enable */
  2097. +// XRX200_ETHSW_IER_MACIE, /* Ethernet MAC Interrupt Enable */
  2098. +// XRX200_ETHSW_IER_PCEIE, /* Parser and Classification Engine Interrupt Enable */
  2099. +// XRX200_ETHSW_IER_BMIE, /* Buffer Manager Interrupt Enable */
  2100. +// XRX200_ETHSW_ISR, /* Interrupt Status Register */
  2101. +// XRX200_ETHSW_ISR_FDMAINT, /* Fetch DMA Interrupt */
  2102. +// XRX200_ETHSW_ISR_SDMAINT, /* Store DMA Interrupt */
  2103. +// XRX200_ETHSW_ISR_MACINT, /* Ethernet MAC Interrupt */
  2104. +// XRX200_ETHSW_ISR_PCEINT, /* Parser and Classification Engine Interrupt */
  2105. +// XRX200_ETHSW_ISR_BMINT, /* Buffer Manager Interrupt */
  2106. +// XRX200_ETHSW_SPARE_0, /* Ethernet Switch SpareCells 0 */
  2107. +// XRX200_ETHSW_SPARE_0_SPARE, /* SPARE0 */
  2108. +// XRX200_ETHSW_SPARE_1, /* Ethernet Switch SpareCells 1 */
  2109. +// XRX200_ETHSW_SPARE_1_SPARE, /* SPARE1 */
  2110. +// XRX200_ETHSW_SPARE_2, /* Ethernet Switch SpareCells 2 */
  2111. +// XRX200_ETHSW_SPARE_2_SPARE, /* SPARE2 */
  2112. +// XRX200_ETHSW_SPARE_3, /* Ethernet Switch SpareCells 3 */
  2113. +// XRX200_ETHSW_SPARE_3_SPARE, /* SPARE3 */
  2114. +// XRX200_ETHSW_SPARE_4, /* Ethernet Switch SpareCells 4 */
  2115. +// XRX200_ETHSW_SPARE_4_SPARE, /* SPARE4 */
  2116. +// XRX200_ETHSW_SPARE_5, /* Ethernet Switch SpareCells 5 */
  2117. +// XRX200_ETHSW_SPARE_5_SPARE, /* SPARE5 */
  2118. +// XRX200_ETHSW_SPARE_6, /* Ethernet Switch SpareCells 6 */
  2119. +// XRX200_ETHSW_SPARE_6_SPARE, /* SPARE6 */
  2120. +// XRX200_ETHSW_SPARE_7, /* Ethernet Switch SpareCells 7 */
  2121. +// XRX200_ETHSW_SPARE_7_SPARE, /* SPARE7 */
  2122. +// XRX200_ETHSW_SPARE_8, /* Ethernet Switch SpareCells 8 */
  2123. +// XRX200_ETHSW_SPARE_8_SPARE, /* SPARE8 */
  2124. +// XRX200_ETHSW_SPARE_9, /* Ethernet Switch SpareCells 9 */
  2125. +// XRX200_ETHSW_SPARE_9_SPARE, /* SPARE9 */
  2126. +// XRX200_ETHSW_SPARE_10, /* Ethernet Switch SpareCells 10 */
  2127. +// XRX200_ETHSW_SPARE_10_SPARE, /* SPARE10 */
  2128. +// XRX200_ETHSW_SPARE_11, /* Ethernet Switch SpareCells 11 */
  2129. +// XRX200_ETHSW_SPARE_11_SPARE, /* SPARE11 */
  2130. +// XRX200_ETHSW_SPARE_12, /* Ethernet Switch SpareCells 12 */
  2131. +// XRX200_ETHSW_SPARE_12_SPARE, /* SPARE12 */
  2132. +// XRX200_ETHSW_SPARE_13, /* Ethernet Switch SpareCells 13 */
  2133. +// XRX200_ETHSW_SPARE_13_SPARE, /* SPARE13 */
  2134. +// XRX200_ETHSW_SPARE_14, /* Ethernet Switch SpareCells 14 */
  2135. +// XRX200_ETHSW_SPARE_14_SPARE, /* SPARE14 */
  2136. +// XRX200_ETHSW_SPARE_15, /* Ethernet Switch SpareCells 15 */
  2137. +// XRX200_ETHSW_SPARE_15_SPARE, /* SPARE15 */
  2138. +// XRX200_BM_RAM_VAL_3, /* RAM Value Register 3 */
  2139. +// XRX200_BM_RAM_VAL_3_VAL3, /* Data value [15:0] */
  2140. +// XRX200_BM_RAM_VAL_2, /* RAM Value Register 2 */
  2141. +// XRX200_BM_RAM_VAL_2_VAL2, /* Data value [15:0] */
  2142. +// XRX200_BM_RAM_VAL_1, /* RAM Value Register 1 */
  2143. +// XRX200_BM_RAM_VAL_1_VAL1, /* Data value [15:0] */
  2144. +// XRX200_BM_RAM_VAL_0, /* RAM Value Register 0 */
  2145. +// XRX200_BM_RAM_VAL_0_VAL0, /* Data value [15:0] */
  2146. +// XRX200_BM_RAM_ADDR, /* RAM Address Register */
  2147. +// XRX200_BM_RAM_ADDR_ADDR, /* RAM Address */
  2148. +// XRX200_BM_RAM_CTRL, /* RAM Access Control Register */
  2149. +// XRX200_BM_RAM_CTRL_BAS, /* Access Busy/Access Start */
  2150. +// XRX200_BM_RAM_CTRL_OPMOD, /* Lookup Table Access Operation Mode */
  2151. +// XRX200_BM_RAM_CTRL_ADDR, /* Address for RAM selection */
  2152. +// XRX200_BM_FSQM_GCTRL, /* Free Segment Queue ManagerGlobal Control Register */
  2153. +// XRX200_BM_FSQM_GCTRL_SEGNUM, /* Maximum Segment Number */
  2154. +// XRX200_BM_CONS_SEG, /* Number of Consumed SegmentsRegister */
  2155. +// XRX200_BM_CONS_SEG_FSEG, /* Number of Consumed Segments */
  2156. +// XRX200_BM_CONS_PKT, /* Number of Consumed PacketPointers Register */
  2157. +// XRX200_BM_CONS_PKT_FQP, /* Number of Consumed Packet Pointers */
  2158. +// XRX200_BM_GCTRL_F, /* Buffer Manager Global ControlRegister 0 */
  2159. +// XRX200_BM_GCTRL_BM_STA, /* Buffer Manager Initialization Status Bit */
  2160. +// XRX200_BM_GCTRL_SAT, /* RMON Counter Update Mode */
  2161. +// XRX200_BM_GCTRL_FR_RBC, /* Freeze RMON RX Bad Byte 64 Bit Counter */
  2162. +// XRX200_BM_GCTRL_FR_RGC, /* Freeze RMON RX Good Byte 64 Bit Counter */
  2163. +// XRX200_BM_GCTRL_FR_TGC, /* Freeze RMON TX Good Byte 64 Bit Counter */
  2164. +// XRX200_BM_GCTRL_I_FIN, /* RAM initialization finished */
  2165. +// XRX200_BM_GCTRL_CX_INI, /* PQM Context RAM initialization */
  2166. +// XRX200_BM_GCTRL_FP_INI, /* FPQM RAM initialization */
  2167. +// XRX200_BM_GCTRL_FS_INI, /* FSQM RAM initialization */
  2168. +// XRX200_BM_GCTRL_R_SRES, /* Software Reset for RMON */
  2169. +// XRX200_BM_GCTRL_S_SRES, /* Software Reset for Scheduler */
  2170. +// XRX200_BM_GCTRL_A_SRES, /* Software Reset for AVG */
  2171. +// XRX200_BM_GCTRL_P_SRES, /* Software Reset for PQM */
  2172. +// XRX200_BM_GCTRL_F_SRES, /* Software Reset for FSQM */
  2173. +// XRX200_BM_QUEUE_GCTRL, /* Queue Manager GlobalControl Register 0 */
  2174. +// XRX200_BM_QUEUE_GCTRL_GL_MOD, /* WRED Mode Signal */
  2175. +// XRX200_BM_QUEUE_GCTRL_AQUI, /* Average Queue Update Interval */
  2176. +// XRX200_BM_QUEUE_GCTRL_AQWF, /* Average Queue Weight Factor */
  2177. +// XRX200_BM_QUEUE_GCTRL_QAVGEN, /* Queue Average Calculation Enable */
  2178. +// XRX200_BM_QUEUE_GCTRL_DPROB, /* Drop Probability Profile */
  2179. +// XRX200_BM_WRED_RTH_0, /* WRED Red Threshold Register0 */
  2180. +// XRX200_BM_WRED_RTH_0_MINTH, /* Minimum Threshold */
  2181. +// XRX200_BM_WRED_RTH_1, /* WRED Red Threshold Register1 */
  2182. +// XRX200_BM_WRED_RTH_1_MAXTH, /* Maximum Threshold */
  2183. +// XRX200_BM_WRED_YTH_0, /* WRED Yellow ThresholdRegister 0 */
  2184. +// XRX200_BM_WRED_YTH_0_MINTH, /* Minimum Threshold */
  2185. +// XRX200_BM_WRED_YTH_1, /* WRED Yellow ThresholdRegister 1 */
  2186. +// XRX200_BM_WRED_YTH_1_MAXTH, /* Maximum Threshold */
  2187. +// XRX200_BM_WRED_GTH_0, /* WRED Green ThresholdRegister 0 */
  2188. +// XRX200_BM_WRED_GTH_0_MINTH, /* Minimum Threshold */
  2189. +// XRX200_BM_WRED_GTH_1, /* WRED Green ThresholdRegister 1 */
  2190. +// XRX200_BM_WRED_GTH_1_MAXTH, /* Maximum Threshold */
  2191. +// XRX200_BM_DROP_GTH_0_THR, /* Drop Threshold ConfigurationRegister 0 */
  2192. +// XRX200_BM_DROP_GTH_0_THR_FQ, /* Threshold for frames marked red */
  2193. +// XRX200_BM_DROP_GTH_1_THY, /* Drop Threshold ConfigurationRegister 1 */
  2194. +// XRX200_BM_DROP_GTH_1_THY_FQ, /* Threshold for frames marked yellow */
  2195. +// XRX200_BM_DROP_GTH_2_THG, /* Drop Threshold ConfigurationRegister 2 */
  2196. +// XRX200_BM_DROP_GTH_2_THG_FQ, /* Threshold for frames marked green */
  2197. +// XRX200_BM_IER, /* Buffer Manager Global InterruptEnable Register */
  2198. +// XRX200_BM_IER_CNT4, /* Counter Group 4 (RMON-CLASSIFICATION) Interrupt Enable */
  2199. +// XRX200_BM_IER_CNT3, /* Counter Group 3 (RMON-PQM) Interrupt Enable */
  2200. +// XRX200_BM_IER_CNT2, /* Counter Group 2 (RMON-SCHEDULER) Interrupt Enable */
  2201. +// XRX200_BM_IER_CNT1, /* Counter Group 1 (RMON-QFETCH) Interrupt Enable */
  2202. +// XRX200_BM_IER_CNT0, /* Counter Group 0 (RMON-QSTOR) Interrupt Enable */
  2203. +// XRX200_BM_IER_DEQ, /* PQM dequeue Interrupt Enable */
  2204. +// XRX200_BM_IER_ENQ, /* PQM Enqueue Interrupt Enable */
  2205. +// XRX200_BM_IER_FSQM, /* Buffer Empty Interrupt Enable */
  2206. +// XRX200_BM_ISR, /* Buffer Manager Global InterruptStatus Register */
  2207. +// XRX200_BM_ISR_CNT4, /* Counter Group 4 Interrupt */
  2208. +// XRX200_BM_ISR_CNT3, /* Counter Group 3 Interrupt */
  2209. +// XRX200_BM_ISR_CNT2, /* Counter Group 2 Interrupt */
  2210. +// XRX200_BM_ISR_CNT1, /* Counter Group 1 Interrupt */
  2211. +// XRX200_BM_ISR_CNT0, /* Counter Group 0 Interrupt */
  2212. +// XRX200_BM_ISR_DEQ, /* PQM dequeue Interrupt Enable */
  2213. +// XRX200_BM_ISR_ENQ, /* PQM Enqueue Interrupt */
  2214. +// XRX200_BM_ISR_FSQM, /* Buffer Empty Interrupt */
  2215. +// XRX200_BM_CISEL, /* Buffer Manager RMON CounterInterrupt Select Register */
  2216. +// XRX200_BM_CISEL_PORT, /* Port Number */
  2217. +// XRX200_BM_DEBUG_CTRL_DBG, /* Debug Control Register */
  2218. +// XRX200_BM_DEBUG_CTRL_DBG_SEL, /* Select Signal for Debug Multiplexer */
  2219. +// XRX200_BM_DEBUG_VAL_DBG, /* Debug Value Register */
  2220. +// XRX200_BM_DEBUG_VAL_DBG_DAT, /* Debug Data Value */
  2221. +// XRX200_BM_PCFG, /* Buffer Manager PortConfiguration Register */
  2222. +// XRX200_BM_PCFG_CNTEN, /* RMON Counter Enable */
  2223. +// XRX200_BM_RMON_CTRL_RAM1, /* Buffer ManagerRMON Control Register */
  2224. +// XRX200_BM_RMON_CTRL_RAM2_RES, /* Software Reset for RMON RAM2 */
  2225. +// XRX200_BM_RMON_CTRL_RAM1_RES, /* Software Reset for RMON RAM1 */
  2226. +// XRX200_PQM_DP, /* Packet Queue ManagerDrop Probability Register */
  2227. +// XRX200_PQM_DP_DPROB, /* Drop Probability Profile */
  2228. +// XRX200_PQM_RS, /* Packet Queue ManagerRate Shaper Assignment Register */
  2229. +// XRX200_PQM_RS_EN2, /* Rate Shaper 2 Enable */
  2230. +// XRX200_PQM_RS_RS2, /* Rate Shaper 2 */
  2231. +// XRX200_PQM_RS_EN1, /* Rate Shaper 1 Enable */
  2232. +// XRX200_PQM_RS_RS1, /* Rate Shaper 1 */
  2233. +// XRX200_RS_CTRL, /* Rate Shaper ControlRegister */
  2234. +// XRX200_RS_CTRL_RSEN, /* Rate Shaper Enable */
  2235. +// XRX200_RS_CBS, /* Rate Shaper CommittedBurst Size Register */
  2236. +// XRX200_RS_CBS_CBS, /* Committed Burst Size */
  2237. +// XRX200_RS_IBS, /* Rate Shaper InstantaneousBurst Size Register */
  2238. +// XRX200_RS_IBS_IBS, /* Instantaneous Burst Size */
  2239. +// XRX200_RS_CIR_EXP, /* Rate Shaper RateExponent Register */
  2240. +// XRX200_RS_CIR_EXP_EXP, /* Exponent */
  2241. +// XRX200_RS_CIR_MANT, /* Rate Shaper RateMantissa Register */
  2242. +// XRX200_RS_CIR_MANT_MANT, /* Mantissa */
  2243. + XRX200_PCE_TBL_KEY_7, /* Table Key Data 7 */
  2244. +// XRX200_PCE_TBL_KEY_7_KEY7, /* Key Value[15:0] */
  2245. + XRX200_PCE_TBL_KEY_6, /* Table Key Data 6 */
  2246. +// XRX200_PCE_TBL_KEY_6_KEY6, /* Key Value[15:0] */
  2247. + XRX200_PCE_TBL_KEY_5, /* Table Key Data 5 */
  2248. +// XRX200_PCE_TBL_KEY_5_KEY5, /* Key Value[15:0] */
  2249. + XRX200_PCE_TBL_KEY_4, /* Table Key Data 4 */
  2250. +// XRX200_PCE_TBL_KEY_4_KEY4, /* Key Value[15:0] */
  2251. + XRX200_PCE_TBL_KEY_3, /* Table Key Data 3 */
  2252. +// XRX200_PCE_TBL_KEY_3_KEY3, /* Key Value[15:0] */
  2253. + XRX200_PCE_TBL_KEY_2, /* Table Key Data 2 */
  2254. +// XRX200_PCE_TBL_KEY_2_KEY2, /* Key Value[15:0] */
  2255. + XRX200_PCE_TBL_KEY_1, /* Table Key Data 1 */
  2256. +// XRX200_PCE_TBL_KEY_1_KEY1, /* Key Value[31:16] */
  2257. + XRX200_PCE_TBL_KEY_0, /* Table Key Data 0 */
  2258. +// XRX200_PCE_TBL_KEY_0_KEY0, /* Key Value[15:0] */
  2259. + XRX200_PCE_TBL_MASK_0, /* Table Mask Write Register0 */
  2260. +// XRX200_PCE_TBL_MASK_0_MASK0, /* Mask Pattern [15:0] */
  2261. + XRX200_PCE_TBL_VAL_4, /* Table Value Register4 */
  2262. +// XRX200_PCE_TBL_VAL_4_VAL4, /* Data value [15:0] */
  2263. + XRX200_PCE_TBL_VAL_3, /* Table Value Register3 */
  2264. +// XRX200_PCE_TBL_VAL_3_VAL3, /* Data value [15:0] */
  2265. + XRX200_PCE_TBL_VAL_2, /* Table Value Register2 */
  2266. +// XRX200_PCE_TBL_VAL_2_VAL2, /* Data value [15:0] */
  2267. + XRX200_PCE_TBL_VAL_1, /* Table Value Register1 */
  2268. +// XRX200_PCE_TBL_VAL_1_VAL1, /* Data value [15:0] */
  2269. + XRX200_PCE_TBL_VAL_0, /* Table Value Register0 */
  2270. +// XRX200_PCE_TBL_VAL_0_VAL0, /* Data value [15:0] */
  2271. +// XRX200_PCE_TBL_ADDR, /* Table Entry AddressRegister */
  2272. + XRX200_PCE_TBL_ADDR_ADDR, /* Table Address */
  2273. +// XRX200_PCE_TBL_CTRL, /* Table Access ControlRegister */
  2274. + XRX200_PCE_TBL_CTRL_BAS, /* Access Busy/Access Start */
  2275. + XRX200_PCE_TBL_CTRL_TYPE, /* Lookup Entry Type */
  2276. + XRX200_PCE_TBL_CTRL_VLD, /* Lookup Entry Valid */
  2277. + XRX200_PCE_TBL_CTRL_GMAP, /* Group Map */
  2278. + XRX200_PCE_TBL_CTRL_OPMOD, /* Lookup Table Access Operation Mode */
  2279. + XRX200_PCE_TBL_CTRL_ADDR, /* Lookup Table Address */
  2280. +// XRX200_PCE_TBL_STAT, /* Table General StatusRegister */
  2281. +// XRX200_PCE_TBL_STAT_TBUSY, /* Table Access Busy */
  2282. +// XRX200_PCE_TBL_STAT_TEMPT, /* Table Empty */
  2283. +// XRX200_PCE_TBL_STAT_TFUL, /* Table Full */
  2284. +// XRX200_PCE_AGE_0, /* Aging Counter ConfigurationRegister 0 */
  2285. +// XRX200_PCE_AGE_0_EXP, /* Aging Counter Exponent Value */
  2286. +// XRX200_PCE_AGE_1, /* Aging Counter ConfigurationRegister 1 */
  2287. +// XRX200_PCE_AGE_1_MANT, /* Aging Counter Mantissa Value */
  2288. +// XRX200_PCE_PMAP_1, /* Port Map Register 1 */
  2289. +// XRX200_PCE_PMAP_1_MPMAP, /* Monitoring Port Map */
  2290. +// XRX200_PCE_PMAP_2, /* Port Map Register 2 */
  2291. +// XRX200_PCE_PMAP_2_DMCPMAP, /* Default Multicast Port Map */
  2292. +// XRX200_PCE_PMAP_3, /* Port Map Register 3 */
  2293. +// XRX200_PCE_PMAP_3_UUCMAP, /* Default Unknown Unicast Port Map */
  2294. +// XRX200_PCE_GCTRL_0, /* PCE Global Control Register0 */
  2295. +// XRX200_PCE_GCTRL_0_IGMP, /* IGMP Mode Selection */
  2296. + XRX200_PCE_GCTRL_0_VLAN, /* VLAN-aware Switching */
  2297. +// XRX200_PCE_GCTRL_0_NOPM, /* No Port Map Forwarding */
  2298. +// XRX200_PCE_GCTRL_0_SCONUC, /* Unknown Unicast Storm Control */
  2299. +// XRX200_PCE_GCTRL_0_SCONMC, /* Multicast Storm Control */
  2300. +// XRX200_PCE_GCTRL_0_SCONBC, /* Broadcast Storm Control */
  2301. +// XRX200_PCE_GCTRL_0_SCONMOD, /* Storm Control Mode */
  2302. +// XRX200_PCE_GCTRL_0_SCONMET, /* Storm Control Metering Instance */
  2303. +// XRX200_PCE_GCTRL_0_MC_VALID, /* Access Request */
  2304. +// XRX200_PCE_GCTRL_0_PLCKMOD, /* Port Lock Mode */
  2305. +// XRX200_PCE_GCTRL_0_PLIMMOD, /* MAC Address Learning Limitation Mode */
  2306. +// XRX200_PCE_GCTRL_0_MTFL, /* MAC Table Flushing */
  2307. +// XRX200_PCE_GCTRL_1, /* PCE Global Control Register1 */
  2308. +// XRX200_PCE_GCTRL_1_PCE_DIS, /* PCE Disable after currently processed packet */
  2309. +// XRX200_PCE_GCTRL_1_LRNMOD, /* MAC Address Learning Mode */
  2310. +// XRX200_PCE_TCM_GLOB_CTRL, /* Three-color MarkerGlobal Control Register */
  2311. +// XRX200_PCE_TCM_GLOB_CTRL_DPRED, /* Re-marking Drop Precedence Red Encoding */
  2312. +// XRX200_PCE_TCM_GLOB_CTRL_DPYEL, /* Re-marking Drop Precedence Yellow Encoding */
  2313. +// XRX200_PCE_TCM_GLOB_CTRL_DPGRN, /* Re-marking Drop Precedence Green Encoding */
  2314. +// XRX200_PCE_IGMP_CTRL, /* IGMP Control Register */
  2315. +// XRX200_PCE_IGMP_CTRL_FAGEEN, /* Force Aging of Table Entries Enable */
  2316. +// XRX200_PCE_IGMP_CTRL_FLEAVE, /* Fast Leave Enable */
  2317. +// XRX200_PCE_IGMP_CTRL_DMRTEN, /* Default Maximum Response Time Enable */
  2318. +// XRX200_PCE_IGMP_CTRL_JASUP, /* Join Aggregation Suppression Enable */
  2319. +// XRX200_PCE_IGMP_CTRL_REPSUP, /* Report Suppression Enable */
  2320. +// XRX200_PCE_IGMP_CTRL_SRPEN, /* Snooping of Router Port Enable */
  2321. +// XRX200_PCE_IGMP_CTRL_ROB, /* Robustness Variable */
  2322. +// XRX200_PCE_IGMP_CTRL_DMRT, /* IGMP Default Maximum Response Time */
  2323. +// XRX200_PCE_IGMP_DRPM, /* IGMP Default RouterPort Map Register */
  2324. +// XRX200_PCE_IGMP_DRPM_DRPM, /* IGMP Default Router Port Map */
  2325. +// XRX200_PCE_IGMP_AGE_0, /* IGMP Aging Register0 */
  2326. +// XRX200_PCE_IGMP_AGE_0_MANT, /* IGMP Group Aging Time Mantissa */
  2327. +// XRX200_PCE_IGMP_AGE_0_EXP, /* IGMP Group Aging Time Exponent */
  2328. +// XRX200_PCE_IGMP_AGE_1, /* IGMP Aging Register1 */
  2329. +// XRX200_PCE_IGMP_AGE_1_MANT, /* IGMP Router Port Aging Time Mantissa */
  2330. +// XRX200_PCE_IGMP_STAT, /* IGMP Status Register */
  2331. +// XRX200_PCE_IGMP_STAT_IGPM, /* IGMP Port Map */
  2332. +// XRX200_WOL_GLB_CTRL, /* Wake-on-LAN ControlRegister */
  2333. +// XRX200_WOL_GLB_CTRL_PASSEN, /* WoL Password Enable */
  2334. +// XRX200_WOL_DA_0, /* Wake-on-LAN DestinationAddress Register 0 */
  2335. +// XRX200_WOL_DA_0_DA0, /* WoL Destination Address [15:0] */
  2336. +// XRX200_WOL_DA_1, /* Wake-on-LAN DestinationAddress Register 1 */
  2337. +// XRX200_WOL_DA_1_DA1, /* WoL Destination Address [31:16] */
  2338. +// XRX200_WOL_DA_2, /* Wake-on-LAN DestinationAddress Register 2 */
  2339. +// XRX200_WOL_DA_2_DA2, /* WoL Destination Address [47:32] */
  2340. +// XRX200_WOL_PW_0, /* Wake-on-LAN Password Register0 */
  2341. +// XRX200_WOL_PW_0_PW0, /* WoL Password [15:0] */
  2342. +// XRX200_WOL_PW_1, /* Wake-on-LAN Password Register1 */
  2343. +// XRX200_WOL_PW_1_PW1, /* WoL Password [31:16] */
  2344. +// XRX200_WOL_PW_2, /* Wake-on-LAN Password Register2 */
  2345. +// XRX200_WOL_PW_2_PW2, /* WoL Password [47:32] */
  2346. +// XRX200_PCE_IER_0_PINT, /* Parser and ClassificationEngine Global Interrupt Enable Register 0 */
  2347. +// XRX200_PCE_IER_0_PINT_15, /* Port Interrupt Enable */
  2348. +// XRX200_PCE_IER_0_PINT_14, /* Port Interrupt Enable */
  2349. +// XRX200_PCE_IER_0_PINT_13, /* Port Interrupt Enable */
  2350. +// XRX200_PCE_IER_0_PINT_12, /* Port Interrupt Enable */
  2351. +// XRX200_PCE_IER_0_PINT_11, /* Port Interrupt Enable */
  2352. +// XRX200_PCE_IER_0_PINT_10, /* Port Interrupt Enable */
  2353. +// XRX200_PCE_IER_0_PINT_9, /* Port Interrupt Enable */
  2354. +// XRX200_PCE_IER_0_PINT_8, /* Port Interrupt Enable */
  2355. +// XRX200_PCE_IER_0_PINT_7, /* Port Interrupt Enable */
  2356. +// XRX200_PCE_IER_0_PINT_6, /* Port Interrupt Enable */
  2357. +// XRX200_PCE_IER_0_PINT_5, /* Port Interrupt Enable */
  2358. +// XRX200_PCE_IER_0_PINT_4, /* Port Interrupt Enable */
  2359. +// XRX200_PCE_IER_0_PINT_3, /* Port Interrupt Enable */
  2360. +// XRX200_PCE_IER_0_PINT_2, /* Port Interrupt Enable */
  2361. +// XRX200_PCE_IER_0_PINT_1, /* Port Interrupt Enable */
  2362. +// XRX200_PCE_IER_0_PINT_0, /* Port Interrupt Enable */
  2363. +// XRX200_PCE_IER_1, /* Parser and ClassificationEngine Global Interrupt Enable Register 1 */
  2364. +// XRX200_PCE_IER_1_FLOWINT, /* Traffic Flow Table Interrupt Rule matched Interrupt Enable */
  2365. +// XRX200_PCE_IER_1_CPH2, /* Classification Phase 2 Ready Interrupt Enable */
  2366. +// XRX200_PCE_IER_1_CPH1, /* Classification Phase 1 Ready Interrupt Enable */
  2367. +// XRX200_PCE_IER_1_CPH0, /* Classification Phase 0 Ready Interrupt Enable */
  2368. +// XRX200_PCE_IER_1_PRDY, /* Parser Ready Interrupt Enable */
  2369. +// XRX200_PCE_IER_1_IGTF, /* IGMP Table Full Interrupt Enable */
  2370. +// XRX200_PCE_IER_1_MTF, /* MAC Table Full Interrupt Enable */
  2371. +// XRX200_PCE_ISR_0_PINT, /* Parser and ClassificationEngine Global Interrupt Status Register 0 */
  2372. +// XRX200_PCE_ISR_0_PINT_15, /* Port Interrupt */
  2373. +// XRX200_PCE_ISR_0_PINT_14, /* Port Interrupt */
  2374. +// XRX200_PCE_ISR_0_PINT_13, /* Port Interrupt */
  2375. +// XRX200_PCE_ISR_0_PINT_12, /* Port Interrupt */
  2376. +// XRX200_PCE_ISR_0_PINT_11, /* Port Interrupt */
  2377. +// XRX200_PCE_ISR_0_PINT_10, /* Port Interrupt */
  2378. +// XRX200_PCE_ISR_0_PINT_9, /* Port Interrupt */
  2379. +// XRX200_PCE_ISR_0_PINT_8, /* Port Interrupt */
  2380. +// XRX200_PCE_ISR_0_PINT_7, /* Port Interrupt */
  2381. +// XRX200_PCE_ISR_0_PINT_6, /* Port Interrupt */
  2382. +// XRX200_PCE_ISR_0_PINT_5, /* Port Interrupt */
  2383. +// XRX200_PCE_ISR_0_PINT_4, /* Port Interrupt */
  2384. +// XRX200_PCE_ISR_0_PINT_3, /* Port Interrupt */
  2385. +// XRX200_PCE_ISR_0_PINT_2, /* Port Interrupt */
  2386. +// XRX200_PCE_ISR_0_PINT_1, /* Port Interrupt */
  2387. +// XRX200_PCE_ISR_0_PINT_0, /* Port Interrupt */
  2388. +// XRX200_PCE_ISR_1, /* Parser and ClassificationEngine Global Interrupt Status Register 1 */
  2389. +// XRX200_PCE_ISR_1_FLOWINT, /* Traffic Flow Table Interrupt Rule matched */
  2390. +// XRX200_PCE_ISR_1_CPH2, /* Classification Phase 2 Ready Interrupt */
  2391. +// XRX200_PCE_ISR_1_CPH1, /* Classification Phase 1 Ready Interrupt */
  2392. +// XRX200_PCE_ISR_1_CPH0, /* Classification Phase 0 Ready Interrupt */
  2393. +// XRX200_PCE_ISR_1_PRDY, /* Parser Ready Interrupt */
  2394. +// XRX200_PCE_ISR_1_IGTF, /* IGMP Table Full Interrupt */
  2395. +// XRX200_PCE_ISR_1_MTF, /* MAC Table Full Interrupt */
  2396. +// XRX200_PARSER_STAT_FIFO, /* Parser Status Register */
  2397. +// XRX200_PARSER_STAT_FSM_DAT_CNT, /* Parser FSM Data Counter */
  2398. +// XRX200_PARSER_STAT_FSM_STATE, /* Parser FSM State */
  2399. +// XRX200_PARSER_STAT_PKT_ERR, /* Packet error detected */
  2400. +// XRX200_PARSER_STAT_FSM_FIN, /* Parser FSM finished */
  2401. +// XRX200_PARSER_STAT_FSM_START, /* Parser FSM start */
  2402. +// XRX200_PARSER_STAT_FIFO_RDY, /* Parser FIFO ready for read. */
  2403. +// XRX200_PARSER_STAT_FIFO_FULL, /* Parser */
  2404. +// XRX200_PCE_PCTRL_0, /* PCE Port ControlRegister 0 */
  2405. +// XRX200_PCE_PCTRL_0_MCST, /* Multicast Forwarding Mode Selection */
  2406. +// XRX200_PCE_PCTRL_0_EGSTEN, /* Table-based Egress Special Tag Enable */
  2407. +// XRX200_PCE_PCTRL_0_IGSTEN, /* Ingress Special Tag Enable */
  2408. +// XRX200_PCE_PCTRL_0_PCPEN, /* PCP Remarking Mode */
  2409. +// XRX200_PCE_PCTRL_0_CLPEN, /* Class Remarking Mode */
  2410. +// XRX200_PCE_PCTRL_0_DPEN, /* Drop Precedence Remarking Mode */
  2411. +// XRX200_PCE_PCTRL_0_CMOD, /* Three-color Marker Color Mode */
  2412. +// XRX200_PCE_PCTRL_0_VREP, /* VLAN Replacement Mode */
  2413. + XRX200_PCE_PCTRL_0_TVM, /* Transparent VLAN Mode */
  2414. +// XRX200_PCE_PCTRL_0_PLOCK, /* Port Locking Enable */
  2415. +// XRX200_PCE_PCTRL_0_AGEDIS, /* Aging Disable */
  2416. +// XRX200_PCE_PCTRL_0_PSTATE, /* Port State */
  2417. +// XRX200_PCE_PCTRL_1, /* PCE Port ControlRegister 1 */
  2418. +// XRX200_PCE_PCTRL_1_LRNLIM, /* MAC Address Learning Limit */
  2419. +// XRX200_PCE_PCTRL_2, /* PCE Port ControlRegister 2 */
  2420. +// XRX200_PCE_PCTRL_2_DSCPMOD, /* DSCP Mode Selection */
  2421. +// XRX200_PCE_PCTRL_2_DSCP, /* Enable DSCP to select the Class of Service */
  2422. +// XRX200_PCE_PCTRL_2_PCP, /* Enable VLAN PCP to select the Class of Service */
  2423. +// XRX200_PCE_PCTRL_2_PCLASS, /* Port-based Traffic Class */
  2424. +// XRX200_PCE_PCTRL_3_VIO, /* PCE Port ControlRegister 3 */
  2425. +// XRX200_PCE_PCTRL_3_EDIR, /* Egress Redirection Mode */
  2426. +// XRX200_PCE_PCTRL_3_RXDMIR, /* Receive Mirroring Enable for dropped frames */
  2427. +// XRX200_PCE_PCTRL_3_RXVMIR, /* Receive Mirroring Enable for valid frames */
  2428. +// XRX200_PCE_PCTRL_3_TXMIR, /* Transmit Mirroring Enable */
  2429. +// XRX200_PCE_PCTRL_3_VIO_7, /* Violation Type 7 Mirroring Enable */
  2430. +// XRX200_PCE_PCTRL_3_VIO_6, /* Violation Type 6 Mirroring Enable */
  2431. +// XRX200_PCE_PCTRL_3_VIO_5, /* Violation Type 5 Mirroring Enable */
  2432. +// XRX200_PCE_PCTRL_3_VIO_4, /* Violation Type 4 Mirroring Enable */
  2433. +// XRX200_PCE_PCTRL_3_VIO_3, /* Violation Type 3 Mirroring Enable */
  2434. +// XRX200_PCE_PCTRL_3_VIO_2, /* Violation Type 2 Mirroring Enable */
  2435. +// XRX200_PCE_PCTRL_3_VIO_1, /* Violation Type 1 Mirroring Enable */
  2436. +// XRX200_PCE_PCTRL_3_VIO_0, /* Violation Type 0 Mirroring Enable */
  2437. +// XRX200_WOL_CTRL, /* Wake-on-LAN ControlRegister */
  2438. +// XRX200_WOL_CTRL_PORT, /* WoL Enable */
  2439. +// XRX200_PCE_VCTRL, /* PCE VLAN ControlRegister */
  2440. + XRX200_PCE_VCTRL_VSR, /* VLAN Security Rule */
  2441. + XRX200_PCE_VCTRL_VEMR, /* VLAN Egress Member Violation Rule */
  2442. + XRX200_PCE_VCTRL_VIMR, /* VLAN Ingress Member Violation Rule */
  2443. + XRX200_PCE_VCTRL_VINR, /* VLAN Ingress Tag Rule */
  2444. + XRX200_PCE_VCTRL_UVR, /* Unknown VLAN Rule */
  2445. +// XRX200_PCE_DEFPVID, /* PCE Default PortVID Register */
  2446. + XRX200_PCE_DEFPVID_PVID, /* Default Port VID Index */
  2447. +// XRX200_PCE_PSTAT, /* PCE Port StatusRegister */
  2448. +// XRX200_PCE_PSTAT_LRNCNT, /* Learning Count */
  2449. +// XRX200_PCE_PIER, /* Parser and ClassificationEngine Port Interrupt Enable Register */
  2450. +// XRX200_PCE_PIER_CLDRP, /* Classification Drop Interrupt Enable */
  2451. +// XRX200_PCE_PIER_PTDRP, /* Port Drop Interrupt Enable */
  2452. +// XRX200_PCE_PIER_VLAN, /* VLAN Violation Interrupt Enable */
  2453. +// XRX200_PCE_PIER_WOL, /* Wake-on-LAN Interrupt Enable */
  2454. +// XRX200_PCE_PIER_LOCK, /* Port Limit Alert Interrupt Enable */
  2455. +// XRX200_PCE_PIER_LIM, /* Port Lock Alert Interrupt Enable */
  2456. +// XRX200_PCE_PISR, /* Parser and ClassificationEngine Port Interrupt Status Register */
  2457. +// XRX200_PCE_PISR_CLDRP, /* Classification Drop Interrupt */
  2458. +// XRX200_PCE_PISR_PTDRP, /* Port Drop Interrupt */
  2459. +// XRX200_PCE_PISR_VLAN, /* VLAN Violation Interrupt */
  2460. +// XRX200_PCE_PISR_WOL, /* Wake-on-LAN Interrupt */
  2461. +// XRX200_PCE_PISR_LOCK, /* Port Lock Alert Interrupt */
  2462. +// XRX200_PCE_PISR_LIMIT, /* Port Limitation Alert Interrupt */
  2463. +// XRX200_PCE_TCM_CTRL, /* Three-colorMarker Control Register */
  2464. +// XRX200_PCE_TCM_CTRL_TCMEN, /* Three-color Marker metering instance enable */
  2465. +// XRX200_PCE_TCM_STAT, /* Three-colorMarker Status Register */
  2466. +// XRX200_PCE_TCM_STAT_AL1, /* Three-color Marker Alert 1 Status */
  2467. +// XRX200_PCE_TCM_STAT_AL0, /* Three-color Marker Alert 0 Status */
  2468. +// XRX200_PCE_TCM_CBS, /* Three-color MarkerCommitted Burst Size Register */
  2469. +// XRX200_PCE_TCM_CBS_CBS, /* Committed Burst Size */
  2470. +// XRX200_PCE_TCM_EBS, /* Three-color MarkerExcess Burst Size Register */
  2471. +// XRX200_PCE_TCM_EBS_EBS, /* Excess Burst Size */
  2472. +// XRX200_PCE_TCM_IBS, /* Three-color MarkerInstantaneous Burst Size Register */
  2473. +// XRX200_PCE_TCM_IBS_IBS, /* Instantaneous Burst Size */
  2474. +// XRX200_PCE_TCM_CIR_MANT, /* Three-colorMarker Constant Information Rate Mantissa Register */
  2475. +// XRX200_PCE_TCM_CIR_MANT_MANT, /* Rate Counter Mantissa */
  2476. +// XRX200_PCE_TCM_CIR_EXP, /* Three-colorMarker Constant Information Rate Exponent Register */
  2477. +// XRX200_PCE_TCM_CIR_EXP_EXP, /* Rate Counter Exponent */
  2478. +// XRX200_MAC_TEST, /* MAC Test Register */
  2479. +// XRX200_MAC_TEST_JTP, /* Jitter Test Pattern */
  2480. +// XRX200_MAC_PFAD_CFG, /* MAC Pause FrameSource Address Configuration Register */
  2481. +// XRX200_MAC_PFAD_CFG_SAMOD, /* Source Address Mode */
  2482. +// XRX200_MAC_PFSA_0, /* Pause Frame SourceAddress Part 0 */
  2483. +// XRX200_MAC_PFSA_0_PFAD, /* Pause Frame Source Address Part 0 */
  2484. +// XRX200_MAC_PFSA_1, /* Pause Frame SourceAddress Part 1 */
  2485. +// XRX200_MAC_PFSA_1_PFAD, /* Pause Frame Source Address Part 1 */
  2486. +// XRX200_MAC_PFSA_2, /* Pause Frame SourceAddress Part 2 */
  2487. +// XRX200_MAC_PFSA_2_PFAD, /* Pause Frame Source Address Part 2 */
  2488. +// XRX200_MAC_FLEN, /* MAC Frame Length Register */
  2489. +// XRX200_MAC_FLEN_LEN, /* Maximum Frame Length */
  2490. +// XRX200_MAC_VLAN_ETYPE_0, /* MAC VLAN EthertypeRegister 0 */
  2491. +// XRX200_MAC_VLAN_ETYPE_0_OUTER, /* Ethertype */
  2492. +// XRX200_MAC_VLAN_ETYPE_1, /* MAC VLAN EthertypeRegister 1 */
  2493. +// XRX200_MAC_VLAN_ETYPE_1_INNER, /* Ethertype */
  2494. +// XRX200_MAC_IER, /* MAC Interrupt EnableRegister */
  2495. +// XRX200_MAC_IER_MACIEN, /* MAC Interrupt Enable */
  2496. +// XRX200_MAC_ISR, /* MAC Interrupt StatusRegister */
  2497. +// XRX200_MAC_ISR_MACINT, /* MAC Interrupt */
  2498. +// XRX200_MAC_PSTAT, /* MAC Port Status Register */
  2499. +// XRX200_MAC_PSTAT_PACT, /* PHY Active Status */
  2500. + XRX200_MAC_PSTAT_GBIT, /* Gigabit Speed Status */
  2501. + XRX200_MAC_PSTAT_MBIT, /* Megabit Speed Status */
  2502. + XRX200_MAC_PSTAT_FDUP, /* Full Duplex Status */
  2503. +// XRX200_MAC_PSTAT_RXPAU, /* Receive Pause Status */
  2504. +// XRX200_MAC_PSTAT_TXPAU, /* Transmit Pause Status */
  2505. +// XRX200_MAC_PSTAT_RXPAUEN, /* Receive Pause Enable Status */
  2506. +// XRX200_MAC_PSTAT_TXPAUEN, /* Transmit Pause Enable Status */
  2507. + XRX200_MAC_PSTAT_LSTAT, /* Link Status */
  2508. +// XRX200_MAC_PSTAT_CRS, /* Carrier Sense Status */
  2509. +// XRX200_MAC_PSTAT_TXLPI, /* Transmit Low-power Idle Status */
  2510. +// XRX200_MAC_PSTAT_RXLPI, /* Receive Low-power Idle Status */
  2511. +// XRX200_MAC_PISR, /* MAC Interrupt Status Register */
  2512. +// XRX200_MAC_PISR_PACT, /* PHY Active Status */
  2513. +// XRX200_MAC_PISR_SPEED, /* Megabit Speed Status */
  2514. +// XRX200_MAC_PISR_FDUP, /* Full Duplex Status */
  2515. +// XRX200_MAC_PISR_RXPAUEN, /* Receive Pause Enable Status */
  2516. +// XRX200_MAC_PISR_TXPAUEN, /* Transmit Pause Enable Status */
  2517. +// XRX200_MAC_PISR_LPIOFF, /* Receive Low-power Idle Mode is left */
  2518. +// XRX200_MAC_PISR_LPION, /* Receive Low-power Idle Mode is entered */
  2519. +// XRX200_MAC_PISR_JAM, /* Jam Status Detected */
  2520. +// XRX200_MAC_PISR_TOOSHORT, /* Too Short Frame Error Detected */
  2521. +// XRX200_MAC_PISR_TOOLONG, /* Too Long Frame Error Detected */
  2522. +// XRX200_MAC_PISR_LENERR, /* Length Mismatch Error Detected */
  2523. +// XRX200_MAC_PISR_FCSERR, /* Frame Checksum Error Detected */
  2524. +// XRX200_MAC_PISR_TXPAUSE, /* Pause Frame Transmitted */
  2525. +// XRX200_MAC_PISR_RXPAUSE, /* Pause Frame Received */
  2526. +// XRX200_MAC_PIER, /* MAC Interrupt Enable Register */
  2527. +// XRX200_MAC_PIER_PACT, /* PHY Active Status */
  2528. +// XRX200_MAC_PIER_SPEED, /* Megabit Speed Status */
  2529. +// XRX200_MAC_PIER_FDUP, /* Full Duplex Status */
  2530. +// XRX200_MAC_PIER_RXPAUEN, /* Receive Pause Enable Status */
  2531. +// XRX200_MAC_PIER_TXPAUEN, /* Transmit Pause Enable Status */
  2532. +// XRX200_MAC_PIER_LPIOFF, /* Low-power Idle Off Interrupt Mask */
  2533. +// XRX200_MAC_PIER_LPION, /* Low-power Idle On Interrupt Mask */
  2534. +// XRX200_MAC_PIER_JAM, /* Jam Status Interrupt Mask */
  2535. +// XRX200_MAC_PIER_TOOSHORT, /* Too Short Frame Error Interrupt Mask */
  2536. +// XRX200_MAC_PIER_TOOLONG, /* Too Long Frame Error Interrupt Mask */
  2537. +// XRX200_MAC_PIER_LENERR, /* Length Mismatch Error Interrupt Mask */
  2538. +// XRX200_MAC_PIER_FCSERR, /* Frame Checksum Error Interrupt Mask */
  2539. +// XRX200_MAC_PIER_TXPAUSE, /* Transmit Pause Frame Interrupt Mask */
  2540. +// XRX200_MAC_PIER_RXPAUSE, /* Receive Pause Frame Interrupt Mask */
  2541. +// XRX200_MAC_CTRL_0, /* MAC Control Register0 */
  2542. +// XRX200_MAC_CTRL_0_LCOL, /* Late Collision Control */
  2543. +// XRX200_MAC_CTRL_0_BM, /* Burst Mode Control */
  2544. +// XRX200_MAC_CTRL_0_APADEN, /* Automatic VLAN Padding Enable */
  2545. +// XRX200_MAC_CTRL_0_VPAD2EN, /* Stacked VLAN Padding Enable */
  2546. +// XRX200_MAC_CTRL_0_VPADEN, /* VLAN Padding Enable */
  2547. +// XRX200_MAC_CTRL_0_PADEN, /* Padding Enable */
  2548. +// XRX200_MAC_CTRL_0_FCS, /* Transmit FCS Control */
  2549. + XRX200_MAC_CTRL_0_FCON, /* Flow Control Mode */
  2550. +// XRX200_MAC_CTRL_0_FDUP, /* Full Duplex Control */
  2551. +// XRX200_MAC_CTRL_0_GMII, /* GMII/MII interface mode selection */
  2552. +// XRX200_MAC_CTRL_1, /* MAC Control Register1 */
  2553. +// XRX200_MAC_CTRL_1_SHORTPRE, /* Short Preamble Control */
  2554. +// XRX200_MAC_CTRL_1_IPG, /* Minimum Inter Packet Gap Size */
  2555. +// XRX200_MAC_CTRL_2, /* MAC Control Register2 */
  2556. +// XRX200_MAC_CTRL_2_MLEN, /* Maximum Untagged Frame Length */
  2557. +// XRX200_MAC_CTRL_2_LCHKL, /* Frame Length Check Long Enable */
  2558. +// XRX200_MAC_CTRL_2_LCHKS, /* Frame Length Check Short Enable */
  2559. +// XRX200_MAC_CTRL_3, /* MAC Control Register3 */
  2560. +// XRX200_MAC_CTRL_3_RCNT, /* Retry Count */
  2561. +// XRX200_MAC_CTRL_4, /* MAC Control Register4 */
  2562. +// XRX200_MAC_CTRL_4_LPIEN, /* LPI Mode Enable */
  2563. +// XRX200_MAC_CTRL_4_WAIT, /* LPI Wait Time */
  2564. +// XRX200_MAC_CTRL_5_PJPS, /* MAC Control Register5 */
  2565. +// XRX200_MAC_CTRL_5_PJPS_NOBP, /* Prolonged Jam pattern size during no-backpressure state */
  2566. +// XRX200_MAC_CTRL_5_PJPS_BP, /* Prolonged Jam pattern size during backpressure state */
  2567. +// XRX200_MAC_CTRL_6_XBUF, /* Transmit and ReceiveBuffer Control Register */
  2568. +// XRX200_MAC_CTRL_6_RBUF_DLY_WP, /* Delay */
  2569. +// XRX200_MAC_CTRL_6_RBUF_INIT, /* Receive Buffer Initialization */
  2570. +// XRX200_MAC_CTRL_6_RBUF_BYPASS, /* Bypass the Receive Buffer */
  2571. +// XRX200_MAC_CTRL_6_XBUF_DLY_WP, /* Delay */
  2572. +// XRX200_MAC_CTRL_6_XBUF_INIT, /* Initialize the Transmit Buffer */
  2573. +// XRX200_MAC_CTRL_6_XBUF_BYPASS, /* Bypass the Transmit Buffer */
  2574. +// XRX200_MAC_BUFST_XBUF, /* MAC Receive and TransmitBuffer Status Register */
  2575. +// XRX200_MAC_BUFST_RBUF_UFL, /* Receive Buffer Underflow Indicator */
  2576. +// XRX200_MAC_BUFST_RBUF_OFL, /* Receive Buffer Overflow Indicator */
  2577. +// XRX200_MAC_BUFST_XBUF_UFL, /* Transmit Buffer Underflow Indicator */
  2578. +// XRX200_MAC_BUFST_XBUF_OFL, /* Transmit Buffer Overflow Indicator */
  2579. +// XRX200_MAC_TESTEN, /* MAC Test Enable Register */
  2580. +// XRX200_MAC_TESTEN_JTEN, /* Jitter Test Enable */
  2581. +// XRX200_MAC_TESTEN_TXER, /* Transmit Error Insertion */
  2582. +// XRX200_MAC_TESTEN_LOOP, /* MAC Loopback Enable */
  2583. +// XRX200_FDMA_CTRL, /* Ethernet Switch FetchDMA Control Register */
  2584. +// XRX200_FDMA_CTRL_LPI_THRESHOLD, /* Low Power Idle Threshold */
  2585. +// XRX200_FDMA_CTRL_LPI_MODE, /* Low Power Idle Mode */
  2586. +// XRX200_FDMA_CTRL_EGSTAG, /* Egress Special Tag Size */
  2587. +// XRX200_FDMA_CTRL_IGSTAG, /* Ingress Special Tag Size */
  2588. +// XRX200_FDMA_CTRL_EXCOL, /* Excessive Collision Handling */
  2589. +// XRX200_FDMA_STETYPE, /* Special Tag EthertypeControl Register */
  2590. +// XRX200_FDMA_STETYPE_ETYPE, /* Special Tag Ethertype */
  2591. +// XRX200_FDMA_VTETYPE, /* VLAN Tag EthertypeControl Register */
  2592. +// XRX200_FDMA_VTETYPE_ETYPE, /* VLAN Tag Ethertype */
  2593. +// XRX200_FDMA_STAT_0, /* FDMA Status Register0 */
  2594. +// XRX200_FDMA_STAT_0_FSMS, /* FSM states status */
  2595. +// XRX200_FDMA_IER, /* Fetch DMA Global InterruptEnable Register */
  2596. +// XRX200_FDMA_IER_PCKD, /* Packet Drop Interrupt Enable */
  2597. +// XRX200_FDMA_IER_PCKR, /* Packet Ready Interrupt Enable */
  2598. +// XRX200_FDMA_IER_PCKT, /* Packet Sent Interrupt Enable */
  2599. +// XRX200_FDMA_ISR, /* Fetch DMA Global InterruptStatus Register */
  2600. +// XRX200_FDMA_ISR_PCKTD, /* Packet Drop */
  2601. +// XRX200_FDMA_ISR_PCKR, /* Packet is Ready for Transmission */
  2602. +// XRX200_FDMA_ISR_PCKT, /* Packet Sent Event */
  2603. +// XRX200_FDMA_PCTRL, /* Ethernet SwitchFetch DMA Port Control Register */
  2604. +// XRX200_FDMA_PCTRL_VLANMOD, /* VLAN Modification Enable */
  2605. +// XRX200_FDMA_PCTRL_DSCPRM, /* DSCP Re-marking Enable */
  2606. +// XRX200_FDMA_PCTRL_STEN, /* Special Tag Insertion Enable */
  2607. +// XRX200_FDMA_PCTRL_EN, /* FDMA Port Enable */
  2608. +// XRX200_FDMA_PRIO, /* Ethernet SwitchFetch DMA Port Priority Register */
  2609. +// XRX200_FDMA_PRIO_PRIO, /* FDMA PRIO */
  2610. +// XRX200_FDMA_PSTAT0, /* Ethernet SwitchFetch DMA Port Status Register 0 */
  2611. +// XRX200_FDMA_PSTAT0_PKT_AVAIL, /* Port Egress Packet Available */
  2612. +// XRX200_FDMA_PSTAT0_POK, /* Port Status OK */
  2613. +// XRX200_FDMA_PSTAT0_PSEG, /* Port Egress Segment Count */
  2614. +// XRX200_FDMA_PSTAT1_HDR, /* Ethernet SwitchFetch DMA Port Status Register 1 */
  2615. +// XRX200_FDMA_PSTAT1_HDR_PTR, /* Header Pointer */
  2616. +// XRX200_FDMA_TSTAMP0, /* Egress TimeStamp Register 0 */
  2617. +// XRX200_FDMA_TSTAMP0_TSTL, /* Time Stamp [15:0] */
  2618. +// XRX200_FDMA_TSTAMP1, /* Egress TimeStamp Register 1 */
  2619. +// XRX200_FDMA_TSTAMP1_TSTH, /* Time Stamp [31:16] */
  2620. +// XRX200_SDMA_CTRL, /* Ethernet Switch StoreDMA Control Register */
  2621. +// XRX200_SDMA_CTRL_TSTEN, /* Time Stamp Enable */
  2622. +// XRX200_SDMA_FCTHR1, /* SDMA Flow Control Threshold1 Register */
  2623. +// XRX200_SDMA_FCTHR1_THR1, /* Threshold 1 */
  2624. +// XRX200_SDMA_FCTHR2, /* SDMA Flow Control Threshold2 Register */
  2625. +// XRX200_SDMA_FCTHR2_THR2, /* Threshold 2 */
  2626. +// XRX200_SDMA_FCTHR3, /* SDMA Flow Control Threshold3 Register */
  2627. +// XRX200_SDMA_FCTHR3_THR3, /* Threshold 3 */
  2628. +// XRX200_SDMA_FCTHR4, /* SDMA Flow Control Threshold4 Register */
  2629. +// XRX200_SDMA_FCTHR4_THR4, /* Threshold 4 */
  2630. +// XRX200_SDMA_FCTHR5, /* SDMA Flow Control Threshold5 Register */
  2631. +// XRX200_SDMA_FCTHR5_THR5, /* Threshold 5 */
  2632. +// XRX200_SDMA_FCTHR6, /* SDMA Flow Control Threshold6 Register */
  2633. +// XRX200_SDMA_FCTHR6_THR6, /* Threshold 6 */
  2634. +// XRX200_SDMA_FCTHR7, /* SDMA Flow Control Threshold7 Register */
  2635. +// XRX200_SDMA_FCTHR7_THR7, /* Threshold 7 */
  2636. +// XRX200_SDMA_STAT_0, /* SDMA Status Register0 */
  2637. +// XRX200_SDMA_STAT_0_BPS_FILL, /* Back Pressure Status */
  2638. +// XRX200_SDMA_STAT_0_BPS_PNT, /* Back Pressure Status */
  2639. +// XRX200_SDMA_STAT_0_DROP, /* Back Pressure Status */
  2640. +// XRX200_SDMA_STAT_1, /* SDMA Status Register1 */
  2641. +// XRX200_SDMA_STAT_1_FILL, /* Buffer Filling Level */
  2642. +// XRX200_SDMA_STAT_2, /* SDMA Status Register2 */
  2643. +// XRX200_SDMA_STAT_2_FSMS, /* FSM states status */
  2644. +// XRX200_SDMA_IER, /* SDMA Interrupt Enable Register */
  2645. +// XRX200_SDMA_IER_BPEX, /* Buffer Pointers Exceeded */
  2646. +// XRX200_SDMA_IER_BFULL, /* Buffer Full */
  2647. +// XRX200_SDMA_IER_FERR, /* Frame Error */
  2648. +// XRX200_SDMA_IER_FRX, /* Frame Received Successfully */
  2649. +// XRX200_SDMA_ISR, /* SDMA Interrupt Status Register */
  2650. +// XRX200_SDMA_ISR_BPEX, /* Packet Descriptors Exceeded */
  2651. +// XRX200_SDMA_ISR_BFULL, /* Buffer Full */
  2652. +// XRX200_SDMA_ISR_FERR, /* Frame Error */
  2653. +// XRX200_SDMA_ISR_FRX, /* Frame Received Successfully */
  2654. +// XRX200_SDMA_PCTRL, /* Ethernet SwitchStore DMA Port Control Register */
  2655. +// XRX200_SDMA_PCTRL_DTHR, /* Drop Threshold Selection */
  2656. +// XRX200_SDMA_PCTRL_PTHR, /* Pause Threshold Selection */
  2657. +// XRX200_SDMA_PCTRL_PHYEFWD, /* Forward PHY Error Frames */
  2658. +// XRX200_SDMA_PCTRL_ALGFWD, /* Forward Alignment Error Frames */
  2659. +// XRX200_SDMA_PCTRL_LENFWD, /* Forward Length Errored Frames */
  2660. +// XRX200_SDMA_PCTRL_OSFWD, /* Forward Oversized Frames */
  2661. +// XRX200_SDMA_PCTRL_USFWD, /* Forward Undersized Frames */
  2662. +// XRX200_SDMA_PCTRL_FCSIGN, /* Ignore FCS Errors */
  2663. +// XRX200_SDMA_PCTRL_FCSFWD, /* Forward FCS Errored Frames */
  2664. +// XRX200_SDMA_PCTRL_PAUFWD, /* Pause Frame Forwarding */
  2665. +// XRX200_SDMA_PCTRL_MFCEN, /* Metering Flow Control Enable */
  2666. +// XRX200_SDMA_PCTRL_FCEN, /* Flow Control Enable */
  2667. +// XRX200_SDMA_PCTRL_PEN, /* Port Enable */
  2668. +// XRX200_SDMA_PRIO, /* Ethernet SwitchStore DMA Port Priority Register */
  2669. +// XRX200_SDMA_PRIO_PRIO, /* SDMA PRIO */
  2670. +// XRX200_SDMA_PSTAT0_HDR, /* Ethernet SwitchStore DMA Port Status Register 0 */
  2671. +// XRX200_SDMA_PSTAT0_HDR_PTR, /* Port Ingress Queue Header Pointer */
  2672. +// XRX200_SDMA_PSTAT1, /* Ethernet SwitchStore DMA Port Status Register 1 */
  2673. +// XRX200_SDMA_PSTAT1_PPKT, /* Port Ingress Packet Count */
  2674. +// XRX200_SDMA_TSTAMP0, /* Ingress TimeStamp Register 0 */
  2675. +// XRX200_SDMA_TSTAMP0_TSTL, /* Time Stamp [15:0] */
  2676. +// XRX200_SDMA_TSTAMP1, /* Ingress TimeStamp Register 1 */
  2677. +// XRX200_SDMA_TSTAMP1_TSTH, /* Time Stamp [31:16] */
  2678. +};
  2679. +
  2680. +
  2681. +struct xrx200sw_reg {
  2682. + int offset;
  2683. + int shift;
  2684. + int size;
  2685. + int mult;
  2686. +} xrx200sw_reg[] = {
  2687. +// offeset shift size mult
  2688. +// {0x0000, 0, 16, 0x00}, /* XRX200_ETHSW_SWRES Ethernet Switch ResetControl Register */
  2689. +// {0x0000, 1, 1, 0x00}, /* XRX200_ETHSW_SWRES_R1 Hardware Reset */
  2690. +// {0x0000, 0, 1, 0x00}, /* XRX200_ETHSW_SWRES_R0 Register Configuration */
  2691. +// {0x0004, 0, 16, 0x00}, /* XRX200_ETHSW_CLK_MAC_GAT Ethernet Switch Clock ControlRegister */
  2692. +// {0x0004, 12, 4, 0x00}, /* XRX200_ETHSW_CLK_EXP_SLEEP Exponent to put system into sleep */
  2693. +// {0x0004, 8, 4, 0x00}, /* XRX200_ETHSW_CLK_EXP_WAKE Exponent to wake up system */
  2694. +// {0x0004, 7, 1, 0x00}, /* XRX200_ETHSW_CLK_CLK2_EN CLK2 Input for MAC */
  2695. +// {0x0004, 6, 1, 0x00}, /* XRX200_ETHSW_CLK_EXT_DIV_EN External Clock Divider Enable */
  2696. +// {0x0004, 5, 1, 0x00}, /* XRX200_ETHSW_CLK_RAM_DBG_EN Clock Gating Enable */
  2697. +// {0x0004, 4, 1, 0x00}, /* XRX200_ETHSW_CLK_REG_GAT_EN Clock Gating Enable */
  2698. +// {0x0004, 3, 1, 0x00}, /* XRX200_ETHSW_CLK_GAT_EN Clock Gating Enable */
  2699. +// {0x0004, 2, 1, 0x00}, /* XRX200_ETHSW_CLK_MAC_GAT_EN Clock Gating Enable */
  2700. +// {0x0008, 0, 16, 0x00}, /* XRX200_ETHSW_DBG_STEP Ethernet Switch Debug ControlRegister */
  2701. +// {0x0008, 12, 4, 0x00}, /* XRX200_ETHSW_DBG_CLK_SEL Trigger Enable */
  2702. +// {0x0008, 11, 1, 0x00}, /* XRX200_ETHSW_DBG_MON_EN Monitoring Enable */
  2703. +// {0x0008, 9, 2, 0x00}, /* XRX200_ETHSW_DBG_TRIG_EN Trigger Enable */
  2704. +// {0x0008, 8, 1, 0x00}, /* XRX200_ETHSW_DBG_MODE Debug Mode */
  2705. +// {0x0008, 0, 8, 0x00}, /* XRX200_ETHSW_DBG_STEP_TIME Clock Step Size */
  2706. +// {0x000C, 0, 16, 0x00}, /* XRX200_ETHSW_SSB_MODE Ethernet Switch SharedSegment Buffer Mode Register */
  2707. +// {0x000C, 2, 4, 0x00}, /* XRX200_ETHSW_SSB_MODE_ADDE Memory Address */
  2708. +// {0x000C, 0, 2, 0x00}, /* XRX200_ETHSW_SSB_MODE_MODE Memory Access Mode */
  2709. +// {0x0010, 0, 16, 0x00}, /* XRX200_ETHSW_SSB_ADDR Ethernet Switch SharedSegment Buffer Address Register */
  2710. +// {0x0010, 0, 16, 0x00}, /* XRX200_ETHSW_SSB_ADDR_ADDE Memory Address */
  2711. +// {0x0014, 0, 16, 0x00}, /* XRX200_ETHSW_SSB_DATA Ethernet Switch SharedSegment Buffer Data Register */
  2712. +// {0x0014, 0, 16, 0x00}, /* XRX200_ETHSW_SSB_DATA_DATA Data Value */
  2713. +// {0x0018, 0, 16, 0x00}, /* XRX200_ETHSW_CAP_0 Ethernet Switch CapabilityRegister 0 */
  2714. +// {0x0018, 0, 16, 0x00}, /* XRX200_ETHSW_CAP_0_SPEED Clock frequency */
  2715. +// {0x001C, 0, 16, 0x00}, /* XRX200_ETHSW_CAP_1 Ethernet Switch CapabilityRegister 1 */
  2716. +// {0x001C, 15, 1, 0x00}, /* XRX200_ETHSW_CAP_1_GMAC MAC operation mode */
  2717. +// {0x001C, 8, 7, 0x00}, /* XRX200_ETHSW_CAP_1_QUEUE Number of queues */
  2718. +// {0x001C, 4, 4, 0x00}, /* XRX200_ETHSW_CAP_1_VPORTS Number of virtual ports */
  2719. +// {0x001C, 0, 4, 0x00}, /* XRX200_ETHSW_CAP_1_PPORTS Number of physical ports */
  2720. +// {0x0020, 0, 16, 0x00}, /* XRX200_ETHSW_CAP_2 Ethernet Switch CapabilityRegister 2 */
  2721. +// {0x0020, 0, 11, 0x00}, /* XRX200_ETHSW_CAP_2_PACKETS Number of packets */
  2722. +// {0x0024, 0, 16, 0x00}, /* XRX200_ETHSW_CAP_3 Ethernet Switch CapabilityRegister 3 */
  2723. +// {0x0024, 8, 8, 0x00}, /* XRX200_ETHSW_CAP_3_METERS Number of traffic meters */
  2724. +// {0x0024, 0, 8, 0x00}, /* XRX200_ETHSW_CAP_3_SHAPERS Number of traffic shapers */
  2725. +// {0x0028, 0, 16, 0x00}, /* XRX200_ETHSW_CAP_4 Ethernet Switch CapabilityRegister 4 */
  2726. +// {0x0028, 8, 8, 0x00}, /* XRX200_ETHSW_CAP_4_PPPOE PPPoE table size */
  2727. +// {0x0028, 0, 8, 0x00}, /* XRX200_ETHSW_CAP_4_VLAN Active VLAN table size */
  2728. +// {0x002C, 0, 16, 0x00}, /* XRX200_ETHSW_CAP_5 Ethernet Switch CapabilityRegister 5 */
  2729. +// {0x002C, 8, 8, 0x00}, /* XRX200_ETHSW_CAP_5_IPPLEN IP packet length table size */
  2730. +// {0x002C, 0, 8, 0x00}, /* XRX200_ETHSW_CAP_5_PROT Protocol table size */
  2731. +// {0x0030, 0, 16, 0x00}, /* XRX200_ETHSW_CAP_6 Ethernet Switch CapabilityRegister 6 */
  2732. +// {0x0030, 8, 8, 0x00}, /* XRX200_ETHSW_CAP_6_MACDASA MAC DA/SA table size */
  2733. +// {0x0030, 0, 8, 0x00}, /* XRX200_ETHSW_CAP_6_APPL Application table size */
  2734. +// {0x0034, 0, 16, 0x00}, /* XRX200_ETHSW_CAP_7 Ethernet Switch CapabilityRegister 7 */
  2735. +// {0x0034, 8, 8, 0x00}, /* XRX200_ETHSW_CAP_7_IPDASAM IP DA/SA MSB table size */
  2736. +// {0x0034, 0, 8, 0x00}, /* XRX200_ETHSW_CAP_7_IPDASAL IP DA/SA LSB table size */
  2737. +// {0x0038, 0, 16, 0x00}, /* XRX200_ETHSW_CAP_8 Ethernet Switch CapabilityRegister 8 */
  2738. +// {0x0038, 0, 8, 0x00}, /* XRX200_ETHSW_CAP_8_MCAST Multicast table size */
  2739. +// {0x003C, 0, 16, 0x00}, /* XRX200_ETHSW_CAP_9 Ethernet Switch CapabilityRegister 9 */
  2740. +// {0x003C, 0, 8, 0x00}, /* XRX200_ETHSW_CAP_9_FLAGG Flow Aggregation table size */
  2741. +// {0x0040, 0, 16, 0x00}, /* XRX200_ETHSW_CAP_10 Ethernet Switch CapabilityRegister 10 */
  2742. +// {0x0040, 0, 13, 0x00}, /* XRX200_ETHSW_CAP_10_MACBT MAC bridging table size */
  2743. +// {0x0044, 0, 16, 0x00}, /* XRX200_ETHSW_CAP_11 Ethernet Switch CapabilityRegister 11 */
  2744. +// {0x0044, 0, 16, 0x00}, /* XRX200_ETHSW_CAP_11_BSIZEL Packet buffer size (lower part, in byte) */
  2745. +// {0x0048, 0, 16, 0x00}, /* XRX200_ETHSW_CAP_12 Ethernet Switch CapabilityRegister 12 */
  2746. +// {0x0048, 0, 3, 0x00}, /* XRX200_ETHSW_CAP_12_BSIZEH Packet buffer size (higher part, in byte) */
  2747. +// {0x004C, 0, 16, 0x00}, /* XRX200_ETHSW_VERSION_REV Ethernet Switch VersionRegister */
  2748. +// {0x004C, 8, 8, 0x00}, /* XRX200_ETHSW_VERSION_MOD_ID Module Identification */
  2749. +// {0x004C, 0, 8, 0x00}, /* XRX200_ETHSW_VERSION_REV_ID Hardware Revision Identification */
  2750. +// {0x0050, 0, 16, 0x00}, /* XRX200_ETHSW_IER Interrupt Enable Register */
  2751. +// {0x0050, 4, 1, 0x00}, /* XRX200_ETHSW_IER_FDMAIE Fetch DMA Interrupt Enable */
  2752. +// {0x0050, 3, 1, 0x00}, /* XRX200_ETHSW_IER_SDMAIE Store DMA Interrupt Enable */
  2753. +// {0x0050, 2, 1, 0x00}, /* XRX200_ETHSW_IER_MACIE Ethernet MAC Interrupt Enable */
  2754. +// {0x0050, 1, 1, 0x00}, /* XRX200_ETHSW_IER_PCEIE Parser and Classification Engine Interrupt Enable */
  2755. +// {0x0050, 0, 1, 0x00}, /* XRX200_ETHSW_IER_BMIE Buffer Manager Interrupt Enable */
  2756. +// {0x0054, 0, 16, 0x00}, /* XRX200_ETHSW_ISR Interrupt Status Register */
  2757. +// {0x0054, 4, 1, 0x00}, /* XRX200_ETHSW_ISR_FDMAINT Fetch DMA Interrupt */
  2758. +// {0x0054, 3, 1, 0x00}, /* XRX200_ETHSW_ISR_SDMAINT Store DMA Interrupt */
  2759. +// {0x0054, 2, 1, 0x00}, /* XRX200_ETHSW_ISR_MACINT Ethernet MAC Interrupt */
  2760. +// {0x0054, 1, 1, 0x00}, /* XRX200_ETHSW_ISR_PCEINT Parser and Classification Engine Interrupt */
  2761. +// {0x0054, 0, 1, 0x00}, /* XRX200_ETHSW_ISR_BMINT Buffer Manager Interrupt */
  2762. +// {0x0058, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_0 Ethernet Switch SpareCells 0 */
  2763. +// {0x0058, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_0_SPARE SPARE0 */
  2764. +// {0x005C, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_1 Ethernet Switch SpareCells 1 */
  2765. +// {0x005C, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_1_SPARE SPARE1 */
  2766. +// {0x0060, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_2 Ethernet Switch SpareCells 2 */
  2767. +// {0x0060, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_2_SPARE SPARE2 */
  2768. +// {0x0064, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_3 Ethernet Switch SpareCells 3 */
  2769. +// {0x0064, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_3_SPARE SPARE3 */
  2770. +// {0x0068, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_4 Ethernet Switch SpareCells 4 */
  2771. +// {0x0068, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_4_SPARE SPARE4 */
  2772. +// {0x006C, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_5 Ethernet Switch SpareCells 5 */
  2773. +// {0x006C, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_5_SPARE SPARE5 */
  2774. +// {0x0070, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_6 Ethernet Switch SpareCells 6 */
  2775. +// {0x0070, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_6_SPARE SPARE6 */
  2776. +// {0x0074, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_7 Ethernet Switch SpareCells 7 */
  2777. +// {0x0074, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_7_SPARE SPARE7 */
  2778. +// {0x0078, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_8 Ethernet Switch SpareCells 8 */
  2779. +// {0x0078, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_8_SPARE SPARE8 */
  2780. +// {0x007C, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_9 Ethernet Switch SpareCells 9 */
  2781. +// {0x007C, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_9_SPARE SPARE9 */
  2782. +// {0x0080, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_10 Ethernet Switch SpareCells 10 */
  2783. +// {0x0080, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_10_SPARE SPARE10 */
  2784. +// {0x0084, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_11 Ethernet Switch SpareCells 11 */
  2785. +// {0x0084, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_11_SPARE SPARE11 */
  2786. +// {0x0088, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_12 Ethernet Switch SpareCells 12 */
  2787. +// {0x0088, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_12_SPARE SPARE12 */
  2788. +// {0x008C, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_13 Ethernet Switch SpareCells 13 */
  2789. +// {0x008C, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_13_SPARE SPARE13 */
  2790. +// {0x0090, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_14 Ethernet Switch SpareCells 14 */
  2791. +// {0x0090, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_14_SPARE SPARE14 */
  2792. +// {0x0094, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_15 Ethernet Switch SpareCells 15 */
  2793. +// {0x0094, 0, 16, 0x00}, /* XRX200_ETHSW_SPARE_15_SPARE SPARE15 */
  2794. +// {0x0100, 0, 16, 0x00}, /* XRX200_BM_RAM_VAL_3 RAM Value Register 3 */
  2795. +// {0x0100, 0, 16, 0x00}, /* XRX200_BM_RAM_VAL_3_VAL3 Data value [15:0] */
  2796. +// {0x0104, 0, 16, 0x00}, /* XRX200_BM_RAM_VAL_2 RAM Value Register 2 */
  2797. +// {0x0104, 0, 16, 0x00}, /* XRX200_BM_RAM_VAL_2_VAL2 Data value [15:0] */
  2798. +// {0x0108, 0, 16, 0x00}, /* XRX200_BM_RAM_VAL_1 RAM Value Register 1 */
  2799. +// {0x0108, 0, 16, 0x00}, /* XRX200_BM_RAM_VAL_1_VAL1 Data value [15:0] */
  2800. +// {0x010C, 0, 16, 0x00}, /* XRX200_BM_RAM_VAL_0 RAM Value Register 0 */
  2801. +// {0x010C, 0, 16, 0x00}, /* XRX200_BM_RAM_VAL_0_VAL0 Data value [15:0] */
  2802. +// {0x0110, 0, 16, 0x00}, /* XRX200_BM_RAM_ADDR RAM Address Register */
  2803. +// {0x0110, 0, 11, 0x00}, /* XRX200_BM_RAM_ADDR_ADDR RAM Address */
  2804. +// {0x0114, 0, 16, 0x00}, /* XRX200_BM_RAM_CTRL RAM Access Control Register */
  2805. +// {0x0114, 15, 1, 0x00}, /* XRX200_BM_RAM_CTRL_BAS Access Busy/Access Start */
  2806. +// {0x0114, 5, 1, 0x00}, /* XRX200_BM_RAM_CTRL_OPMOD Lookup Table Access Operation Mode */
  2807. +// {0x0114, 0, 5, 0x00}, /* XRX200_BM_RAM_CTRL_ADDR Address for RAM selection */
  2808. +// {0x0118, 0, 16, 0x00}, /* XRX200_BM_FSQM_GCTRL Free Segment Queue ManagerGlobal Control Register */
  2809. +// {0x0118, 0, 10, 0x00}, /* XRX200_BM_FSQM_GCTRL_SEGNUM Maximum Segment Number */
  2810. +// {0x011C, 0, 16, 0x00}, /* XRX200_BM_CONS_SEG Number of Consumed SegmentsRegister */
  2811. +// {0x011C, 0, 10, 0x00}, /* XRX200_BM_CONS_SEG_FSEG Number of Consumed Segments */
  2812. +// {0x0120, 0, 16, 0x00}, /* XRX200_BM_CONS_PKT Number of Consumed PacketPointers Register */
  2813. +// {0x0120, 0, 11, 0x00}, /* XRX200_BM_CONS_PKT_FQP Number of Consumed Packet Pointers */
  2814. +// {0x0124, 0, 16, 0x00}, /* XRX200_BM_GCTRL_F Buffer Manager Global ControlRegister 0 */
  2815. +// {0x0124, 13, 1, 0x00}, /* XRX200_BM_GCTRL_BM_STA Buffer Manager Initialization Status Bit */
  2816. +// {0x0124, 12, 1, 0x00}, /* XRX200_BM_GCTRL_SAT RMON Counter Update Mode */
  2817. +// {0x0124, 11, 1, 0x00}, /* XRX200_BM_GCTRL_FR_RBC Freeze RMON RX Bad Byte 64 Bit Counter */
  2818. +// {0x0124, 10, 1, 0x00}, /* XRX200_BM_GCTRL_FR_RGC Freeze RMON RX Good Byte 64 Bit Counter */
  2819. +// {0x0124, 9, 1, 0x00}, /* XRX200_BM_GCTRL_FR_TGC Freeze RMON TX Good Byte 64 Bit Counter */
  2820. +// {0x0124, 8, 1, 0x00}, /* XRX200_BM_GCTRL_I_FIN RAM initialization finished */
  2821. +// {0x0124, 7, 1, 0x00}, /* XRX200_BM_GCTRL_CX_INI PQM Context RAM initialization */
  2822. +// {0x0124, 6, 1, 0x00}, /* XRX200_BM_GCTRL_FP_INI FPQM RAM initialization */
  2823. +// {0x0124, 5, 1, 0x00}, /* XRX200_BM_GCTRL_FS_INI FSQM RAM initialization */
  2824. +// {0x0124, 4, 1, 0x00}, /* XRX200_BM_GCTRL_R_SRES Software Reset for RMON */
  2825. +// {0x0124, 3, 1, 0x00}, /* XRX200_BM_GCTRL_S_SRES Software Reset for Scheduler */
  2826. +// {0x0124, 2, 1, 0x00}, /* XRX200_BM_GCTRL_A_SRES Software Reset for AVG */
  2827. +// {0x0124, 1, 1, 0x00}, /* XRX200_BM_GCTRL_P_SRES Software Reset for PQM */
  2828. +// {0x0124, 0, 1, 0x00}, /* XRX200_BM_GCTRL_F_SRES Software Reset for FSQM */
  2829. +// {0x0128, 0, 16, 0x00}, /* XRX200_BM_QUEUE_GCTRL Queue Manager GlobalControl Register 0 */
  2830. +// {0x0128, 10, 1, 0x00}, /* XRX200_BM_QUEUE_GCTRL_GL_MOD WRED Mode Signal */
  2831. +// {0x0128, 7, 3, 0x00}, /* XRX200_BM_QUEUE_GCTRL_AQUI Average Queue Update Interval */
  2832. +// {0x0128, 3, 4, 0x00}, /* XRX200_BM_QUEUE_GCTRL_AQWF Average Queue Weight Factor */
  2833. +// {0x0128, 2, 1, 0x00}, /* XRX200_BM_QUEUE_GCTRL_QAVGEN Queue Average Calculation Enable */
  2834. +// {0x0128, 0, 2, 0x00}, /* XRX200_BM_QUEUE_GCTRL_DPROB Drop Probability Profile */
  2835. +// {0x012C, 0, 16, 0x00}, /* XRX200_BM_WRED_RTH_0 WRED Red Threshold Register0 */
  2836. +// {0x012C, 0, 10, 0x00}, /* XRX200_BM_WRED_RTH_0_MINTH Minimum Threshold */
  2837. +// {0x0130, 0, 16, 0x00}, /* XRX200_BM_WRED_RTH_1 WRED Red Threshold Register1 */
  2838. +// {0x0130, 0, 10, 0x00}, /* XRX200_BM_WRED_RTH_1_MAXTH Maximum Threshold */
  2839. +// {0x0134, 0, 16, 0x00}, /* XRX200_BM_WRED_YTH_0 WRED Yellow ThresholdRegister 0 */
  2840. +// {0x0134, 0, 10, 0x00}, /* XRX200_BM_WRED_YTH_0_MINTH Minimum Threshold */
  2841. +// {0x0138, 0, 16, 0x00}, /* XRX200_BM_WRED_YTH_1 WRED Yellow ThresholdRegister 1 */
  2842. +// {0x0138, 0, 10, 0x00}, /* XRX200_BM_WRED_YTH_1_MAXTH Maximum Threshold */
  2843. +// {0x013C, 0, 16, 0x00}, /* XRX200_BM_WRED_GTH_0 WRED Green ThresholdRegister 0 */
  2844. +// {0x013C, 0, 10, 0x00}, /* XRX200_BM_WRED_GTH_0_MINTH Minimum Threshold */
  2845. +// {0x0140, 0, 16, 0x00}, /* XRX200_BM_WRED_GTH_1 WRED Green ThresholdRegister 1 */
  2846. +// {0x0140, 0, 10, 0x00}, /* XRX200_BM_WRED_GTH_1_MAXTH Maximum Threshold */
  2847. +// {0x0144, 0, 16, 0x00}, /* XRX200_BM_DROP_GTH_0_THR Drop Threshold ConfigurationRegister 0 */
  2848. +// {0x0144, 0, 11, 0x00}, /* XRX200_BM_DROP_GTH_0_THR_FQ Threshold for frames marked red */
  2849. +// {0x0148, 0, 16, 0x00}, /* XRX200_BM_DROP_GTH_1_THY Drop Threshold ConfigurationRegister 1 */
  2850. +// {0x0148, 0, 11, 0x00}, /* XRX200_BM_DROP_GTH_1_THY_FQ Threshold for frames marked yellow */
  2851. +// {0x014C, 0, 16, 0x00}, /* XRX200_BM_DROP_GTH_2_THG Drop Threshold ConfigurationRegister 2 */
  2852. +// {0x014C, 0, 11, 0x00}, /* XRX200_BM_DROP_GTH_2_THG_FQ Threshold for frames marked green */
  2853. +// {0x0150, 0, 16, 0x00}, /* XRX200_BM_IER Buffer Manager Global InterruptEnable Register */
  2854. +// {0x0150, 7, 1, 0x00}, /* XRX200_BM_IER_CNT4 Counter Group 4 (RMON-CLASSIFICATION) Interrupt Enable */
  2855. +// {0x0150, 6, 1, 0x00}, /* XRX200_BM_IER_CNT3 Counter Group 3 (RMON-PQM) Interrupt Enable */
  2856. +// {0x0150, 5, 1, 0x00}, /* XRX200_BM_IER_CNT2 Counter Group 2 (RMON-SCHEDULER) Interrupt Enable */
  2857. +// {0x0150, 4, 1, 0x00}, /* XRX200_BM_IER_CNT1 Counter Group 1 (RMON-QFETCH) Interrupt Enable */
  2858. +// {0x0150, 3, 1, 0x00}, /* XRX200_BM_IER_CNT0 Counter Group 0 (RMON-QSTOR) Interrupt Enable */
  2859. +// {0x0150, 2, 1, 0x00}, /* XRX200_BM_IER_DEQ PQM dequeue Interrupt Enable */
  2860. +// {0x0150, 1, 1, 0x00}, /* XRX200_BM_IER_ENQ PQM Enqueue Interrupt Enable */
  2861. +// {0x0150, 0, 1, 0x00}, /* XRX200_BM_IER_FSQM Buffer Empty Interrupt Enable */
  2862. +// {0x0154, 0, 16, 0x00}, /* XRX200_BM_ISR Buffer Manager Global InterruptStatus Register */
  2863. +// {0x0154, 7, 1, 0x00}, /* XRX200_BM_ISR_CNT4 Counter Group 4 Interrupt */
  2864. +// {0x0154, 6, 1, 0x00}, /* XRX200_BM_ISR_CNT3 Counter Group 3 Interrupt */
  2865. +// {0x0154, 5, 1, 0x00}, /* XRX200_BM_ISR_CNT2 Counter Group 2 Interrupt */
  2866. +// {0x0154, 4, 1, 0x00}, /* XRX200_BM_ISR_CNT1 Counter Group 1 Interrupt */
  2867. +// {0x0154, 3, 1, 0x00}, /* XRX200_BM_ISR_CNT0 Counter Group 0 Interrupt */
  2868. +// {0x0154, 2, 1, 0x00}, /* XRX200_BM_ISR_DEQ PQM dequeue Interrupt Enable */
  2869. +// {0x0154, 1, 1, 0x00}, /* XRX200_BM_ISR_ENQ PQM Enqueue Interrupt */
  2870. +// {0x0154, 0, 1, 0x00}, /* XRX200_BM_ISR_FSQM Buffer Empty Interrupt */
  2871. +// {0x0158, 0, 16, 0x00}, /* XRX200_BM_CISEL Buffer Manager RMON CounterInterrupt Select Register */
  2872. +// {0x0158, 0, 3, 0x00}, /* XRX200_BM_CISEL_PORT Port Number */
  2873. +// {0x015C, 0, 16, 0x00}, /* XRX200_BM_DEBUG_CTRL_DBG Debug Control Register */
  2874. +// {0x015C, 0, 8, 0x00}, /* XRX200_BM_DEBUG_CTRL_DBG_SEL Select Signal for Debug Multiplexer */
  2875. +// {0x0160, 0, 16, 0x00}, /* XRX200_BM_DEBUG_VAL_DBG Debug Value Register */
  2876. +// {0x0160, 0, 16, 0x00}, /* XRX200_BM_DEBUG_VAL_DBG_DAT Debug Data Value */
  2877. +// {0x0200, 0, 16, 0x08}, /* XRX200_BM_PCFG Buffer Manager PortConfiguration Register */
  2878. +// {0x0200, 0, 1, 0x08}, /* XRX200_BM_PCFG_CNTEN RMON Counter Enable */
  2879. +// {0x0204, 0, 16, 0x08}, /* XRX200_BM_RMON_CTRL_RAM1 Buffer ManagerRMON Control Register */
  2880. +// {0x0204, 1, 1, 0x08}, /* XRX200_BM_RMON_CTRL_RAM2_RES Software Reset for RMON RAM2 */
  2881. +// {0x0204, 0, 1, 0x08}, /* XRX200_BM_RMON_CTRL_RAM1_RES Software Reset for RMON RAM1 */
  2882. +// {0x0400, 0, 16, 0x08}, /* XRX200_PQM_DP Packet Queue ManagerDrop Probability Register */
  2883. +// {0x0400, 0, 2, 0x08}, /* XRX200_PQM_DP_DPROB Drop Probability Profile */
  2884. +// {0x0404, 0, 16, 0x08}, /* XRX200_PQM_RS Packet Queue ManagerRate Shaper Assignment Register */
  2885. +// {0x0404, 15, 1, 0x08}, /* XRX200_PQM_RS_EN2 Rate Shaper 2 Enable */
  2886. +// {0x0404, 8, 6, 0x08}, /* XRX200_PQM_RS_RS2 Rate Shaper 2 */
  2887. +// {0x0404, 7, 1, 0x08}, /* XRX200_PQM_RS_EN1 Rate Shaper 1 Enable */
  2888. +// {0x0404, 0, 6, 0x08}, /* XRX200_PQM_RS_RS1 Rate Shaper 1 */
  2889. +// {0x0500, 0, 16, 0x14}, /* XRX200_RS_CTRL Rate Shaper ControlRegister */
  2890. +// {0x0500, 0, 1, 0x14}, /* XRX200_RS_CTRL_RSEN Rate Shaper Enable */
  2891. +// {0x0504, 0, 16, 0x14}, /* XRX200_RS_CBS Rate Shaper CommittedBurst Size Register */
  2892. +// {0x0504, 0, 10, 0x14}, /* XRX200_RS_CBS_CBS Committed Burst Size */
  2893. +// {0x0508, 0, 16, 0x14}, /* XRX200_RS_IBS Rate Shaper InstantaneousBurst Size Register */
  2894. +// {0x0508, 0, 2, 0x14}, /* XRX200_RS_IBS_IBS Instantaneous Burst Size */
  2895. +// {0x050C, 0, 16, 0x14}, /* XRX200_RS_CIR_EXP Rate Shaper RateExponent Register */
  2896. +// {0x050C, 0, 4, 0x14}, /* XRX200_RS_CIR_EXP_EXP Exponent */
  2897. +// {0x0510, 0, 16, 0x14}, /* XRX200_RS_CIR_MANT Rate Shaper RateMantissa Register */
  2898. +// {0x0510, 0, 10, 0x14}, /* XRX200_RS_CIR_MANT_MANT Mantissa */
  2899. + {0x1100, 0, 16, 0x00}, /* XRX200_PCE_TBL_KEY_7 Table Key Data 7 */
  2900. +// {0x1100, 0, 16, 0x00}, /* XRX200_PCE_TBL_KEY_7_KEY7 Key Value[15:0] */
  2901. + {0x1104, 0, 16, 0x00}, /* XRX200_PCE_TBL_KEY_6 Table Key Data 6 */
  2902. +// {0x1104, 0, 16, 0x00}, /* XRX200_PCE_TBL_KEY_6_KEY6 Key Value[15:0] */
  2903. + {0x1108, 0, 16, 0x00}, /* XRX200_PCE_TBL_KEY_5 Table Key Data 5 */
  2904. +// {0x1108, 0, 16, 0x00}, /* XRX200_PCE_TBL_KEY_5_KEY5 Key Value[15:0] */
  2905. + {0x110C, 0, 16, 0x00}, /* XRX200_PCE_TBL_KEY_4 Table Key Data 4 */
  2906. +// {0x110C, 0, 16, 0x00}, /* XRX200_PCE_TBL_KEY_4_KEY4 Key Value[15:0] */
  2907. + {0x1110, 0, 16, 0x00}, /* XRX200_PCE_TBL_KEY_3 Table Key Data 3 */
  2908. +// {0x1110, 0, 16, 0x00}, /* XRX200_PCE_TBL_KEY_3_KEY3 Key Value[15:0] */
  2909. + {0x1114, 0, 16, 0x00}, /* XRX200_PCE_TBL_KEY_2 Table Key Data 2 */
  2910. +// {0x1114, 0, 16, 0x00}, /* XRX200_PCE_TBL_KEY_2_KEY2 Key Value[15:0] */
  2911. + {0x1118, 0, 16, 0x00}, /* XRX200_PCE_TBL_KEY_1 Table Key Data 1 */
  2912. +// {0x1118, 0, 16, 0x00}, /* XRX200_PCE_TBL_KEY_1_KEY1 Key Value[31:16] */
  2913. + {0x111C, 0, 16, 0x00}, /* XRX200_PCE_TBL_KEY_0 Table Key Data 0 */
  2914. +// {0x111C, 0, 16, 0x00}, /* XRX200_PCE_TBL_KEY_0_KEY0 Key Value[15:0] */
  2915. + {0x1120, 0, 16, 0x00}, /* XRX200_PCE_TBL_MASK_0 Table Mask Write Register0 */
  2916. +// {0x1120, 0, 16, 0x00}, /* XRX200_PCE_TBL_MASK_0_MASK0 Mask Pattern [15:0] */
  2917. + {0x1124, 0, 16, 0x00}, /* XRX200_PCE_TBL_VAL_4 Table Value Register4 */
  2918. +// {0x1124, 0, 16, 0x00}, /* XRX200_PCE_TBL_VAL_4_VAL4 Data value [15:0] */
  2919. + {0x1128, 0, 16, 0x00}, /* XRX200_PCE_TBL_VAL_3 Table Value Register3 */
  2920. +// {0x1128, 0, 16, 0x00}, /* XRX200_PCE_TBL_VAL_3_VAL3 Data value [15:0] */
  2921. + {0x112C, 0, 16, 0x00}, /* XRX200_PCE_TBL_VAL_2 Table Value Register2 */
  2922. +// {0x112C, 0, 16, 0x00}, /* XRX200_PCE_TBL_VAL_2_VAL2 Data value [15:0] */
  2923. + {0x1130, 0, 16, 0x00}, /* XRX200_PCE_TBL_VAL_1 Table Value Register1 */
  2924. +// {0x1130, 0, 16, 0x00}, /* XRX200_PCE_TBL_VAL_1_VAL1 Data value [15:0] */
  2925. + {0x1134, 0, 16, 0x00}, /* XRX200_PCE_TBL_VAL_0 Table Value Register0 */
  2926. +// {0x1134, 0, 16, 0x00}, /* XRX200_PCE_TBL_VAL_0_VAL0 Data value [15:0] */
  2927. +// {0x1138, 0, 16, 0x00}, /* XRX200_PCE_TBL_ADDR Table Entry AddressRegister */
  2928. + {0x1138, 0, 11, 0x00}, /* XRX200_PCE_TBL_ADDR_ADDR Table Address */
  2929. +// {0x113C, 0, 16, 0x00}, /* XRX200_PCE_TBL_CTRL Table Access ControlRegister */
  2930. + {0x113C, 15, 1, 0x00}, /* XRX200_PCE_TBL_CTRL_BAS Access Busy/Access Start */
  2931. + {0x113C, 13, 1, 0x00}, /* XRX200_PCE_TBL_CTRL_TYPE Lookup Entry Type */
  2932. + {0x113C, 12, 1, 0x00}, /* XRX200_PCE_TBL_CTRL_VLD Lookup Entry Valid */
  2933. + {0x113C, 7, 4, 0x00}, /* XRX200_PCE_TBL_CTRL_GMAP Group Map */
  2934. + {0x113C, 5, 2, 0x00}, /* XRX200_PCE_TBL_CTRL_OPMOD Lookup Table Access Operation Mode */
  2935. + {0x113C, 0, 5, 0x00}, /* XRX200_PCE_TBL_CTRL_ADDR Lookup Table Address */
  2936. +// {0x1140, 0, 16, 0x00}, /* XRX200_PCE_TBL_STAT Table General StatusRegister */
  2937. +// {0x1140, 2, 1, 0x00}, /* XRX200_PCE_TBL_STAT_TBUSY Table Access Busy */
  2938. +// {0x1140, 1, 1, 0x00}, /* XRX200_PCE_TBL_STAT_TEMPT Table Empty */
  2939. +// {0x1140, 0, 1, 0x00}, /* XRX200_PCE_TBL_STAT_TFUL Table Full */
  2940. +// {0x1144, 0, 16, 0x00}, /* XRX200_PCE_AGE_0 Aging Counter ConfigurationRegister 0 */
  2941. +// {0x1144, 0, 4, 0x00}, /* XRX200_PCE_AGE_0_EXP Aging Counter Exponent Value */
  2942. +// {0x1148, 0, 16, 0x00}, /* XRX200_PCE_AGE_1 Aging Counter ConfigurationRegister 1 */
  2943. +// {0x1148, 0, 16, 0x00}, /* XRX200_PCE_AGE_1_MANT Aging Counter Mantissa Value */
  2944. +// {0x114C, 0, 16, 0x00}, /* XRX200_PCE_PMAP_1 Port Map Register 1 */
  2945. +// {0x114C, 0, 16, 0x00}, /* XRX200_PCE_PMAP_1_MPMAP Monitoring Port Map */
  2946. +// {0x1150, 0, 16, 0x00}, /* XRX200_PCE_PMAP_2 Port Map Register 2 */
  2947. +// {0x1150, 0, 16, 0x00}, /* XRX200_PCE_PMAP_2_DMCPMAP Default Multicast Port Map */
  2948. +// {0x1154, 0, 16, 0x00}, /* XRX200_PCE_PMAP_3 Port Map Register 3 */
  2949. +// {0x1154, 0, 16, 0x00}, /* XRX200_PCE_PMAP_3_UUCMAP Default Unknown Unicast Port Map */
  2950. +// {0x1158, 0, 16, 0x00}, /* XRX200_PCE_GCTRL_0 PCE Global Control Register0 */
  2951. +// {0x1158, 15, 1, 0x00}, /* XRX200_PCE_GCTRL_0_IGMP IGMP Mode Selection */
  2952. + {0x1158, 14, 1, 0x00}, /* XRX200_PCE_GCTRL_0_VLAN VLAN-aware Switching */
  2953. +// {0x1158, 13, 1, 0x00}, /* XRX200_PCE_GCTRL_0_NOPM No Port Map Forwarding */
  2954. +// {0x1158, 12, 1, 0x00}, /* XRX200_PCE_GCTRL_0_SCONUC Unknown Unicast Storm Control */
  2955. +// {0x1158, 11, 1, 0x00}, /* XRX200_PCE_GCTRL_0_SCONMC Multicast Storm Control */
  2956. +// {0x1158, 10, 1, 0x00}, /* XRX200_PCE_GCTRL_0_SCONBC Broadcast Storm Control */
  2957. +// {0x1158, 8, 2, 0x00}, /* XRX200_PCE_GCTRL_0_SCONMOD Storm Control Mode */
  2958. +// {0x1158, 4, 4, 0x00}, /* XRX200_PCE_GCTRL_0_SCONMET Storm Control Metering Instance */
  2959. +// {0x1158, 3, 1, 0x00}, /* XRX200_PCE_GCTRL_0_MC_VALID Access Request */
  2960. +// {0x1158, 2, 1, 0x00}, /* XRX200_PCE_GCTRL_0_PLCKMOD Port Lock Mode */
  2961. +// {0x1158, 1, 1, 0x00}, /* XRX200_PCE_GCTRL_0_PLIMMOD MAC Address Learning Limitation Mode */
  2962. +// {0x1158, 0, 1, 0x00}, /* XRX200_PCE_GCTRL_0_MTFL MAC Table Flushing */
  2963. +// {0x115C, 0, 16, 0x00}, /* XRX200_PCE_GCTRL_1 PCE Global Control Register1 */
  2964. +// {0x115C, 1, 1, 0x00}, /* XRX200_PCE_GCTRL_1_PCE_DIS PCE Disable after currently processed packet */
  2965. +// {0x115C, 0, 1, 0x00}, /* XRX200_PCE_GCTRL_1_LRNMOD MAC Address Learning Mode */
  2966. +// {0x1160, 0, 16, 0x00}, /* XRX200_PCE_TCM_GLOB_CTRL Three-color MarkerGlobal Control Register */
  2967. +// {0x1160, 6, 3, 0x00}, /* XRX200_PCE_TCM_GLOB_CTRL_DPRED Re-marking Drop Precedence Red Encoding */
  2968. +// {0x1160, 3, 3, 0x00}, /* XRX200_PCE_TCM_GLOB_CTRL_DPYEL Re-marking Drop Precedence Yellow Encoding */
  2969. +// {0x1160, 0, 3, 0x00}, /* XRX200_PCE_TCM_GLOB_CTRL_DPGRN Re-marking Drop Precedence Green Encoding */
  2970. +// {0x1164, 0, 16, 0x00}, /* XRX200_PCE_IGMP_CTRL IGMP Control Register */
  2971. +// {0x1164, 15, 1, 0x00}, /* XRX200_PCE_IGMP_CTRL_FAGEEN Force Aging of Table Entries Enable */
  2972. +// {0x1164, 14, 1, 0x00}, /* XRX200_PCE_IGMP_CTRL_FLEAVE Fast Leave Enable */
  2973. +// {0x1164, 13, 1, 0x00}, /* XRX200_PCE_IGMP_CTRL_DMRTEN Default Maximum Response Time Enable */
  2974. +// {0x1164, 12, 1, 0x00}, /* XRX200_PCE_IGMP_CTRL_JASUP Join Aggregation Suppression Enable */
  2975. +// {0x1164, 11, 1, 0x00}, /* XRX200_PCE_IGMP_CTRL_REPSUP Report Suppression Enable */
  2976. +// {0x1164, 10, 1, 0x00}, /* XRX200_PCE_IGMP_CTRL_SRPEN Snooping of Router Port Enable */
  2977. +// {0x1164, 8, 2, 0x00}, /* XRX200_PCE_IGMP_CTRL_ROB Robustness Variable */
  2978. +// {0x1164, 0, 8, 0x00}, /* XRX200_PCE_IGMP_CTRL_DMRT IGMP Default Maximum Response Time */
  2979. +// {0x1168, 0, 16, 0x00}, /* XRX200_PCE_IGMP_DRPM IGMP Default RouterPort Map Register */
  2980. +// {0x1168, 0, 16, 0x00}, /* XRX200_PCE_IGMP_DRPM_DRPM IGMP Default Router Port Map */
  2981. +// {0x116C, 0, 16, 0x00}, /* XRX200_PCE_IGMP_AGE_0 IGMP Aging Register0 */
  2982. +// {0x116C, 3, 8, 0x00}, /* XRX200_PCE_IGMP_AGE_0_MANT IGMP Group Aging Time Mantissa */
  2983. +// {0x116C, 0, 3, 0x00}, /* XRX200_PCE_IGMP_AGE_0_EXP IGMP Group Aging Time Exponent */
  2984. +// {0x1170, 0, 16, 0x00}, /* XRX200_PCE_IGMP_AGE_1 IGMP Aging Register1 */
  2985. +// {0x1170, 0, 12, 0x00}, /* XRX200_PCE_IGMP_AGE_1_MANT IGMP Router Port Aging Time Mantissa */
  2986. +// {0x1174, 0, 16, 0x00}, /* XRX200_PCE_IGMP_STAT IGMP Status Register */
  2987. +// {0x1174, 0, 16, 0x00}, /* XRX200_PCE_IGMP_STAT_IGPM IGMP Port Map */
  2988. +// {0x1178, 0, 16, 0x00}, /* XRX200_WOL_GLB_CTRL Wake-on-LAN ControlRegister */
  2989. +// {0x1178, 0, 1, 0x00}, /* XRX200_WOL_GLB_CTRL_PASSEN WoL Password Enable */
  2990. +// {0x117C, 0, 16, 0x00}, /* XRX200_WOL_DA_0 Wake-on-LAN DestinationAddress Register 0 */
  2991. +// {0x117C, 0, 16, 0x00}, /* XRX200_WOL_DA_0_DA0 WoL Destination Address [15:0] */
  2992. +// {0x1180, 0, 16, 0x00}, /* XRX200_WOL_DA_1 Wake-on-LAN DestinationAddress Register 1 */
  2993. +// {0x1180, 0, 16, 0x00}, /* XRX200_WOL_DA_1_DA1 WoL Destination Address [31:16] */
  2994. +// {0x1184, 0, 16, 0x00}, /* XRX200_WOL_DA_2 Wake-on-LAN DestinationAddress Register 2 */
  2995. +// {0x1184, 0, 16, 0x00}, /* XRX200_WOL_DA_2_DA2 WoL Destination Address [47:32] */
  2996. +// {0x1188, 0, 16, 0x00}, /* XRX200_WOL_PW_0 Wake-on-LAN Password Register0 */
  2997. +// {0x1188, 0, 16, 0x00}, /* XRX200_WOL_PW_0_PW0 WoL Password [15:0] */
  2998. +// {0x118C, 0, 16, 0x00}, /* XRX200_WOL_PW_1 Wake-on-LAN Password Register1 */
  2999. +// {0x118C, 0, 16, 0x00}, /* XRX200_WOL_PW_1_PW1 WoL Password [31:16] */
  3000. +// {0x1190, 0, 16, 0x00}, /* XRX200_WOL_PW_2 Wake-on-LAN Password Register2 */
  3001. +// {0x1190, 0, 16, 0x00}, /* XRX200_WOL_PW_2_PW2 WoL Password [47:32] */
  3002. +// {0x1194, 0, 16, 0x00}, /* XRX200_PCE_IER_0_PINT Parser and ClassificationEngine Global Interrupt Enable Register 0 */
  3003. +// {0x1194, 15, 1, 0x00}, /* XRX200_PCE_IER_0_PINT_15 Port Interrupt Enable */
  3004. +// {0x1194, 14, 1, 0x00}, /* XRX200_PCE_IER_0_PINT_14 Port Interrupt Enable */
  3005. +// {0x1194, 13, 1, 0x00}, /* XRX200_PCE_IER_0_PINT_13 Port Interrupt Enable */
  3006. +// {0x1194, 12, 1, 0x00}, /* XRX200_PCE_IER_0_PINT_12 Port Interrupt Enable */
  3007. +// {0x1194, 11, 1, 0x00}, /* XRX200_PCE_IER_0_PINT_11 Port Interrupt Enable */
  3008. +// {0x1194, 10, 1, 0x00}, /* XRX200_PCE_IER_0_PINT_10 Port Interrupt Enable */
  3009. +// {0x1194, 9, 1, 0x00}, /* XRX200_PCE_IER_0_PINT_9 Port Interrupt Enable */
  3010. +// {0x1194, 8, 1, 0x00}, /* XRX200_PCE_IER_0_PINT_8 Port Interrupt Enable */
  3011. +// {0x1194, 7, 1, 0x00}, /* XRX200_PCE_IER_0_PINT_7 Port Interrupt Enable */
  3012. +// {0x1194, 6, 1, 0x00}, /* XRX200_PCE_IER_0_PINT_6 Port Interrupt Enable */
  3013. +// {0x1194, 5, 1, 0x00}, /* XRX200_PCE_IER_0_PINT_5 Port Interrupt Enable */
  3014. +// {0x1194, 4, 1, 0x00}, /* XRX200_PCE_IER_0_PINT_4 Port Interrupt Enable */
  3015. +// {0x1194, 3, 1, 0x00}, /* XRX200_PCE_IER_0_PINT_3 Port Interrupt Enable */
  3016. +// {0x1194, 2, 1, 0x00}, /* XRX200_PCE_IER_0_PINT_2 Port Interrupt Enable */
  3017. +// {0x1194, 1, 1, 0x00}, /* XRX200_PCE_IER_0_PINT_1 Port Interrupt Enable */
  3018. +// {0x1194, 0, 1, 0x00}, /* XRX200_PCE_IER_0_PINT_0 Port Interrupt Enable */
  3019. +// {0x1198, 0, 16, 0x00}, /* XRX200_PCE_IER_1 Parser and ClassificationEngine Global Interrupt Enable Register 1 */
  3020. +// {0x1198, 6, 1, 0x00}, /* XRX200_PCE_IER_1_FLOWINT Traffic Flow Table Interrupt Rule matched Interrupt Enable */
  3021. +// {0x1198, 5, 1, 0x00}, /* XRX200_PCE_IER_1_CPH2 Classification Phase 2 Ready Interrupt Enable */
  3022. +// {0x1198, 4, 1, 0x00}, /* XRX200_PCE_IER_1_CPH1 Classification Phase 1 Ready Interrupt Enable */
  3023. +// {0x1198, 3, 1, 0x00}, /* XRX200_PCE_IER_1_CPH0 Classification Phase 0 Ready Interrupt Enable */
  3024. +// {0x1198, 2, 1, 0x00}, /* XRX200_PCE_IER_1_PRDY Parser Ready Interrupt Enable */
  3025. +// {0x1198, 1, 1, 0x00}, /* XRX200_PCE_IER_1_IGTF IGMP Table Full Interrupt Enable */
  3026. +// {0x1198, 0, 1, 0x00}, /* XRX200_PCE_IER_1_MTF MAC Table Full Interrupt Enable */
  3027. +// {0x119C, 0, 16, 0x00}, /* XRX200_PCE_ISR_0_PINT Parser and ClassificationEngine Global Interrupt Status Register 0 */
  3028. +// {0x119C, 15, 1, 0x00}, /* XRX200_PCE_ISR_0_PINT_15 Port Interrupt */
  3029. +// {0x119C, 14, 1, 0x00}, /* XRX200_PCE_ISR_0_PINT_14 Port Interrupt */
  3030. +// {0x119C, 13, 1, 0x00}, /* XRX200_PCE_ISR_0_PINT_13 Port Interrupt */
  3031. +// {0x119C, 12, 1, 0x00}, /* XRX200_PCE_ISR_0_PINT_12 Port Interrupt */
  3032. +// {0x119C, 11, 1, 0x00}, /* XRX200_PCE_ISR_0_PINT_11 Port Interrupt */
  3033. +// {0x119C, 10, 1, 0x00}, /* XRX200_PCE_ISR_0_PINT_10 Port Interrupt */
  3034. +// {0x119C, 9, 1, 0x00}, /* XRX200_PCE_ISR_0_PINT_9 Port Interrupt */
  3035. +// {0x119C, 8, 1, 0x00}, /* XRX200_PCE_ISR_0_PINT_8 Port Interrupt */
  3036. +// {0x119C, 7, 1, 0x00}, /* XRX200_PCE_ISR_0_PINT_7 Port Interrupt */
  3037. +// {0x119C, 6, 1, 0x00}, /* XRX200_PCE_ISR_0_PINT_6 Port Interrupt */
  3038. +// {0x119C, 5, 1, 0x00}, /* XRX200_PCE_ISR_0_PINT_5 Port Interrupt */
  3039. +// {0x119C, 4, 1, 0x00}, /* XRX200_PCE_ISR_0_PINT_4 Port Interrupt */
  3040. +// {0x119C, 3, 1, 0x00}, /* XRX200_PCE_ISR_0_PINT_3 Port Interrupt */
  3041. +// {0x119C, 2, 1, 0x00}, /* XRX200_PCE_ISR_0_PINT_2 Port Interrupt */
  3042. +// {0x119C, 1, 1, 0x00}, /* XRX200_PCE_ISR_0_PINT_1 Port Interrupt */
  3043. +// {0x119C, 0, 1, 0x00}, /* XRX200_PCE_ISR_0_PINT_0 Port Interrupt */
  3044. +// {0x11A0, 0, 16, 0x00}, /* XRX200_PCE_ISR_1 Parser and ClassificationEngine Global Interrupt Status Register 1 */
  3045. +// {0x11A0, 6, 1, 0x00}, /* XRX200_PCE_ISR_1_FLOWINT Traffic Flow Table Interrupt Rule matched */
  3046. +// {0x11A0, 5, 1, 0x00}, /* XRX200_PCE_ISR_1_CPH2 Classification Phase 2 Ready Interrupt */
  3047. +// {0x11A0, 4, 1, 0x00}, /* XRX200_PCE_ISR_1_CPH1 Classification Phase 1 Ready Interrupt */
  3048. +// {0x11A0, 3, 1, 0x00}, /* XRX200_PCE_ISR_1_CPH0 Classification Phase 0 Ready Interrupt */
  3049. +// {0x11A0, 2, 1, 0x00}, /* XRX200_PCE_ISR_1_PRDY Parser Ready Interrupt */
  3050. +// {0x11A0, 1, 1, 0x00}, /* XRX200_PCE_ISR_1_IGTF IGMP Table Full Interrupt */
  3051. +// {0x11A0, 0, 1, 0x00}, /* XRX200_PCE_ISR_1_MTF MAC Table Full Interrupt */
  3052. +// {0x11A4, 0, 16, 0x00}, /* XRX200_PARSER_STAT_FIFO Parser Status Register */
  3053. +// {0x11A4, 8, 8, 0x00}, /* XRX200_PARSER_STAT_FSM_DAT_CNT Parser FSM Data Counter */
  3054. +// {0x11A4, 5, 3, 0x00}, /* XRX200_PARSER_STAT_FSM_STATE Parser FSM State */
  3055. +// {0x11A4, 4, 1, 0x00}, /* XRX200_PARSER_STAT_PKT_ERR Packet error detected */
  3056. +// {0x11A4, 3, 1, 0x00}, /* XRX200_PARSER_STAT_FSM_FIN Parser FSM finished */
  3057. +// {0x11A4, 2, 1, 0x00}, /* XRX200_PARSER_STAT_FSM_START Parser FSM start */
  3058. +// {0x11A4, 1, 1, 0x00}, /* XRX200_PARSER_STAT_FIFO_RDY Parser FIFO ready for read. */
  3059. +// {0x11A4, 0, 1, 0x00}, /* XRX200_PARSER_STAT_FIFO_FULL Parser */
  3060. +// {0x1200, 0, 16, 0x28}, /* XRX200_PCE_PCTRL_0 PCE Port ControlRegister 0 */
  3061. +// {0x1200, 13, 1, 0x28}, /* XRX200_PCE_PCTRL_0_MCST Multicast Forwarding Mode Selection */
  3062. +// {0x1200, 12, 1, 0x28}, /* XRX200_PCE_PCTRL_0_EGSTEN Table-based Egress Special Tag Enable */
  3063. +// {0x1200, 11, 1, 0x28}, /* XRX200_PCE_PCTRL_0_IGSTEN Ingress Special Tag Enable */
  3064. +// {0x1200, 10, 1, 0x28}, /* XRX200_PCE_PCTRL_0_PCPEN PCP Remarking Mode */
  3065. +// {0x1200, 9, 1, 0x28}, /* XRX200_PCE_PCTRL_0_CLPEN Class Remarking Mode */
  3066. +// {0x1200, 8, 1, 0x28}, /* XRX200_PCE_PCTRL_0_DPEN Drop Precedence Remarking Mode */
  3067. +// {0x1200, 7, 1, 0x28}, /* XRX200_PCE_PCTRL_0_CMOD Three-color Marker Color Mode */
  3068. +// {0x1200, 6, 1, 0x28}, /* XRX200_PCE_PCTRL_0_VREP VLAN Replacement Mode */
  3069. + {0x1200, 5, 1, 0x28}, /* XRX200_PCE_PCTRL_0_TVM Transparent VLAN Mode */
  3070. +// {0x1200, 4, 1, 0x28}, /* XRX200_PCE_PCTRL_0_PLOCK Port Locking Enable */
  3071. +// {0x1200, 3, 1, 0x28}, /* XRX200_PCE_PCTRL_0_AGEDIS Aging Disable */
  3072. +// {0x1200, 0, 3, 0x28}, /* XRX200_PCE_PCTRL_0_PSTATE Port State */
  3073. +// {0x1204, 0, 16, 0x28}, /* XRX200_PCE_PCTRL_1 PCE Port ControlRegister 1 */
  3074. +// {0x1204, 0, 8, 0x28}, /* XRX200_PCE_PCTRL_1_LRNLIM MAC Address Learning Limit */
  3075. +// {0x1208, 0, 16, 0x28}, /* XRX200_PCE_PCTRL_2 PCE Port ControlRegister 2 */
  3076. +// {0x1208, 7, 1, 0x28}, /* XRX200_PCE_PCTRL_2_DSCPMOD DSCP Mode Selection */
  3077. +// {0x1208, 5, 2, 0x28}, /* XRX200_PCE_PCTRL_2_DSCP Enable DSCP to select the Class of Service */
  3078. +// {0x1208, 4, 1, 0x28}, /* XRX200_PCE_PCTRL_2_PCP Enable VLAN PCP to select the Class of Service */
  3079. +// {0x1208, 0, 4, 0x28}, /* XRX200_PCE_PCTRL_2_PCLASS Port-based Traffic Class */
  3080. +// {0x120C, 0, 16, 0x28}, /* XRX200_PCE_PCTRL_3_VIO PCE Port ControlRegister 3 */
  3081. +// {0x120C, 11, 1, 0x28}, /* XRX200_PCE_PCTRL_3_EDIR Egress Redirection Mode */
  3082. +// {0x120C, 10, 1, 0x28}, /* XRX200_PCE_PCTRL_3_RXDMIR Receive Mirroring Enable for dropped frames */
  3083. +// {0x120C, 9, 1, 0x28}, /* XRX200_PCE_PCTRL_3_RXVMIR Receive Mirroring Enable for valid frames */
  3084. +// {0x120C, 8, 1, 0x28}, /* XRX200_PCE_PCTRL_3_TXMIR Transmit Mirroring Enable */
  3085. +// {0x120C, 7, 1, 0x28}, /* XRX200_PCE_PCTRL_3_VIO_7 Violation Type 7 Mirroring Enable */
  3086. +// {0x120C, 6, 1, 0x28}, /* XRX200_PCE_PCTRL_3_VIO_6 Violation Type 6 Mirroring Enable */
  3087. +// {0x120C, 5, 1, 0x28}, /* XRX200_PCE_PCTRL_3_VIO_5 Violation Type 5 Mirroring Enable */
  3088. +// {0x120C, 4, 1, 0x28}, /* XRX200_PCE_PCTRL_3_VIO_4 Violation Type 4 Mirroring Enable */
  3089. +// {0x120C, 3, 1, 0x28}, /* XRX200_PCE_PCTRL_3_VIO_3 Violation Type 3 Mirroring Enable */
  3090. +// {0x120C, 2, 1, 0x28}, /* XRX200_PCE_PCTRL_3_VIO_2 Violation Type 2 Mirroring Enable */
  3091. +// {0x120C, 1, 1, 0x28}, /* XRX200_PCE_PCTRL_3_VIO_1 Violation Type 1 Mirroring Enable */
  3092. +// {0x120C, 0, 1, 0x28}, /* XRX200_PCE_PCTRL_3_VIO_0 Violation Type 0 Mirroring Enable */
  3093. +// {0x1210, 0, 16, 0x28}, /* XRX200_WOL_CTRL Wake-on-LAN ControlRegister */
  3094. +// {0x1210, 0, 1, 0x28}, /* XRX200_WOL_CTRL_PORT WoL Enable */
  3095. +// {0x1214, 0, 16, 0x28}, /* XRX200_PCE_VCTRL PCE VLAN ControlRegister */
  3096. + {0x1214, 5, 1, 0x28}, /* XRX200_PCE_VCTRL_VSR VLAN Security Rule */
  3097. + {0x1214, 4, 1, 0x28}, /* XRX200_PCE_VCTRL_VEMR VLAN Egress Member Violation Rule */
  3098. + {0x1214, 3, 1, 0x28}, /* XRX200_PCE_VCTRL_VIMR VLAN Ingress Member Violation Rule */
  3099. + {0x1214, 1, 2, 0x28}, /* XRX200_PCE_VCTRL_VINR VLAN Ingress Tag Rule */
  3100. + {0x1214, 0, 1, 0x28}, /* XRX200_PCE_VCTRL_UVR Unknown VLAN Rule */
  3101. +// {0x1218, 0, 16, 0x28}, /* XRX200_PCE_DEFPVID PCE Default PortVID Register */
  3102. + {0x1218, 0, 6, 0x28}, /* XRX200_PCE_DEFPVID_PVID Default Port VID Index */
  3103. +// {0x121C, 0, 16, 0x28}, /* XRX200_PCE_PSTAT PCE Port StatusRegister */
  3104. +// {0x121C, 0, 16, 0x28}, /* XRX200_PCE_PSTAT_LRNCNT Learning Count */
  3105. +// {0x1220, 0, 16, 0x28}, /* XRX200_PCE_PIER Parser and ClassificationEngine Port Interrupt Enable Register */
  3106. +// {0x1220, 5, 1, 0x28}, /* XRX200_PCE_PIER_CLDRP Classification Drop Interrupt Enable */
  3107. +// {0x1220, 4, 1, 0x28}, /* XRX200_PCE_PIER_PTDRP Port Drop Interrupt Enable */
  3108. +// {0x1220, 3, 1, 0x28}, /* XRX200_PCE_PIER_VLAN VLAN Violation Interrupt Enable */
  3109. +// {0x1220, 2, 1, 0x28}, /* XRX200_PCE_PIER_WOL Wake-on-LAN Interrupt Enable */
  3110. +// {0x1220, 1, 1, 0x28}, /* XRX200_PCE_PIER_LOCK Port Limit Alert Interrupt Enable */
  3111. +// {0x1220, 0, 1, 0x28}, /* XRX200_PCE_PIER_LIM Port Lock Alert Interrupt Enable */
  3112. +// {0x1224, 0, 16, 0x28}, /* XRX200_PCE_PISR Parser and ClassificationEngine Port Interrupt Status Register */
  3113. +// {0x1224, 5, 1, 0x28}, /* XRX200_PCE_PISR_CLDRP Classification Drop Interrupt */
  3114. +// {0x1224, 4, 1, 0x28}, /* XRX200_PCE_PISR_PTDRP Port Drop Interrupt */
  3115. +// {0x1224, 3, 1, 0x28}, /* XRX200_PCE_PISR_VLAN VLAN Violation Interrupt */
  3116. +// {0x1224, 2, 1, 0x28}, /* XRX200_PCE_PISR_WOL Wake-on-LAN Interrupt */
  3117. +// {0x1224, 1, 1, 0x28}, /* XRX200_PCE_PISR_LOCK Port Lock Alert Interrupt */
  3118. +// {0x1224, 0, 1, 0x28}, /* XRX200_PCE_PISR_LIMIT Port Limitation Alert Interrupt */
  3119. +// {0x1600, 0, 16, 0x1c}, /* XRX200_PCE_TCM_CTRL Three-colorMarker Control Register */
  3120. +// {0x1600, 0, 1, 0x1c}, /* XRX200_PCE_TCM_CTRL_TCMEN Three-color Marker metering instance enable */
  3121. +// {0x1604, 0, 16, 0x1c}, /* XRX200_PCE_TCM_STAT Three-colorMarker Status Register */
  3122. +// {0x1604, 1, 1, 0x1c}, /* XRX200_PCE_TCM_STAT_AL1 Three-color Marker Alert 1 Status */
  3123. +// {0x1604, 0, 1, 0x1c}, /* XRX200_PCE_TCM_STAT_AL0 Three-color Marker Alert 0 Status */
  3124. +// {0x1608, 0, 16, 0x1c}, /* XRX200_PCE_TCM_CBS Three-color MarkerCommitted Burst Size Register */
  3125. +// {0x1608, 0, 10, 0x1c}, /* XRX200_PCE_TCM_CBS_CBS Committed Burst Size */
  3126. +// {0x160C, 0, 16, 0x1c}, /* XRX200_PCE_TCM_EBS Three-color MarkerExcess Burst Size Register */
  3127. +// {0x160C, 0, 10, 0x1c}, /* XRX200_PCE_TCM_EBS_EBS Excess Burst Size */
  3128. +// {0x1610, 0, 16, 0x1c}, /* XRX200_PCE_TCM_IBS Three-color MarkerInstantaneous Burst Size Register */
  3129. +// {0x1610, 0, 2, 0x1c}, /* XRX200_PCE_TCM_IBS_IBS Instantaneous Burst Size */
  3130. +// {0x1614, 0, 16, 0x1c}, /* XRX200_PCE_TCM_CIR_MANT Three-colorMarker Constant Information Rate Mantissa Register */
  3131. +// {0x1614, 0, 10, 0x1c}, /* XRX200_PCE_TCM_CIR_MANT_MANT Rate Counter Mantissa */
  3132. +// {0x1618, 0, 16, 0x1c}, /* XRX200_PCE_TCM_CIR_EXP Three-colorMarker Constant Information Rate Exponent Register */
  3133. +// {0x1618, 0, 4, 0x1c}, /* XRX200_PCE_TCM_CIR_EXP_EXP Rate Counter Exponent */
  3134. +// {0x2300, 0, 16, 0x00}, /* XRX200_MAC_TEST MAC Test Register */
  3135. +// {0x2300, 0, 16, 0x00}, /* XRX200_MAC_TEST_JTP Jitter Test Pattern */
  3136. +// {0x2304, 0, 16, 0x00}, /* XRX200_MAC_PFAD_CFG MAC Pause FrameSource Address Configuration Register */
  3137. +// {0x2304, 0, 1, 0x00}, /* XRX200_MAC_PFAD_CFG_SAMOD Source Address Mode */
  3138. +// {0x2308, 0, 16, 0x00}, /* XRX200_MAC_PFSA_0 Pause Frame SourceAddress Part 0 */
  3139. +// {0x2308, 0, 16, 0x00}, /* XRX200_MAC_PFSA_0_PFAD Pause Frame Source Address Part 0 */
  3140. +// {0x230C, 0, 16, 0x00}, /* XRX200_MAC_PFSA_1 Pause Frame SourceAddress Part 1 */
  3141. +// {0x230C, 0, 16, 0x00}, /* XRX200_MAC_PFSA_1_PFAD Pause Frame Source Address Part 1 */
  3142. +// {0x2310, 0, 16, 0x00}, /* XRX200_MAC_PFSA_2 Pause Frame SourceAddress Part 2 */
  3143. +// {0x2310, 0, 16, 0x00}, /* XRX200_MAC_PFSA_2_PFAD Pause Frame Source Address Part 2 */
  3144. +// {0x2314, 0, 16, 0x00}, /* XRX200_MAC_FLEN MAC Frame Length Register */
  3145. +// {0x2314, 0, 14, 0x00}, /* XRX200_MAC_FLEN_LEN Maximum Frame Length */
  3146. +// {0x2318, 0, 16, 0x00}, /* XRX200_MAC_VLAN_ETYPE_0 MAC VLAN EthertypeRegister 0 */
  3147. +// {0x2318, 0, 16, 0x00}, /* XRX200_MAC_VLAN_ETYPE_0_OUTER Ethertype */
  3148. +// {0x231C, 0, 16, 0x00}, /* XRX200_MAC_VLAN_ETYPE_1 MAC VLAN EthertypeRegister 1 */
  3149. +// {0x231C, 0, 16, 0x00}, /* XRX200_MAC_VLAN_ETYPE_1_INNER Ethertype */
  3150. +// {0x2320, 0, 16, 0x00}, /* XRX200_MAC_IER MAC Interrupt EnableRegister */
  3151. +// {0x2320, 0, 8, 0x00}, /* XRX200_MAC_IER_MACIEN MAC Interrupt Enable */
  3152. +// {0x2324, 0, 16, 0x00}, /* XRX200_MAC_ISR MAC Interrupt StatusRegister */
  3153. +// {0x2324, 0, 8, 0x00}, /* XRX200_MAC_ISR_MACINT MAC Interrupt */
  3154. +// {0x2400, 0, 16, 0x30}, /* XRX200_MAC_PSTAT MAC Port Status Register */
  3155. +// {0x2400, 11, 1, 0x30}, /* XRX200_MAC_PSTAT_PACT PHY Active Status */
  3156. + {0x2400, 10, 1, 0x30}, /* XRX200_MAC_PSTAT_GBIT Gigabit Speed Status */
  3157. + {0x2400, 9, 1, 0x30}, /* XRX200_MAC_PSTAT_MBIT Megabit Speed Status */
  3158. + {0x2400, 8, 1, 0x30}, /* XRX200_MAC_PSTAT_FDUP Full Duplex Status */
  3159. +// {0x2400, 7, 1, 0x30}, /* XRX200_MAC_PSTAT_RXPAU Receive Pause Status */
  3160. +// {0x2400, 6, 1, 0x30}, /* XRX200_MAC_PSTAT_TXPAU Transmit Pause Status */
  3161. +// {0x2400, 5, 1, 0x30}, /* XRX200_MAC_PSTAT_RXPAUEN Receive Pause Enable Status */
  3162. +// {0x2400, 4, 1, 0x30}, /* XRX200_MAC_PSTAT_TXPAUEN Transmit Pause Enable Status */
  3163. + {0x2400, 3, 1, 0x30}, /* XRX200_MAC_PSTAT_LSTAT Link Status */
  3164. +// {0x2400, 2, 1, 0x30}, /* XRX200_MAC_PSTAT_CRS Carrier Sense Status */
  3165. +// {0x2400, 1, 1, 0x30}, /* XRX200_MAC_PSTAT_TXLPI Transmit Low-power Idle Status */
  3166. +// {0x2400, 0, 1, 0x30}, /* XRX200_MAC_PSTAT_RXLPI Receive Low-power Idle Status */
  3167. +// {0x2404, 0, 16, 0x30}, /* XRX200_MAC_PISR MAC Interrupt Status Register */
  3168. +// {0x2404, 13, 1, 0x30}, /* XRX200_MAC_PISR_PACT PHY Active Status */
  3169. +// {0x2404, 12, 1, 0x30}, /* XRX200_MAC_PISR_SPEED Megabit Speed Status */
  3170. +// {0x2404, 11, 1, 0x30}, /* XRX200_MAC_PISR_FDUP Full Duplex Status */
  3171. +// {0x2404, 10, 1, 0x30}, /* XRX200_MAC_PISR_RXPAUEN Receive Pause Enable Status */
  3172. +// {0x2404, 9, 1, 0x30}, /* XRX200_MAC_PISR_TXPAUEN Transmit Pause Enable Status */
  3173. +// {0x2404, 8, 1, 0x30}, /* XRX200_MAC_PISR_LPIOFF Receive Low-power Idle Mode is left */
  3174. +// {0x2404, 7, 1, 0x30}, /* XRX200_MAC_PISR_LPION Receive Low-power Idle Mode is entered */
  3175. +// {0x2404, 6, 1, 0x30}, /* XRX200_MAC_PISR_JAM Jam Status Detected */
  3176. +// {0x2404, 5, 1, 0x30}, /* XRX200_MAC_PISR_TOOSHORT Too Short Frame Error Detected */
  3177. +// {0x2404, 4, 1, 0x30}, /* XRX200_MAC_PISR_TOOLONG Too Long Frame Error Detected */
  3178. +// {0x2404, 3, 1, 0x30}, /* XRX200_MAC_PISR_LENERR Length Mismatch Error Detected */
  3179. +// {0x2404, 2, 1, 0x30}, /* XRX200_MAC_PISR_FCSERR Frame Checksum Error Detected */
  3180. +// {0x2404, 1, 1, 0x30}, /* XRX200_MAC_PISR_TXPAUSE Pause Frame Transmitted */
  3181. +// {0x2404, 0, 1, 0x30}, /* XRX200_MAC_PISR_RXPAUSE Pause Frame Received */
  3182. +// {0x2408, 0, 16, 0x30}, /* XRX200_MAC_PIER MAC Interrupt Enable Register */
  3183. +// {0x2408, 13, 1, 0x30}, /* XRX200_MAC_PIER_PACT PHY Active Status */
  3184. +// {0x2408, 12, 1, 0x30}, /* XRX200_MAC_PIER_SPEED Megabit Speed Status */
  3185. +// {0x2408, 11, 1, 0x30}, /* XRX200_MAC_PIER_FDUP Full Duplex Status */
  3186. +// {0x2408, 10, 1, 0x30}, /* XRX200_MAC_PIER_RXPAUEN Receive Pause Enable Status */
  3187. +// {0x2408, 9, 1, 0x30}, /* XRX200_MAC_PIER_TXPAUEN Transmit Pause Enable Status */
  3188. +// {0x2408, 8, 1, 0x30}, /* XRX200_MAC_PIER_LPIOFF Low-power Idle Off Interrupt Mask */
  3189. +// {0x2408, 7, 1, 0x30}, /* XRX200_MAC_PIER_LPION Low-power Idle On Interrupt Mask */
  3190. +// {0x2408, 6, 1, 0x30}, /* XRX200_MAC_PIER_JAM Jam Status Interrupt Mask */
  3191. +// {0x2408, 5, 1, 0x30}, /* XRX200_MAC_PIER_TOOSHORT Too Short Frame Error Interrupt Mask */
  3192. +// {0x2408, 4, 1, 0x30}, /* XRX200_MAC_PIER_TOOLONG Too Long Frame Error Interrupt Mask */
  3193. +// {0x2408, 3, 1, 0x30}, /* XRX200_MAC_PIER_LENERR Length Mismatch Error Interrupt Mask */
  3194. +// {0x2408, 2, 1, 0x30}, /* XRX200_MAC_PIER_FCSERR Frame Checksum Error Interrupt Mask */
  3195. +// {0x2408, 1, 1, 0x30}, /* XRX200_MAC_PIER_TXPAUSE Transmit Pause Frame Interrupt Mask */
  3196. +// {0x2408, 0, 1, 0x30}, /* XRX200_MAC_PIER_RXPAUSE Receive Pause Frame Interrupt Mask */
  3197. +// {0x240C, 0, 16, 0x30}, /* XRX200_MAC_CTRL_0 MAC Control Register0 */
  3198. +// {0x240C, 13, 2, 0x30}, /* XRX200_MAC_CTRL_0_LCOL Late Collision Control */
  3199. +// {0x240C, 12, 1, 0x30}, /* XRX200_MAC_CTRL_0_BM Burst Mode Control */
  3200. +// {0x240C, 11, 1, 0x30}, /* XRX200_MAC_CTRL_0_APADEN Automatic VLAN Padding Enable */
  3201. +// {0x240C, 10, 1, 0x30}, /* XRX200_MAC_CTRL_0_VPAD2EN Stacked VLAN Padding Enable */
  3202. +// {0x240C, 9, 1, 0x30}, /* XRX200_MAC_CTRL_0_VPADEN VLAN Padding Enable */
  3203. +// {0x240C, 8, 1, 0x30}, /* XRX200_MAC_CTRL_0_PADEN Padding Enable */
  3204. +// {0x240C, 7, 1, 0x30}, /* XRX200_MAC_CTRL_0_FCS Transmit FCS Control */
  3205. + {0x240C, 4, 3, 0x30}, /* XRX200_MAC_CTRL_0_FCON Flow Control Mode */
  3206. +// {0x240C, 2, 2, 0x30}, /* XRX200_MAC_CTRL_0_FDUP Full Duplex Control */
  3207. +// {0x240C, 0, 2, 0x30}, /* XRX200_MAC_CTRL_0_GMII GMII/MII interface mode selection */
  3208. +// {0x2410, 0, 16, 0x30}, /* XRX200_MAC_CTRL_1 MAC Control Register1 */
  3209. +// {0x2410, 8, 1, 0x30}, /* XRX200_MAC_CTRL_1_SHORTPRE Short Preamble Control */
  3210. +// {0x2410, 0, 4, 0x30}, /* XRX200_MAC_CTRL_1_IPG Minimum Inter Packet Gap Size */
  3211. +// {0x2414, 0, 16, 0x30}, /* XRX200_MAC_CTRL_2 MAC Control Register2 */
  3212. +// {0x2414, 3, 1, 0x30}, /* XRX200_MAC_CTRL_2_MLEN Maximum Untagged Frame Length */
  3213. +// {0x2414, 2, 1, 0x30}, /* XRX200_MAC_CTRL_2_LCHKL Frame Length Check Long Enable */
  3214. +// {0x2414, 0, 2, 0x30}, /* XRX200_MAC_CTRL_2_LCHKS Frame Length Check Short Enable */
  3215. +// {0x2418, 0, 16, 0x30}, /* XRX200_MAC_CTRL_3 MAC Control Register3 */
  3216. +// {0x2418, 0, 4, 0x30}, /* XRX200_MAC_CTRL_3_RCNT Retry Count */
  3217. +// {0x241C, 0, 16, 0x30}, /* XRX200_MAC_CTRL_4 MAC Control Register4 */
  3218. +// {0x241C, 7, 1, 0x30}, /* XRX200_MAC_CTRL_4_LPIEN LPI Mode Enable */
  3219. +// {0x241C, 0, 7, 0x30}, /* XRX200_MAC_CTRL_4_WAIT LPI Wait Time */
  3220. +// {0x2420, 0, 16, 0x30}, /* XRX200_MAC_CTRL_5_PJPS MAC Control Register5 */
  3221. +// {0x2420, 1, 1, 0x30}, /* XRX200_MAC_CTRL_5_PJPS_NOBP Prolonged Jam pattern size during no-backpressure state */
  3222. +// {0x2420, 0, 1, 0x30}, /* XRX200_MAC_CTRL_5_PJPS_BP Prolonged Jam pattern size during backpressure state */
  3223. +// {0x2424, 0, 16, 0x30}, /* XRX200_MAC_CTRL_6_XBUF Transmit and ReceiveBuffer Control Register */
  3224. +// {0x2424, 9, 3, 0x30}, /* XRX200_MAC_CTRL_6_RBUF_DLY_WP Delay */
  3225. +// {0x2424, 8, 1, 0x30}, /* XRX200_MAC_CTRL_6_RBUF_INIT Receive Buffer Initialization */
  3226. +// {0x2424, 6, 1, 0x30}, /* XRX200_MAC_CTRL_6_RBUF_BYPASS Bypass the Receive Buffer */
  3227. +// {0x2424, 3, 3, 0x30}, /* XRX200_MAC_CTRL_6_XBUF_DLY_WP Delay */
  3228. +// {0x2424, 2, 1, 0x30}, /* XRX200_MAC_CTRL_6_XBUF_INIT Initialize the Transmit Buffer */
  3229. +// {0x2424, 0, 1, 0x30}, /* XRX200_MAC_CTRL_6_XBUF_BYPASS Bypass the Transmit Buffer */
  3230. +// {0x2428, 0, 16, 0x30}, /* XRX200_MAC_BUFST_XBUF MAC Receive and TransmitBuffer Status Register */
  3231. +// {0x2428, 3, 1, 0x30}, /* XRX200_MAC_BUFST_RBUF_UFL Receive Buffer Underflow Indicator */
  3232. +// {0x2428, 2, 1, 0x30}, /* XRX200_MAC_BUFST_RBUF_OFL Receive Buffer Overflow Indicator */
  3233. +// {0x2428, 1, 1, 0x30}, /* XRX200_MAC_BUFST_XBUF_UFL Transmit Buffer Underflow Indicator */
  3234. +// {0x2428, 0, 1, 0x30}, /* XRX200_MAC_BUFST_XBUF_OFL Transmit Buffer Overflow Indicator */
  3235. +// {0x242C, 0, 16, 0x30}, /* XRX200_MAC_TESTEN MAC Test Enable Register */
  3236. +// {0x242C, 2, 1, 0x30}, /* XRX200_MAC_TESTEN_JTEN Jitter Test Enable */
  3237. +// {0x242C, 1, 1, 0x30}, /* XRX200_MAC_TESTEN_TXER Transmit Error Insertion */
  3238. +// {0x242C, 0, 1, 0x30}, /* XRX200_MAC_TESTEN_LOOP MAC Loopback Enable */
  3239. +// {0x2900, 0, 16, 0x00}, /* XRX200_FDMA_CTRL Ethernet Switch FetchDMA Control Register */
  3240. +// {0x2900, 7, 5, 0x00}, /* XRX200_FDMA_CTRL_LPI_THRESHOLD Low Power Idle Threshold */
  3241. +// {0x2900, 4, 3, 0x00}, /* XRX200_FDMA_CTRL_LPI_MODE Low Power Idle Mode */
  3242. +// {0x2900, 2, 2, 0x00}, /* XRX200_FDMA_CTRL_EGSTAG Egress Special Tag Size */
  3243. +// {0x2900, 1, 1, 0x00}, /* XRX200_FDMA_CTRL_IGSTAG Ingress Special Tag Size */
  3244. +// {0x2900, 0, 1, 0x00}, /* XRX200_FDMA_CTRL_EXCOL Excessive Collision Handling */
  3245. +// {0x2904, 0, 16, 0x00}, /* XRX200_FDMA_STETYPE Special Tag EthertypeControl Register */
  3246. +// {0x2904, 0, 16, 0x00}, /* XRX200_FDMA_STETYPE_ETYPE Special Tag Ethertype */
  3247. +// {0x2908, 0, 16, 0x00}, /* XRX200_FDMA_VTETYPE VLAN Tag EthertypeControl Register */
  3248. +// {0x2908, 0, 16, 0x00}, /* XRX200_FDMA_VTETYPE_ETYPE VLAN Tag Ethertype */
  3249. +// {0x290C, 0, 16, 0x00}, /* XRX200_FDMA_STAT_0 FDMA Status Register0 */
  3250. +// {0x290C, 0, 16, 0x00}, /* XRX200_FDMA_STAT_0_FSMS FSM states status */
  3251. +// {0x2910, 0, 16, 0x00}, /* XRX200_FDMA_IER Fetch DMA Global InterruptEnable Register */
  3252. +// {0x2910, 14, 1, 0x00}, /* XRX200_FDMA_IER_PCKD Packet Drop Interrupt Enable */
  3253. +// {0x2910, 13, 1, 0x00}, /* XRX200_FDMA_IER_PCKR Packet Ready Interrupt Enable */
  3254. +// {0x2910, 0, 8, 0x00}, /* XRX200_FDMA_IER_PCKT Packet Sent Interrupt Enable */
  3255. +// {0x2914, 0, 16, 0x00}, /* XRX200_FDMA_ISR Fetch DMA Global InterruptStatus Register */
  3256. +// {0x2914, 14, 1, 0x00}, /* XRX200_FDMA_ISR_PCKTD Packet Drop */
  3257. +// {0x2914, 13, 1, 0x00}, /* XRX200_FDMA_ISR_PCKR Packet is Ready for Transmission */
  3258. +// {0x2914, 0, 8, 0x00}, /* XRX200_FDMA_ISR_PCKT Packet Sent Event */
  3259. +// {0x2A00, 0, 16, 0x18}, /* XRX200_FDMA_PCTRL Ethernet SwitchFetch DMA Port Control Register */
  3260. +// {0x2A00, 3, 2, 0x18}, /* XRX200_FDMA_PCTRL_VLANMOD VLAN Modification Enable */
  3261. +// {0x2A00, 2, 1, 0x18}, /* XRX200_FDMA_PCTRL_DSCPRM DSCP Re-marking Enable */
  3262. +// {0x2A00, 1, 1, 0x18}, /* XRX200_FDMA_PCTRL_STEN Special Tag Insertion Enable */
  3263. +// {0x2A00, 0, 1, 0x18}, /* XRX200_FDMA_PCTRL_EN FDMA Port Enable */
  3264. +// {0x2A04, 0, 16, 0x18}, /* XRX200_FDMA_PRIO Ethernet SwitchFetch DMA Port Priority Register */
  3265. +// {0x2A04, 0, 2, 0x18}, /* XRX200_FDMA_PRIO_PRIO FDMA PRIO */
  3266. +// {0x2A08, 0, 16, 0x18}, /* XRX200_FDMA_PSTAT0 Ethernet SwitchFetch DMA Port Status Register 0 */
  3267. +// {0x2A08, 15, 1, 0x18}, /* XRX200_FDMA_PSTAT0_PKT_AVAIL Port Egress Packet Available */
  3268. +// {0x2A08, 14, 1, 0x18}, /* XRX200_FDMA_PSTAT0_POK Port Status OK */
  3269. +// {0x2A08, 0, 6, 0x18}, /* XRX200_FDMA_PSTAT0_PSEG Port Egress Segment Count */
  3270. +// {0x2A0C, 0, 16, 0x18}, /* XRX200_FDMA_PSTAT1_HDR Ethernet SwitchFetch DMA Port Status Register 1 */
  3271. +// {0x2A0C, 0, 10, 0x18}, /* XRX200_FDMA_PSTAT1_HDR_PTR Header Pointer */
  3272. +// {0x2A10, 0, 16, 0x18}, /* XRX200_FDMA_TSTAMP0 Egress TimeStamp Register 0 */
  3273. +// {0x2A10, 0, 16, 0x18}, /* XRX200_FDMA_TSTAMP0_TSTL Time Stamp [15:0] */
  3274. +// {0x2A14, 0, 16, 0x18}, /* XRX200_FDMA_TSTAMP1 Egress TimeStamp Register 1 */
  3275. +// {0x2A14, 0, 16, 0x18}, /* XRX200_FDMA_TSTAMP1_TSTH Time Stamp [31:16] */
  3276. +// {0x2D00, 0, 16, 0x00}, /* XRX200_SDMA_CTRL Ethernet Switch StoreDMA Control Register */
  3277. +// {0x2D00, 0, 1, 0x00}, /* XRX200_SDMA_CTRL_TSTEN Time Stamp Enable */
  3278. +// {0x2D04, 0, 16, 0x00}, /* XRX200_SDMA_FCTHR1 SDMA Flow Control Threshold1 Register */
  3279. +// {0x2D04, 0, 10, 0x00}, /* XRX200_SDMA_FCTHR1_THR1 Threshold 1 */
  3280. +// {0x2D08, 0, 16, 0x00}, /* XRX200_SDMA_FCTHR2 SDMA Flow Control Threshold2 Register */
  3281. +// {0x2D08, 0, 10, 0x00}, /* XRX200_SDMA_FCTHR2_THR2 Threshold 2 */
  3282. +// {0x2D0C, 0, 16, 0x00}, /* XRX200_SDMA_FCTHR3 SDMA Flow Control Threshold3 Register */
  3283. +// {0x2D0C, 0, 10, 0x00}, /* XRX200_SDMA_FCTHR3_THR3 Threshold 3 */
  3284. +// {0x2D10, 0, 16, 0x00}, /* XRX200_SDMA_FCTHR4 SDMA Flow Control Threshold4 Register */
  3285. +// {0x2D10, 0, 10, 0x00}, /* XRX200_SDMA_FCTHR4_THR4 Threshold 4 */
  3286. +// {0x2D14, 0, 16, 0x00}, /* XRX200_SDMA_FCTHR5 SDMA Flow Control Threshold5 Register */
  3287. +// {0x2D14, 0, 10, 0x00}, /* XRX200_SDMA_FCTHR5_THR5 Threshold 5 */
  3288. +// {0x2D18, 0, 16, 0x00}, /* XRX200_SDMA_FCTHR6 SDMA Flow Control Threshold6 Register */
  3289. +// {0x2D18, 0, 10, 0x00}, /* XRX200_SDMA_FCTHR6_THR6 Threshold 6 */
  3290. +// {0x2D1C, 0, 16, 0x00}, /* XRX200_SDMA_FCTHR7 SDMA Flow Control Threshold7 Register */
  3291. +// {0x2D1C, 0, 11, 0x00}, /* XRX200_SDMA_FCTHR7_THR7 Threshold 7 */
  3292. +// {0x2D20, 0, 16, 0x00}, /* XRX200_SDMA_STAT_0 SDMA Status Register0 */
  3293. +// {0x2D20, 4, 3, 0x00}, /* XRX200_SDMA_STAT_0_BPS_FILL Back Pressure Status */
  3294. +// {0x2D20, 2, 2, 0x00}, /* XRX200_SDMA_STAT_0_BPS_PNT Back Pressure Status */
  3295. +// {0x2D20, 0, 2, 0x00}, /* XRX200_SDMA_STAT_0_DROP Back Pressure Status */
  3296. +// {0x2D24, 0, 16, 0x00}, /* XRX200_SDMA_STAT_1 SDMA Status Register1 */
  3297. +// {0x2D24, 0, 10, 0x00}, /* XRX200_SDMA_STAT_1_FILL Buffer Filling Level */
  3298. +// {0x2D28, 0, 16, 0x00}, /* XRX200_SDMA_STAT_2 SDMA Status Register2 */
  3299. +// {0x2D28, 0, 16, 0x00}, /* XRX200_SDMA_STAT_2_FSMS FSM states status */
  3300. +// {0x2D2C, 0, 16, 0x00}, /* XRX200_SDMA_IER SDMA Interrupt Enable Register */
  3301. +// {0x2D2C, 15, 1, 0x00}, /* XRX200_SDMA_IER_BPEX Buffer Pointers Exceeded */
  3302. +// {0x2D2C, 14, 1, 0x00}, /* XRX200_SDMA_IER_BFULL Buffer Full */
  3303. +// {0x2D2C, 13, 1, 0x00}, /* XRX200_SDMA_IER_FERR Frame Error */
  3304. +// {0x2D2C, 0, 8, 0x00}, /* XRX200_SDMA_IER_FRX Frame Received Successfully */
  3305. +// {0x2D30, 0, 16, 0x00}, /* XRX200_SDMA_ISR SDMA Interrupt Status Register */
  3306. +// {0x2D30, 15, 1, 0x00}, /* XRX200_SDMA_ISR_BPEX Packet Descriptors Exceeded */
  3307. +// {0x2D30, 14, 1, 0x00}, /* XRX200_SDMA_ISR_BFULL Buffer Full */
  3308. +// {0x2D30, 13, 1, 0x00}, /* XRX200_SDMA_ISR_FERR Frame Error */
  3309. +// {0x2D30, 0, 8, 0x00}, /* XRX200_SDMA_ISR_FRX Frame Received Successfully */
  3310. +// {0x2F00, 0, 16, 0x18}, /* XRX200_SDMA_PCTRL Ethernet SwitchStore DMA Port Control Register */
  3311. +// {0x2F00, 13, 2, 0x18}, /* XRX200_SDMA_PCTRL_DTHR Drop Threshold Selection */
  3312. +// {0x2F00, 11, 2, 0x18}, /* XRX200_SDMA_PCTRL_PTHR Pause Threshold Selection */
  3313. +// {0x2F00, 10, 1, 0x18}, /* XRX200_SDMA_PCTRL_PHYEFWD Forward PHY Error Frames */
  3314. +// {0x2F00, 9, 1, 0x18}, /* XRX200_SDMA_PCTRL_ALGFWD Forward Alignment Error Frames */
  3315. +// {0x2F00, 8, 1, 0x18}, /* XRX200_SDMA_PCTRL_LENFWD Forward Length Errored Frames */
  3316. +// {0x2F00, 7, 1, 0x18}, /* XRX200_SDMA_PCTRL_OSFWD Forward Oversized Frames */
  3317. +// {0x2F00, 6, 1, 0x18}, /* XRX200_SDMA_PCTRL_USFWD Forward Undersized Frames */
  3318. +// {0x2F00, 5, 1, 0x18}, /* XRX200_SDMA_PCTRL_FCSIGN Ignore FCS Errors */
  3319. +// {0x2F00, 4, 1, 0x18}, /* XRX200_SDMA_PCTRL_FCSFWD Forward FCS Errored Frames */
  3320. +// {0x2F00, 3, 1, 0x18}, /* XRX200_SDMA_PCTRL_PAUFWD Pause Frame Forwarding */
  3321. +// {0x2F00, 2, 1, 0x18}, /* XRX200_SDMA_PCTRL_MFCEN Metering Flow Control Enable */
  3322. +// {0x2F00, 1, 1, 0x18}, /* XRX200_SDMA_PCTRL_FCEN Flow Control Enable */
  3323. +// {0x2F00, 0, 1, 0x18}, /* XRX200_SDMA_PCTRL_PEN Port Enable */
  3324. +// {0x2F04, 0, 16, 0x18}, /* XRX200_SDMA_PRIO Ethernet SwitchStore DMA Port Priority Register */
  3325. +// {0x2F04, 0, 2, 0x18}, /* XRX200_SDMA_PRIO_PRIO SDMA PRIO */
  3326. +// {0x2F08, 0, 16, 0x18}, /* XRX200_SDMA_PSTAT0_HDR Ethernet SwitchStore DMA Port Status Register 0 */
  3327. +// {0x2F08, 0, 10, 0x18}, /* XRX200_SDMA_PSTAT0_HDR_PTR Port Ingress Queue Header Pointer */
  3328. +// {0x2F0C, 0, 16, 0x18}, /* XRX200_SDMA_PSTAT1 Ethernet SwitchStore DMA Port Status Register 1 */
  3329. +// {0x2F0C, 0, 10, 0x18}, /* XRX200_SDMA_PSTAT1_PPKT Port Ingress Packet Count */
  3330. +// {0x2F10, 0, 16, 0x18}, /* XRX200_SDMA_TSTAMP0 Ingress TimeStamp Register 0 */
  3331. +// {0x2F10, 0, 16, 0x18}, /* XRX200_SDMA_TSTAMP0_TSTL Time Stamp [15:0] */
  3332. +// {0x2F14, 0, 16, 0x18}, /* XRX200_SDMA_TSTAMP1 Ingress TimeStamp Register 1 */
  3333. +// {0x2F14, 0, 16, 0x18}, /* XRX200_SDMA_TSTAMP1_TSTH Time Stamp [31:16] */
  3334. +};
  3335. +
  3336. +