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

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