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

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