qed_int.c 92 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125
  1. /* QLogic qed NIC Driver
  2. * Copyright (c) 2015 QLogic Corporation
  3. *
  4. * This software is available under the terms of the GNU General Public License
  5. * (GPL) Version 2, available from the file COPYING in the main directory of
  6. * this source tree.
  7. */
  8. #include <linux/types.h>
  9. #include <asm/byteorder.h>
  10. #include <linux/io.h>
  11. #include <linux/bitops.h>
  12. #include <linux/delay.h>
  13. #include <linux/dma-mapping.h>
  14. #include <linux/errno.h>
  15. #include <linux/interrupt.h>
  16. #include <linux/kernel.h>
  17. #include <linux/pci.h>
  18. #include <linux/slab.h>
  19. #include <linux/string.h>
  20. #include "qed.h"
  21. #include "qed_hsi.h"
  22. #include "qed_hw.h"
  23. #include "qed_init_ops.h"
  24. #include "qed_int.h"
  25. #include "qed_mcp.h"
  26. #include "qed_reg_addr.h"
  27. #include "qed_sp.h"
  28. struct qed_pi_info {
  29. qed_int_comp_cb_t comp_cb;
  30. void *cookie;
  31. };
  32. struct qed_sb_sp_info {
  33. struct qed_sb_info sb_info;
  34. /* per protocol index data */
  35. struct qed_pi_info pi_info_arr[PIS_PER_SB];
  36. };
  37. enum qed_attention_type {
  38. QED_ATTN_TYPE_ATTN,
  39. QED_ATTN_TYPE_PARITY,
  40. };
  41. #define SB_ATTN_ALIGNED_SIZE(p_hwfn) \
  42. ALIGNED_TYPE_SIZE(struct atten_status_block, p_hwfn)
  43. struct aeu_invert_reg_bit {
  44. char bit_name[30];
  45. #define ATTENTION_PARITY (1 << 0)
  46. #define ATTENTION_LENGTH_MASK (0x00000ff0)
  47. #define ATTENTION_LENGTH_SHIFT (4)
  48. #define ATTENTION_LENGTH(flags) (((flags) & ATTENTION_LENGTH_MASK) >> \
  49. ATTENTION_LENGTH_SHIFT)
  50. #define ATTENTION_SINGLE (1 << ATTENTION_LENGTH_SHIFT)
  51. #define ATTENTION_PAR (ATTENTION_SINGLE | ATTENTION_PARITY)
  52. #define ATTENTION_PAR_INT ((2 << ATTENTION_LENGTH_SHIFT) | \
  53. ATTENTION_PARITY)
  54. /* Multiple bits start with this offset */
  55. #define ATTENTION_OFFSET_MASK (0x000ff000)
  56. #define ATTENTION_OFFSET_SHIFT (12)
  57. unsigned int flags;
  58. /* Callback to call if attention will be triggered */
  59. int (*cb)(struct qed_hwfn *p_hwfn);
  60. enum block_id block_index;
  61. };
  62. struct aeu_invert_reg {
  63. struct aeu_invert_reg_bit bits[32];
  64. };
  65. #define MAX_ATTN_GRPS (8)
  66. #define NUM_ATTN_REGS (9)
  67. /* HW Attention register */
  68. struct attn_hw_reg {
  69. u16 reg_idx; /* Index of this register in its block */
  70. u16 num_of_bits; /* number of valid attention bits */
  71. u32 sts_addr; /* Address of the STS register */
  72. u32 sts_clr_addr; /* Address of the STS_CLR register */
  73. u32 sts_wr_addr; /* Address of the STS_WR register */
  74. u32 mask_addr; /* Address of the MASK register */
  75. };
  76. /* HW block attention registers */
  77. struct attn_hw_regs {
  78. u16 num_of_int_regs; /* Number of interrupt regs */
  79. u16 num_of_prty_regs; /* Number of parity regs */
  80. struct attn_hw_reg **int_regs; /* interrupt regs */
  81. struct attn_hw_reg **prty_regs; /* parity regs */
  82. };
  83. /* HW block attention registers */
  84. struct attn_hw_block {
  85. const char *name; /* Block name */
  86. struct attn_hw_regs chip_regs[1];
  87. };
  88. static struct attn_hw_reg grc_int0_bb_b0 = {
  89. 0, 4, 0x50180, 0x5018c, 0x50188, 0x50184};
  90. static struct attn_hw_reg *grc_int_bb_b0_regs[1] = {
  91. &grc_int0_bb_b0};
  92. static struct attn_hw_reg grc_prty1_bb_b0 = {
  93. 0, 2, 0x50200, 0x5020c, 0x50208, 0x50204};
  94. static struct attn_hw_reg *grc_prty_bb_b0_regs[1] = {
  95. &grc_prty1_bb_b0};
  96. static struct attn_hw_reg miscs_int0_bb_b0 = {
  97. 0, 3, 0x9180, 0x918c, 0x9188, 0x9184};
  98. static struct attn_hw_reg miscs_int1_bb_b0 = {
  99. 1, 11, 0x9190, 0x919c, 0x9198, 0x9194};
  100. static struct attn_hw_reg *miscs_int_bb_b0_regs[2] = {
  101. &miscs_int0_bb_b0, &miscs_int1_bb_b0};
  102. static struct attn_hw_reg miscs_prty0_bb_b0 = {
  103. 0, 1, 0x91a0, 0x91ac, 0x91a8, 0x91a4};
  104. static struct attn_hw_reg *miscs_prty_bb_b0_regs[1] = {
  105. &miscs_prty0_bb_b0};
  106. static struct attn_hw_reg misc_int0_bb_b0 = {
  107. 0, 1, 0x8180, 0x818c, 0x8188, 0x8184};
  108. static struct attn_hw_reg *misc_int_bb_b0_regs[1] = {
  109. &misc_int0_bb_b0};
  110. static struct attn_hw_reg pglue_b_int0_bb_b0 = {
  111. 0, 23, 0x2a8180, 0x2a818c, 0x2a8188, 0x2a8184};
  112. static struct attn_hw_reg *pglue_b_int_bb_b0_regs[1] = {
  113. &pglue_b_int0_bb_b0};
  114. static struct attn_hw_reg pglue_b_prty0_bb_b0 = {
  115. 0, 1, 0x2a8190, 0x2a819c, 0x2a8198, 0x2a8194};
  116. static struct attn_hw_reg pglue_b_prty1_bb_b0 = {
  117. 1, 22, 0x2a8200, 0x2a820c, 0x2a8208, 0x2a8204};
  118. static struct attn_hw_reg *pglue_b_prty_bb_b0_regs[2] = {
  119. &pglue_b_prty0_bb_b0, &pglue_b_prty1_bb_b0};
  120. static struct attn_hw_reg cnig_int0_bb_b0 = {
  121. 0, 6, 0x2182e8, 0x2182f4, 0x2182f0, 0x2182ec};
  122. static struct attn_hw_reg *cnig_int_bb_b0_regs[1] = {
  123. &cnig_int0_bb_b0};
  124. static struct attn_hw_reg cnig_prty0_bb_b0 = {
  125. 0, 2, 0x218348, 0x218354, 0x218350, 0x21834c};
  126. static struct attn_hw_reg *cnig_prty_bb_b0_regs[1] = {
  127. &cnig_prty0_bb_b0};
  128. static struct attn_hw_reg cpmu_int0_bb_b0 = {
  129. 0, 1, 0x303e0, 0x303ec, 0x303e8, 0x303e4};
  130. static struct attn_hw_reg *cpmu_int_bb_b0_regs[1] = {
  131. &cpmu_int0_bb_b0};
  132. static struct attn_hw_reg ncsi_int0_bb_b0 = {
  133. 0, 1, 0x404cc, 0x404d8, 0x404d4, 0x404d0};
  134. static struct attn_hw_reg *ncsi_int_bb_b0_regs[1] = {
  135. &ncsi_int0_bb_b0};
  136. static struct attn_hw_reg ncsi_prty1_bb_b0 = {
  137. 0, 1, 0x40000, 0x4000c, 0x40008, 0x40004};
  138. static struct attn_hw_reg *ncsi_prty_bb_b0_regs[1] = {
  139. &ncsi_prty1_bb_b0};
  140. static struct attn_hw_reg opte_prty1_bb_b0 = {
  141. 0, 11, 0x53000, 0x5300c, 0x53008, 0x53004};
  142. static struct attn_hw_reg opte_prty0_bb_b0 = {
  143. 1, 1, 0x53208, 0x53214, 0x53210, 0x5320c};
  144. static struct attn_hw_reg *opte_prty_bb_b0_regs[2] = {
  145. &opte_prty1_bb_b0, &opte_prty0_bb_b0};
  146. static struct attn_hw_reg bmb_int0_bb_b0 = {
  147. 0, 16, 0x5400c0, 0x5400cc, 0x5400c8, 0x5400c4};
  148. static struct attn_hw_reg bmb_int1_bb_b0 = {
  149. 1, 28, 0x5400d8, 0x5400e4, 0x5400e0, 0x5400dc};
  150. static struct attn_hw_reg bmb_int2_bb_b0 = {
  151. 2, 26, 0x5400f0, 0x5400fc, 0x5400f8, 0x5400f4};
  152. static struct attn_hw_reg bmb_int3_bb_b0 = {
  153. 3, 31, 0x540108, 0x540114, 0x540110, 0x54010c};
  154. static struct attn_hw_reg bmb_int4_bb_b0 = {
  155. 4, 27, 0x540120, 0x54012c, 0x540128, 0x540124};
  156. static struct attn_hw_reg bmb_int5_bb_b0 = {
  157. 5, 29, 0x540138, 0x540144, 0x540140, 0x54013c};
  158. static struct attn_hw_reg bmb_int6_bb_b0 = {
  159. 6, 30, 0x540150, 0x54015c, 0x540158, 0x540154};
  160. static struct attn_hw_reg bmb_int7_bb_b0 = {
  161. 7, 32, 0x540168, 0x540174, 0x540170, 0x54016c};
  162. static struct attn_hw_reg bmb_int8_bb_b0 = {
  163. 8, 32, 0x540184, 0x540190, 0x54018c, 0x540188};
  164. static struct attn_hw_reg bmb_int9_bb_b0 = {
  165. 9, 32, 0x54019c, 0x5401a8, 0x5401a4, 0x5401a0};
  166. static struct attn_hw_reg bmb_int10_bb_b0 = {
  167. 10, 3, 0x5401b4, 0x5401c0, 0x5401bc, 0x5401b8};
  168. static struct attn_hw_reg bmb_int11_bb_b0 = {
  169. 11, 4, 0x5401cc, 0x5401d8, 0x5401d4, 0x5401d0};
  170. static struct attn_hw_reg *bmb_int_bb_b0_regs[12] = {
  171. &bmb_int0_bb_b0, &bmb_int1_bb_b0, &bmb_int2_bb_b0, &bmb_int3_bb_b0,
  172. &bmb_int4_bb_b0, &bmb_int5_bb_b0, &bmb_int6_bb_b0, &bmb_int7_bb_b0,
  173. &bmb_int8_bb_b0, &bmb_int9_bb_b0, &bmb_int10_bb_b0, &bmb_int11_bb_b0};
  174. static struct attn_hw_reg bmb_prty0_bb_b0 = {
  175. 0, 5, 0x5401dc, 0x5401e8, 0x5401e4, 0x5401e0};
  176. static struct attn_hw_reg bmb_prty1_bb_b0 = {
  177. 1, 31, 0x540400, 0x54040c, 0x540408, 0x540404};
  178. static struct attn_hw_reg bmb_prty2_bb_b0 = {
  179. 2, 15, 0x540410, 0x54041c, 0x540418, 0x540414};
  180. static struct attn_hw_reg *bmb_prty_bb_b0_regs[3] = {
  181. &bmb_prty0_bb_b0, &bmb_prty1_bb_b0, &bmb_prty2_bb_b0};
  182. static struct attn_hw_reg pcie_prty1_bb_b0 = {
  183. 0, 17, 0x54000, 0x5400c, 0x54008, 0x54004};
  184. static struct attn_hw_reg *pcie_prty_bb_b0_regs[1] = {
  185. &pcie_prty1_bb_b0};
  186. static struct attn_hw_reg mcp2_prty0_bb_b0 = {
  187. 0, 1, 0x52040, 0x5204c, 0x52048, 0x52044};
  188. static struct attn_hw_reg mcp2_prty1_bb_b0 = {
  189. 1, 12, 0x52204, 0x52210, 0x5220c, 0x52208};
  190. static struct attn_hw_reg *mcp2_prty_bb_b0_regs[2] = {
  191. &mcp2_prty0_bb_b0, &mcp2_prty1_bb_b0};
  192. static struct attn_hw_reg pswhst_int0_bb_b0 = {
  193. 0, 18, 0x2a0180, 0x2a018c, 0x2a0188, 0x2a0184};
  194. static struct attn_hw_reg *pswhst_int_bb_b0_regs[1] = {
  195. &pswhst_int0_bb_b0};
  196. static struct attn_hw_reg pswhst_prty0_bb_b0 = {
  197. 0, 1, 0x2a0190, 0x2a019c, 0x2a0198, 0x2a0194};
  198. static struct attn_hw_reg pswhst_prty1_bb_b0 = {
  199. 1, 17, 0x2a0200, 0x2a020c, 0x2a0208, 0x2a0204};
  200. static struct attn_hw_reg *pswhst_prty_bb_b0_regs[2] = {
  201. &pswhst_prty0_bb_b0, &pswhst_prty1_bb_b0};
  202. static struct attn_hw_reg pswhst2_int0_bb_b0 = {
  203. 0, 5, 0x29e180, 0x29e18c, 0x29e188, 0x29e184};
  204. static struct attn_hw_reg *pswhst2_int_bb_b0_regs[1] = {
  205. &pswhst2_int0_bb_b0};
  206. static struct attn_hw_reg pswhst2_prty0_bb_b0 = {
  207. 0, 1, 0x29e190, 0x29e19c, 0x29e198, 0x29e194};
  208. static struct attn_hw_reg *pswhst2_prty_bb_b0_regs[1] = {
  209. &pswhst2_prty0_bb_b0};
  210. static struct attn_hw_reg pswrd_int0_bb_b0 = {
  211. 0, 3, 0x29c180, 0x29c18c, 0x29c188, 0x29c184};
  212. static struct attn_hw_reg *pswrd_int_bb_b0_regs[1] = {
  213. &pswrd_int0_bb_b0};
  214. static struct attn_hw_reg pswrd_prty0_bb_b0 = {
  215. 0, 1, 0x29c190, 0x29c19c, 0x29c198, 0x29c194};
  216. static struct attn_hw_reg *pswrd_prty_bb_b0_regs[1] = {
  217. &pswrd_prty0_bb_b0};
  218. static struct attn_hw_reg pswrd2_int0_bb_b0 = {
  219. 0, 5, 0x29d180, 0x29d18c, 0x29d188, 0x29d184};
  220. static struct attn_hw_reg *pswrd2_int_bb_b0_regs[1] = {
  221. &pswrd2_int0_bb_b0};
  222. static struct attn_hw_reg pswrd2_prty0_bb_b0 = {
  223. 0, 1, 0x29d190, 0x29d19c, 0x29d198, 0x29d194};
  224. static struct attn_hw_reg pswrd2_prty1_bb_b0 = {
  225. 1, 31, 0x29d200, 0x29d20c, 0x29d208, 0x29d204};
  226. static struct attn_hw_reg pswrd2_prty2_bb_b0 = {
  227. 2, 3, 0x29d210, 0x29d21c, 0x29d218, 0x29d214};
  228. static struct attn_hw_reg *pswrd2_prty_bb_b0_regs[3] = {
  229. &pswrd2_prty0_bb_b0, &pswrd2_prty1_bb_b0, &pswrd2_prty2_bb_b0};
  230. static struct attn_hw_reg pswwr_int0_bb_b0 = {
  231. 0, 16, 0x29a180, 0x29a18c, 0x29a188, 0x29a184};
  232. static struct attn_hw_reg *pswwr_int_bb_b0_regs[1] = {
  233. &pswwr_int0_bb_b0};
  234. static struct attn_hw_reg pswwr_prty0_bb_b0 = {
  235. 0, 1, 0x29a190, 0x29a19c, 0x29a198, 0x29a194};
  236. static struct attn_hw_reg *pswwr_prty_bb_b0_regs[1] = {
  237. &pswwr_prty0_bb_b0};
  238. static struct attn_hw_reg pswwr2_int0_bb_b0 = {
  239. 0, 19, 0x29b180, 0x29b18c, 0x29b188, 0x29b184};
  240. static struct attn_hw_reg *pswwr2_int_bb_b0_regs[1] = {
  241. &pswwr2_int0_bb_b0};
  242. static struct attn_hw_reg pswwr2_prty0_bb_b0 = {
  243. 0, 1, 0x29b190, 0x29b19c, 0x29b198, 0x29b194};
  244. static struct attn_hw_reg pswwr2_prty1_bb_b0 = {
  245. 1, 31, 0x29b200, 0x29b20c, 0x29b208, 0x29b204};
  246. static struct attn_hw_reg pswwr2_prty2_bb_b0 = {
  247. 2, 31, 0x29b210, 0x29b21c, 0x29b218, 0x29b214};
  248. static struct attn_hw_reg pswwr2_prty3_bb_b0 = {
  249. 3, 31, 0x29b220, 0x29b22c, 0x29b228, 0x29b224};
  250. static struct attn_hw_reg pswwr2_prty4_bb_b0 = {
  251. 4, 20, 0x29b230, 0x29b23c, 0x29b238, 0x29b234};
  252. static struct attn_hw_reg *pswwr2_prty_bb_b0_regs[5] = {
  253. &pswwr2_prty0_bb_b0, &pswwr2_prty1_bb_b0, &pswwr2_prty2_bb_b0,
  254. &pswwr2_prty3_bb_b0, &pswwr2_prty4_bb_b0};
  255. static struct attn_hw_reg pswrq_int0_bb_b0 = {
  256. 0, 21, 0x280180, 0x28018c, 0x280188, 0x280184};
  257. static struct attn_hw_reg *pswrq_int_bb_b0_regs[1] = {
  258. &pswrq_int0_bb_b0};
  259. static struct attn_hw_reg pswrq_prty0_bb_b0 = {
  260. 0, 1, 0x280190, 0x28019c, 0x280198, 0x280194};
  261. static struct attn_hw_reg *pswrq_prty_bb_b0_regs[1] = {
  262. &pswrq_prty0_bb_b0};
  263. static struct attn_hw_reg pswrq2_int0_bb_b0 = {
  264. 0, 15, 0x240180, 0x24018c, 0x240188, 0x240184};
  265. static struct attn_hw_reg *pswrq2_int_bb_b0_regs[1] = {
  266. &pswrq2_int0_bb_b0};
  267. static struct attn_hw_reg pswrq2_prty1_bb_b0 = {
  268. 0, 9, 0x240200, 0x24020c, 0x240208, 0x240204};
  269. static struct attn_hw_reg *pswrq2_prty_bb_b0_regs[1] = {
  270. &pswrq2_prty1_bb_b0};
  271. static struct attn_hw_reg pglcs_int0_bb_b0 = {
  272. 0, 1, 0x1d00, 0x1d0c, 0x1d08, 0x1d04};
  273. static struct attn_hw_reg *pglcs_int_bb_b0_regs[1] = {
  274. &pglcs_int0_bb_b0};
  275. static struct attn_hw_reg dmae_int0_bb_b0 = {
  276. 0, 2, 0xc180, 0xc18c, 0xc188, 0xc184};
  277. static struct attn_hw_reg *dmae_int_bb_b0_regs[1] = {
  278. &dmae_int0_bb_b0};
  279. static struct attn_hw_reg dmae_prty1_bb_b0 = {
  280. 0, 3, 0xc200, 0xc20c, 0xc208, 0xc204};
  281. static struct attn_hw_reg *dmae_prty_bb_b0_regs[1] = {
  282. &dmae_prty1_bb_b0};
  283. static struct attn_hw_reg ptu_int0_bb_b0 = {
  284. 0, 8, 0x560180, 0x56018c, 0x560188, 0x560184};
  285. static struct attn_hw_reg *ptu_int_bb_b0_regs[1] = {
  286. &ptu_int0_bb_b0};
  287. static struct attn_hw_reg ptu_prty1_bb_b0 = {
  288. 0, 18, 0x560200, 0x56020c, 0x560208, 0x560204};
  289. static struct attn_hw_reg *ptu_prty_bb_b0_regs[1] = {
  290. &ptu_prty1_bb_b0};
  291. static struct attn_hw_reg tcm_int0_bb_b0 = {
  292. 0, 8, 0x1180180, 0x118018c, 0x1180188, 0x1180184};
  293. static struct attn_hw_reg tcm_int1_bb_b0 = {
  294. 1, 32, 0x1180190, 0x118019c, 0x1180198, 0x1180194};
  295. static struct attn_hw_reg tcm_int2_bb_b0 = {
  296. 2, 1, 0x11801a0, 0x11801ac, 0x11801a8, 0x11801a4};
  297. static struct attn_hw_reg *tcm_int_bb_b0_regs[3] = {
  298. &tcm_int0_bb_b0, &tcm_int1_bb_b0, &tcm_int2_bb_b0};
  299. static struct attn_hw_reg tcm_prty1_bb_b0 = {
  300. 0, 31, 0x1180200, 0x118020c, 0x1180208, 0x1180204};
  301. static struct attn_hw_reg tcm_prty2_bb_b0 = {
  302. 1, 2, 0x1180210, 0x118021c, 0x1180218, 0x1180214};
  303. static struct attn_hw_reg *tcm_prty_bb_b0_regs[2] = {
  304. &tcm_prty1_bb_b0, &tcm_prty2_bb_b0};
  305. static struct attn_hw_reg mcm_int0_bb_b0 = {
  306. 0, 14, 0x1200180, 0x120018c, 0x1200188, 0x1200184};
  307. static struct attn_hw_reg mcm_int1_bb_b0 = {
  308. 1, 26, 0x1200190, 0x120019c, 0x1200198, 0x1200194};
  309. static struct attn_hw_reg mcm_int2_bb_b0 = {
  310. 2, 1, 0x12001a0, 0x12001ac, 0x12001a8, 0x12001a4};
  311. static struct attn_hw_reg *mcm_int_bb_b0_regs[3] = {
  312. &mcm_int0_bb_b0, &mcm_int1_bb_b0, &mcm_int2_bb_b0};
  313. static struct attn_hw_reg mcm_prty1_bb_b0 = {
  314. 0, 31, 0x1200200, 0x120020c, 0x1200208, 0x1200204};
  315. static struct attn_hw_reg mcm_prty2_bb_b0 = {
  316. 1, 4, 0x1200210, 0x120021c, 0x1200218, 0x1200214};
  317. static struct attn_hw_reg *mcm_prty_bb_b0_regs[2] = {
  318. &mcm_prty1_bb_b0, &mcm_prty2_bb_b0};
  319. static struct attn_hw_reg ucm_int0_bb_b0 = {
  320. 0, 17, 0x1280180, 0x128018c, 0x1280188, 0x1280184};
  321. static struct attn_hw_reg ucm_int1_bb_b0 = {
  322. 1, 29, 0x1280190, 0x128019c, 0x1280198, 0x1280194};
  323. static struct attn_hw_reg ucm_int2_bb_b0 = {
  324. 2, 1, 0x12801a0, 0x12801ac, 0x12801a8, 0x12801a4};
  325. static struct attn_hw_reg *ucm_int_bb_b0_regs[3] = {
  326. &ucm_int0_bb_b0, &ucm_int1_bb_b0, &ucm_int2_bb_b0};
  327. static struct attn_hw_reg ucm_prty1_bb_b0 = {
  328. 0, 31, 0x1280200, 0x128020c, 0x1280208, 0x1280204};
  329. static struct attn_hw_reg ucm_prty2_bb_b0 = {
  330. 1, 7, 0x1280210, 0x128021c, 0x1280218, 0x1280214};
  331. static struct attn_hw_reg *ucm_prty_bb_b0_regs[2] = {
  332. &ucm_prty1_bb_b0, &ucm_prty2_bb_b0};
  333. static struct attn_hw_reg xcm_int0_bb_b0 = {
  334. 0, 16, 0x1000180, 0x100018c, 0x1000188, 0x1000184};
  335. static struct attn_hw_reg xcm_int1_bb_b0 = {
  336. 1, 25, 0x1000190, 0x100019c, 0x1000198, 0x1000194};
  337. static struct attn_hw_reg xcm_int2_bb_b0 = {
  338. 2, 8, 0x10001a0, 0x10001ac, 0x10001a8, 0x10001a4};
  339. static struct attn_hw_reg *xcm_int_bb_b0_regs[3] = {
  340. &xcm_int0_bb_b0, &xcm_int1_bb_b0, &xcm_int2_bb_b0};
  341. static struct attn_hw_reg xcm_prty1_bb_b0 = {
  342. 0, 31, 0x1000200, 0x100020c, 0x1000208, 0x1000204};
  343. static struct attn_hw_reg xcm_prty2_bb_b0 = {
  344. 1, 11, 0x1000210, 0x100021c, 0x1000218, 0x1000214};
  345. static struct attn_hw_reg *xcm_prty_bb_b0_regs[2] = {
  346. &xcm_prty1_bb_b0, &xcm_prty2_bb_b0};
  347. static struct attn_hw_reg ycm_int0_bb_b0 = {
  348. 0, 13, 0x1080180, 0x108018c, 0x1080188, 0x1080184};
  349. static struct attn_hw_reg ycm_int1_bb_b0 = {
  350. 1, 23, 0x1080190, 0x108019c, 0x1080198, 0x1080194};
  351. static struct attn_hw_reg ycm_int2_bb_b0 = {
  352. 2, 1, 0x10801a0, 0x10801ac, 0x10801a8, 0x10801a4};
  353. static struct attn_hw_reg *ycm_int_bb_b0_regs[3] = {
  354. &ycm_int0_bb_b0, &ycm_int1_bb_b0, &ycm_int2_bb_b0};
  355. static struct attn_hw_reg ycm_prty1_bb_b0 = {
  356. 0, 31, 0x1080200, 0x108020c, 0x1080208, 0x1080204};
  357. static struct attn_hw_reg ycm_prty2_bb_b0 = {
  358. 1, 3, 0x1080210, 0x108021c, 0x1080218, 0x1080214};
  359. static struct attn_hw_reg *ycm_prty_bb_b0_regs[2] = {
  360. &ycm_prty1_bb_b0, &ycm_prty2_bb_b0};
  361. static struct attn_hw_reg pcm_int0_bb_b0 = {
  362. 0, 5, 0x1100180, 0x110018c, 0x1100188, 0x1100184};
  363. static struct attn_hw_reg pcm_int1_bb_b0 = {
  364. 1, 14, 0x1100190, 0x110019c, 0x1100198, 0x1100194};
  365. static struct attn_hw_reg pcm_int2_bb_b0 = {
  366. 2, 1, 0x11001a0, 0x11001ac, 0x11001a8, 0x11001a4};
  367. static struct attn_hw_reg *pcm_int_bb_b0_regs[3] = {
  368. &pcm_int0_bb_b0, &pcm_int1_bb_b0, &pcm_int2_bb_b0};
  369. static struct attn_hw_reg pcm_prty1_bb_b0 = {
  370. 0, 11, 0x1100200, 0x110020c, 0x1100208, 0x1100204};
  371. static struct attn_hw_reg *pcm_prty_bb_b0_regs[1] = {
  372. &pcm_prty1_bb_b0};
  373. static struct attn_hw_reg qm_int0_bb_b0 = {
  374. 0, 22, 0x2f0180, 0x2f018c, 0x2f0188, 0x2f0184};
  375. static struct attn_hw_reg *qm_int_bb_b0_regs[1] = {
  376. &qm_int0_bb_b0};
  377. static struct attn_hw_reg qm_prty0_bb_b0 = {
  378. 0, 11, 0x2f0190, 0x2f019c, 0x2f0198, 0x2f0194};
  379. static struct attn_hw_reg qm_prty1_bb_b0 = {
  380. 1, 31, 0x2f0200, 0x2f020c, 0x2f0208, 0x2f0204};
  381. static struct attn_hw_reg qm_prty2_bb_b0 = {
  382. 2, 31, 0x2f0210, 0x2f021c, 0x2f0218, 0x2f0214};
  383. static struct attn_hw_reg qm_prty3_bb_b0 = {
  384. 3, 11, 0x2f0220, 0x2f022c, 0x2f0228, 0x2f0224};
  385. static struct attn_hw_reg *qm_prty_bb_b0_regs[4] = {
  386. &qm_prty0_bb_b0, &qm_prty1_bb_b0, &qm_prty2_bb_b0, &qm_prty3_bb_b0};
  387. static struct attn_hw_reg tm_int0_bb_b0 = {
  388. 0, 32, 0x2c0180, 0x2c018c, 0x2c0188, 0x2c0184};
  389. static struct attn_hw_reg tm_int1_bb_b0 = {
  390. 1, 11, 0x2c0190, 0x2c019c, 0x2c0198, 0x2c0194};
  391. static struct attn_hw_reg *tm_int_bb_b0_regs[2] = {
  392. &tm_int0_bb_b0, &tm_int1_bb_b0};
  393. static struct attn_hw_reg tm_prty1_bb_b0 = {
  394. 0, 17, 0x2c0200, 0x2c020c, 0x2c0208, 0x2c0204};
  395. static struct attn_hw_reg *tm_prty_bb_b0_regs[1] = {
  396. &tm_prty1_bb_b0};
  397. static struct attn_hw_reg dorq_int0_bb_b0 = {
  398. 0, 9, 0x100180, 0x10018c, 0x100188, 0x100184};
  399. static struct attn_hw_reg *dorq_int_bb_b0_regs[1] = {
  400. &dorq_int0_bb_b0};
  401. static struct attn_hw_reg dorq_prty0_bb_b0 = {
  402. 0, 1, 0x100190, 0x10019c, 0x100198, 0x100194};
  403. static struct attn_hw_reg dorq_prty1_bb_b0 = {
  404. 1, 6, 0x100200, 0x10020c, 0x100208, 0x100204};
  405. static struct attn_hw_reg *dorq_prty_bb_b0_regs[2] = {
  406. &dorq_prty0_bb_b0, &dorq_prty1_bb_b0};
  407. static struct attn_hw_reg brb_int0_bb_b0 = {
  408. 0, 32, 0x3400c0, 0x3400cc, 0x3400c8, 0x3400c4};
  409. static struct attn_hw_reg brb_int1_bb_b0 = {
  410. 1, 30, 0x3400d8, 0x3400e4, 0x3400e0, 0x3400dc};
  411. static struct attn_hw_reg brb_int2_bb_b0 = {
  412. 2, 28, 0x3400f0, 0x3400fc, 0x3400f8, 0x3400f4};
  413. static struct attn_hw_reg brb_int3_bb_b0 = {
  414. 3, 31, 0x340108, 0x340114, 0x340110, 0x34010c};
  415. static struct attn_hw_reg brb_int4_bb_b0 = {
  416. 4, 27, 0x340120, 0x34012c, 0x340128, 0x340124};
  417. static struct attn_hw_reg brb_int5_bb_b0 = {
  418. 5, 1, 0x340138, 0x340144, 0x340140, 0x34013c};
  419. static struct attn_hw_reg brb_int6_bb_b0 = {
  420. 6, 8, 0x340150, 0x34015c, 0x340158, 0x340154};
  421. static struct attn_hw_reg brb_int7_bb_b0 = {
  422. 7, 32, 0x340168, 0x340174, 0x340170, 0x34016c};
  423. static struct attn_hw_reg brb_int8_bb_b0 = {
  424. 8, 17, 0x340184, 0x340190, 0x34018c, 0x340188};
  425. static struct attn_hw_reg brb_int9_bb_b0 = {
  426. 9, 1, 0x34019c, 0x3401a8, 0x3401a4, 0x3401a0};
  427. static struct attn_hw_reg brb_int10_bb_b0 = {
  428. 10, 14, 0x3401b4, 0x3401c0, 0x3401bc, 0x3401b8};
  429. static struct attn_hw_reg brb_int11_bb_b0 = {
  430. 11, 8, 0x3401cc, 0x3401d8, 0x3401d4, 0x3401d0};
  431. static struct attn_hw_reg *brb_int_bb_b0_regs[12] = {
  432. &brb_int0_bb_b0, &brb_int1_bb_b0, &brb_int2_bb_b0, &brb_int3_bb_b0,
  433. &brb_int4_bb_b0, &brb_int5_bb_b0, &brb_int6_bb_b0, &brb_int7_bb_b0,
  434. &brb_int8_bb_b0, &brb_int9_bb_b0, &brb_int10_bb_b0, &brb_int11_bb_b0};
  435. static struct attn_hw_reg brb_prty0_bb_b0 = {
  436. 0, 5, 0x3401dc, 0x3401e8, 0x3401e4, 0x3401e0};
  437. static struct attn_hw_reg brb_prty1_bb_b0 = {
  438. 1, 31, 0x340400, 0x34040c, 0x340408, 0x340404};
  439. static struct attn_hw_reg brb_prty2_bb_b0 = {
  440. 2, 14, 0x340410, 0x34041c, 0x340418, 0x340414};
  441. static struct attn_hw_reg *brb_prty_bb_b0_regs[3] = {
  442. &brb_prty0_bb_b0, &brb_prty1_bb_b0, &brb_prty2_bb_b0};
  443. static struct attn_hw_reg src_int0_bb_b0 = {
  444. 0, 1, 0x2381d8, 0x2381dc, 0x2381e0, 0x2381e4};
  445. static struct attn_hw_reg *src_int_bb_b0_regs[1] = {
  446. &src_int0_bb_b0};
  447. static struct attn_hw_reg prs_int0_bb_b0 = {
  448. 0, 2, 0x1f0040, 0x1f004c, 0x1f0048, 0x1f0044};
  449. static struct attn_hw_reg *prs_int_bb_b0_regs[1] = {
  450. &prs_int0_bb_b0};
  451. static struct attn_hw_reg prs_prty0_bb_b0 = {
  452. 0, 2, 0x1f0050, 0x1f005c, 0x1f0058, 0x1f0054};
  453. static struct attn_hw_reg prs_prty1_bb_b0 = {
  454. 1, 31, 0x1f0204, 0x1f0210, 0x1f020c, 0x1f0208};
  455. static struct attn_hw_reg prs_prty2_bb_b0 = {
  456. 2, 5, 0x1f0214, 0x1f0220, 0x1f021c, 0x1f0218};
  457. static struct attn_hw_reg *prs_prty_bb_b0_regs[3] = {
  458. &prs_prty0_bb_b0, &prs_prty1_bb_b0, &prs_prty2_bb_b0};
  459. static struct attn_hw_reg tsdm_int0_bb_b0 = {
  460. 0, 26, 0xfb0040, 0xfb004c, 0xfb0048, 0xfb0044};
  461. static struct attn_hw_reg *tsdm_int_bb_b0_regs[1] = {
  462. &tsdm_int0_bb_b0};
  463. static struct attn_hw_reg tsdm_prty1_bb_b0 = {
  464. 0, 10, 0xfb0200, 0xfb020c, 0xfb0208, 0xfb0204};
  465. static struct attn_hw_reg *tsdm_prty_bb_b0_regs[1] = {
  466. &tsdm_prty1_bb_b0};
  467. static struct attn_hw_reg msdm_int0_bb_b0 = {
  468. 0, 26, 0xfc0040, 0xfc004c, 0xfc0048, 0xfc0044};
  469. static struct attn_hw_reg *msdm_int_bb_b0_regs[1] = {
  470. &msdm_int0_bb_b0};
  471. static struct attn_hw_reg msdm_prty1_bb_b0 = {
  472. 0, 11, 0xfc0200, 0xfc020c, 0xfc0208, 0xfc0204};
  473. static struct attn_hw_reg *msdm_prty_bb_b0_regs[1] = {
  474. &msdm_prty1_bb_b0};
  475. static struct attn_hw_reg usdm_int0_bb_b0 = {
  476. 0, 26, 0xfd0040, 0xfd004c, 0xfd0048, 0xfd0044};
  477. static struct attn_hw_reg *usdm_int_bb_b0_regs[1] = {
  478. &usdm_int0_bb_b0};
  479. static struct attn_hw_reg usdm_prty1_bb_b0 = {
  480. 0, 10, 0xfd0200, 0xfd020c, 0xfd0208, 0xfd0204};
  481. static struct attn_hw_reg *usdm_prty_bb_b0_regs[1] = {
  482. &usdm_prty1_bb_b0};
  483. static struct attn_hw_reg xsdm_int0_bb_b0 = {
  484. 0, 26, 0xf80040, 0xf8004c, 0xf80048, 0xf80044};
  485. static struct attn_hw_reg *xsdm_int_bb_b0_regs[1] = {
  486. &xsdm_int0_bb_b0};
  487. static struct attn_hw_reg xsdm_prty1_bb_b0 = {
  488. 0, 10, 0xf80200, 0xf8020c, 0xf80208, 0xf80204};
  489. static struct attn_hw_reg *xsdm_prty_bb_b0_regs[1] = {
  490. &xsdm_prty1_bb_b0};
  491. static struct attn_hw_reg ysdm_int0_bb_b0 = {
  492. 0, 26, 0xf90040, 0xf9004c, 0xf90048, 0xf90044};
  493. static struct attn_hw_reg *ysdm_int_bb_b0_regs[1] = {
  494. &ysdm_int0_bb_b0};
  495. static struct attn_hw_reg ysdm_prty1_bb_b0 = {
  496. 0, 9, 0xf90200, 0xf9020c, 0xf90208, 0xf90204};
  497. static struct attn_hw_reg *ysdm_prty_bb_b0_regs[1] = {
  498. &ysdm_prty1_bb_b0};
  499. static struct attn_hw_reg psdm_int0_bb_b0 = {
  500. 0, 26, 0xfa0040, 0xfa004c, 0xfa0048, 0xfa0044};
  501. static struct attn_hw_reg *psdm_int_bb_b0_regs[1] = {
  502. &psdm_int0_bb_b0};
  503. static struct attn_hw_reg psdm_prty1_bb_b0 = {
  504. 0, 9, 0xfa0200, 0xfa020c, 0xfa0208, 0xfa0204};
  505. static struct attn_hw_reg *psdm_prty_bb_b0_regs[1] = {
  506. &psdm_prty1_bb_b0};
  507. static struct attn_hw_reg tsem_int0_bb_b0 = {
  508. 0, 32, 0x1700040, 0x170004c, 0x1700048, 0x1700044};
  509. static struct attn_hw_reg tsem_int1_bb_b0 = {
  510. 1, 13, 0x1700050, 0x170005c, 0x1700058, 0x1700054};
  511. static struct attn_hw_reg tsem_fast_memory_int0_bb_b0 = {
  512. 2, 1, 0x1740040, 0x174004c, 0x1740048, 0x1740044};
  513. static struct attn_hw_reg *tsem_int_bb_b0_regs[3] = {
  514. &tsem_int0_bb_b0, &tsem_int1_bb_b0, &tsem_fast_memory_int0_bb_b0};
  515. static struct attn_hw_reg tsem_prty0_bb_b0 = {
  516. 0, 3, 0x17000c8, 0x17000d4, 0x17000d0, 0x17000cc};
  517. static struct attn_hw_reg tsem_prty1_bb_b0 = {
  518. 1, 6, 0x1700200, 0x170020c, 0x1700208, 0x1700204};
  519. static struct attn_hw_reg tsem_fast_memory_vfc_config_prty1_bb_b0 = {
  520. 2, 6, 0x174a200, 0x174a20c, 0x174a208, 0x174a204};
  521. static struct attn_hw_reg *tsem_prty_bb_b0_regs[3] = {
  522. &tsem_prty0_bb_b0, &tsem_prty1_bb_b0,
  523. &tsem_fast_memory_vfc_config_prty1_bb_b0};
  524. static struct attn_hw_reg msem_int0_bb_b0 = {
  525. 0, 32, 0x1800040, 0x180004c, 0x1800048, 0x1800044};
  526. static struct attn_hw_reg msem_int1_bb_b0 = {
  527. 1, 13, 0x1800050, 0x180005c, 0x1800058, 0x1800054};
  528. static struct attn_hw_reg msem_fast_memory_int0_bb_b0 = {
  529. 2, 1, 0x1840040, 0x184004c, 0x1840048, 0x1840044};
  530. static struct attn_hw_reg *msem_int_bb_b0_regs[3] = {
  531. &msem_int0_bb_b0, &msem_int1_bb_b0, &msem_fast_memory_int0_bb_b0};
  532. static struct attn_hw_reg msem_prty0_bb_b0 = {
  533. 0, 3, 0x18000c8, 0x18000d4, 0x18000d0, 0x18000cc};
  534. static struct attn_hw_reg msem_prty1_bb_b0 = {
  535. 1, 6, 0x1800200, 0x180020c, 0x1800208, 0x1800204};
  536. static struct attn_hw_reg *msem_prty_bb_b0_regs[2] = {
  537. &msem_prty0_bb_b0, &msem_prty1_bb_b0};
  538. static struct attn_hw_reg usem_int0_bb_b0 = {
  539. 0, 32, 0x1900040, 0x190004c, 0x1900048, 0x1900044};
  540. static struct attn_hw_reg usem_int1_bb_b0 = {
  541. 1, 13, 0x1900050, 0x190005c, 0x1900058, 0x1900054};
  542. static struct attn_hw_reg usem_fast_memory_int0_bb_b0 = {
  543. 2, 1, 0x1940040, 0x194004c, 0x1940048, 0x1940044};
  544. static struct attn_hw_reg *usem_int_bb_b0_regs[3] = {
  545. &usem_int0_bb_b0, &usem_int1_bb_b0, &usem_fast_memory_int0_bb_b0};
  546. static struct attn_hw_reg usem_prty0_bb_b0 = {
  547. 0, 3, 0x19000c8, 0x19000d4, 0x19000d0, 0x19000cc};
  548. static struct attn_hw_reg usem_prty1_bb_b0 = {
  549. 1, 6, 0x1900200, 0x190020c, 0x1900208, 0x1900204};
  550. static struct attn_hw_reg *usem_prty_bb_b0_regs[2] = {
  551. &usem_prty0_bb_b0, &usem_prty1_bb_b0};
  552. static struct attn_hw_reg xsem_int0_bb_b0 = {
  553. 0, 32, 0x1400040, 0x140004c, 0x1400048, 0x1400044};
  554. static struct attn_hw_reg xsem_int1_bb_b0 = {
  555. 1, 13, 0x1400050, 0x140005c, 0x1400058, 0x1400054};
  556. static struct attn_hw_reg xsem_fast_memory_int0_bb_b0 = {
  557. 2, 1, 0x1440040, 0x144004c, 0x1440048, 0x1440044};
  558. static struct attn_hw_reg *xsem_int_bb_b0_regs[3] = {
  559. &xsem_int0_bb_b0, &xsem_int1_bb_b0, &xsem_fast_memory_int0_bb_b0};
  560. static struct attn_hw_reg xsem_prty0_bb_b0 = {
  561. 0, 3, 0x14000c8, 0x14000d4, 0x14000d0, 0x14000cc};
  562. static struct attn_hw_reg xsem_prty1_bb_b0 = {
  563. 1, 7, 0x1400200, 0x140020c, 0x1400208, 0x1400204};
  564. static struct attn_hw_reg *xsem_prty_bb_b0_regs[2] = {
  565. &xsem_prty0_bb_b0, &xsem_prty1_bb_b0};
  566. static struct attn_hw_reg ysem_int0_bb_b0 = {
  567. 0, 32, 0x1500040, 0x150004c, 0x1500048, 0x1500044};
  568. static struct attn_hw_reg ysem_int1_bb_b0 = {
  569. 1, 13, 0x1500050, 0x150005c, 0x1500058, 0x1500054};
  570. static struct attn_hw_reg ysem_fast_memory_int0_bb_b0 = {
  571. 2, 1, 0x1540040, 0x154004c, 0x1540048, 0x1540044};
  572. static struct attn_hw_reg *ysem_int_bb_b0_regs[3] = {
  573. &ysem_int0_bb_b0, &ysem_int1_bb_b0, &ysem_fast_memory_int0_bb_b0};
  574. static struct attn_hw_reg ysem_prty0_bb_b0 = {
  575. 0, 3, 0x15000c8, 0x15000d4, 0x15000d0, 0x15000cc};
  576. static struct attn_hw_reg ysem_prty1_bb_b0 = {
  577. 1, 7, 0x1500200, 0x150020c, 0x1500208, 0x1500204};
  578. static struct attn_hw_reg *ysem_prty_bb_b0_regs[2] = {
  579. &ysem_prty0_bb_b0, &ysem_prty1_bb_b0};
  580. static struct attn_hw_reg psem_int0_bb_b0 = {
  581. 0, 32, 0x1600040, 0x160004c, 0x1600048, 0x1600044};
  582. static struct attn_hw_reg psem_int1_bb_b0 = {
  583. 1, 13, 0x1600050, 0x160005c, 0x1600058, 0x1600054};
  584. static struct attn_hw_reg psem_fast_memory_int0_bb_b0 = {
  585. 2, 1, 0x1640040, 0x164004c, 0x1640048, 0x1640044};
  586. static struct attn_hw_reg *psem_int_bb_b0_regs[3] = {
  587. &psem_int0_bb_b0, &psem_int1_bb_b0, &psem_fast_memory_int0_bb_b0};
  588. static struct attn_hw_reg psem_prty0_bb_b0 = {
  589. 0, 3, 0x16000c8, 0x16000d4, 0x16000d0, 0x16000cc};
  590. static struct attn_hw_reg psem_prty1_bb_b0 = {
  591. 1, 6, 0x1600200, 0x160020c, 0x1600208, 0x1600204};
  592. static struct attn_hw_reg psem_fast_memory_vfc_config_prty1_bb_b0 = {
  593. 2, 6, 0x164a200, 0x164a20c, 0x164a208, 0x164a204};
  594. static struct attn_hw_reg *psem_prty_bb_b0_regs[3] = {
  595. &psem_prty0_bb_b0, &psem_prty1_bb_b0,
  596. &psem_fast_memory_vfc_config_prty1_bb_b0};
  597. static struct attn_hw_reg rss_int0_bb_b0 = {
  598. 0, 12, 0x238980, 0x23898c, 0x238988, 0x238984};
  599. static struct attn_hw_reg *rss_int_bb_b0_regs[1] = {
  600. &rss_int0_bb_b0};
  601. static struct attn_hw_reg rss_prty1_bb_b0 = {
  602. 0, 4, 0x238a00, 0x238a0c, 0x238a08, 0x238a04};
  603. static struct attn_hw_reg *rss_prty_bb_b0_regs[1] = {
  604. &rss_prty1_bb_b0};
  605. static struct attn_hw_reg tmld_int0_bb_b0 = {
  606. 0, 6, 0x4d0180, 0x4d018c, 0x4d0188, 0x4d0184};
  607. static struct attn_hw_reg *tmld_int_bb_b0_regs[1] = {
  608. &tmld_int0_bb_b0};
  609. static struct attn_hw_reg tmld_prty1_bb_b0 = {
  610. 0, 8, 0x4d0200, 0x4d020c, 0x4d0208, 0x4d0204};
  611. static struct attn_hw_reg *tmld_prty_bb_b0_regs[1] = {
  612. &tmld_prty1_bb_b0};
  613. static struct attn_hw_reg muld_int0_bb_b0 = {
  614. 0, 6, 0x4e0180, 0x4e018c, 0x4e0188, 0x4e0184};
  615. static struct attn_hw_reg *muld_int_bb_b0_regs[1] = {
  616. &muld_int0_bb_b0};
  617. static struct attn_hw_reg muld_prty1_bb_b0 = {
  618. 0, 10, 0x4e0200, 0x4e020c, 0x4e0208, 0x4e0204};
  619. static struct attn_hw_reg *muld_prty_bb_b0_regs[1] = {
  620. &muld_prty1_bb_b0};
  621. static struct attn_hw_reg yuld_int0_bb_b0 = {
  622. 0, 6, 0x4c8180, 0x4c818c, 0x4c8188, 0x4c8184};
  623. static struct attn_hw_reg *yuld_int_bb_b0_regs[1] = {
  624. &yuld_int0_bb_b0};
  625. static struct attn_hw_reg yuld_prty1_bb_b0 = {
  626. 0, 6, 0x4c8200, 0x4c820c, 0x4c8208, 0x4c8204};
  627. static struct attn_hw_reg *yuld_prty_bb_b0_regs[1] = {
  628. &yuld_prty1_bb_b0};
  629. static struct attn_hw_reg xyld_int0_bb_b0 = {
  630. 0, 6, 0x4c0180, 0x4c018c, 0x4c0188, 0x4c0184};
  631. static struct attn_hw_reg *xyld_int_bb_b0_regs[1] = {
  632. &xyld_int0_bb_b0};
  633. static struct attn_hw_reg xyld_prty1_bb_b0 = {
  634. 0, 9, 0x4c0200, 0x4c020c, 0x4c0208, 0x4c0204};
  635. static struct attn_hw_reg *xyld_prty_bb_b0_regs[1] = {
  636. &xyld_prty1_bb_b0};
  637. static struct attn_hw_reg prm_int0_bb_b0 = {
  638. 0, 11, 0x230040, 0x23004c, 0x230048, 0x230044};
  639. static struct attn_hw_reg *prm_int_bb_b0_regs[1] = {
  640. &prm_int0_bb_b0};
  641. static struct attn_hw_reg prm_prty0_bb_b0 = {
  642. 0, 1, 0x230050, 0x23005c, 0x230058, 0x230054};
  643. static struct attn_hw_reg prm_prty1_bb_b0 = {
  644. 1, 24, 0x230200, 0x23020c, 0x230208, 0x230204};
  645. static struct attn_hw_reg *prm_prty_bb_b0_regs[2] = {
  646. &prm_prty0_bb_b0, &prm_prty1_bb_b0};
  647. static struct attn_hw_reg pbf_pb1_int0_bb_b0 = {
  648. 0, 9, 0xda0040, 0xda004c, 0xda0048, 0xda0044};
  649. static struct attn_hw_reg *pbf_pb1_int_bb_b0_regs[1] = {
  650. &pbf_pb1_int0_bb_b0};
  651. static struct attn_hw_reg pbf_pb1_prty0_bb_b0 = {
  652. 0, 1, 0xda0050, 0xda005c, 0xda0058, 0xda0054};
  653. static struct attn_hw_reg *pbf_pb1_prty_bb_b0_regs[1] = {
  654. &pbf_pb1_prty0_bb_b0};
  655. static struct attn_hw_reg pbf_pb2_int0_bb_b0 = {
  656. 0, 9, 0xda4040, 0xda404c, 0xda4048, 0xda4044};
  657. static struct attn_hw_reg *pbf_pb2_int_bb_b0_regs[1] = {
  658. &pbf_pb2_int0_bb_b0};
  659. static struct attn_hw_reg pbf_pb2_prty0_bb_b0 = {
  660. 0, 1, 0xda4050, 0xda405c, 0xda4058, 0xda4054};
  661. static struct attn_hw_reg *pbf_pb2_prty_bb_b0_regs[1] = {
  662. &pbf_pb2_prty0_bb_b0};
  663. static struct attn_hw_reg rpb_int0_bb_b0 = {
  664. 0, 9, 0x23c040, 0x23c04c, 0x23c048, 0x23c044};
  665. static struct attn_hw_reg *rpb_int_bb_b0_regs[1] = {
  666. &rpb_int0_bb_b0};
  667. static struct attn_hw_reg rpb_prty0_bb_b0 = {
  668. 0, 1, 0x23c050, 0x23c05c, 0x23c058, 0x23c054};
  669. static struct attn_hw_reg *rpb_prty_bb_b0_regs[1] = {
  670. &rpb_prty0_bb_b0};
  671. static struct attn_hw_reg btb_int0_bb_b0 = {
  672. 0, 16, 0xdb00c0, 0xdb00cc, 0xdb00c8, 0xdb00c4};
  673. static struct attn_hw_reg btb_int1_bb_b0 = {
  674. 1, 16, 0xdb00d8, 0xdb00e4, 0xdb00e0, 0xdb00dc};
  675. static struct attn_hw_reg btb_int2_bb_b0 = {
  676. 2, 4, 0xdb00f0, 0xdb00fc, 0xdb00f8, 0xdb00f4};
  677. static struct attn_hw_reg btb_int3_bb_b0 = {
  678. 3, 32, 0xdb0108, 0xdb0114, 0xdb0110, 0xdb010c};
  679. static struct attn_hw_reg btb_int4_bb_b0 = {
  680. 4, 23, 0xdb0120, 0xdb012c, 0xdb0128, 0xdb0124};
  681. static struct attn_hw_reg btb_int5_bb_b0 = {
  682. 5, 32, 0xdb0138, 0xdb0144, 0xdb0140, 0xdb013c};
  683. static struct attn_hw_reg btb_int6_bb_b0 = {
  684. 6, 1, 0xdb0150, 0xdb015c, 0xdb0158, 0xdb0154};
  685. static struct attn_hw_reg btb_int8_bb_b0 = {
  686. 7, 1, 0xdb0184, 0xdb0190, 0xdb018c, 0xdb0188};
  687. static struct attn_hw_reg btb_int9_bb_b0 = {
  688. 8, 1, 0xdb019c, 0xdb01a8, 0xdb01a4, 0xdb01a0};
  689. static struct attn_hw_reg btb_int10_bb_b0 = {
  690. 9, 1, 0xdb01b4, 0xdb01c0, 0xdb01bc, 0xdb01b8};
  691. static struct attn_hw_reg btb_int11_bb_b0 = {
  692. 10, 2, 0xdb01cc, 0xdb01d8, 0xdb01d4, 0xdb01d0};
  693. static struct attn_hw_reg *btb_int_bb_b0_regs[11] = {
  694. &btb_int0_bb_b0, &btb_int1_bb_b0, &btb_int2_bb_b0, &btb_int3_bb_b0,
  695. &btb_int4_bb_b0, &btb_int5_bb_b0, &btb_int6_bb_b0, &btb_int8_bb_b0,
  696. &btb_int9_bb_b0, &btb_int10_bb_b0, &btb_int11_bb_b0};
  697. static struct attn_hw_reg btb_prty0_bb_b0 = {
  698. 0, 5, 0xdb01dc, 0xdb01e8, 0xdb01e4, 0xdb01e0};
  699. static struct attn_hw_reg btb_prty1_bb_b0 = {
  700. 1, 23, 0xdb0400, 0xdb040c, 0xdb0408, 0xdb0404};
  701. static struct attn_hw_reg *btb_prty_bb_b0_regs[2] = {
  702. &btb_prty0_bb_b0, &btb_prty1_bb_b0};
  703. static struct attn_hw_reg pbf_int0_bb_b0 = {
  704. 0, 1, 0xd80180, 0xd8018c, 0xd80188, 0xd80184};
  705. static struct attn_hw_reg *pbf_int_bb_b0_regs[1] = {
  706. &pbf_int0_bb_b0};
  707. static struct attn_hw_reg pbf_prty0_bb_b0 = {
  708. 0, 1, 0xd80190, 0xd8019c, 0xd80198, 0xd80194};
  709. static struct attn_hw_reg pbf_prty1_bb_b0 = {
  710. 1, 31, 0xd80200, 0xd8020c, 0xd80208, 0xd80204};
  711. static struct attn_hw_reg pbf_prty2_bb_b0 = {
  712. 2, 27, 0xd80210, 0xd8021c, 0xd80218, 0xd80214};
  713. static struct attn_hw_reg *pbf_prty_bb_b0_regs[3] = {
  714. &pbf_prty0_bb_b0, &pbf_prty1_bb_b0, &pbf_prty2_bb_b0};
  715. static struct attn_hw_reg rdif_int0_bb_b0 = {
  716. 0, 8, 0x300180, 0x30018c, 0x300188, 0x300184};
  717. static struct attn_hw_reg *rdif_int_bb_b0_regs[1] = {
  718. &rdif_int0_bb_b0};
  719. static struct attn_hw_reg rdif_prty0_bb_b0 = {
  720. 0, 1, 0x300190, 0x30019c, 0x300198, 0x300194};
  721. static struct attn_hw_reg *rdif_prty_bb_b0_regs[1] = {
  722. &rdif_prty0_bb_b0};
  723. static struct attn_hw_reg tdif_int0_bb_b0 = {
  724. 0, 8, 0x310180, 0x31018c, 0x310188, 0x310184};
  725. static struct attn_hw_reg *tdif_int_bb_b0_regs[1] = {
  726. &tdif_int0_bb_b0};
  727. static struct attn_hw_reg tdif_prty0_bb_b0 = {
  728. 0, 1, 0x310190, 0x31019c, 0x310198, 0x310194};
  729. static struct attn_hw_reg tdif_prty1_bb_b0 = {
  730. 1, 11, 0x310200, 0x31020c, 0x310208, 0x310204};
  731. static struct attn_hw_reg *tdif_prty_bb_b0_regs[2] = {
  732. &tdif_prty0_bb_b0, &tdif_prty1_bb_b0};
  733. static struct attn_hw_reg cdu_int0_bb_b0 = {
  734. 0, 8, 0x5801c0, 0x5801c4, 0x5801c8, 0x5801cc};
  735. static struct attn_hw_reg *cdu_int_bb_b0_regs[1] = {
  736. &cdu_int0_bb_b0};
  737. static struct attn_hw_reg cdu_prty1_bb_b0 = {
  738. 0, 5, 0x580200, 0x58020c, 0x580208, 0x580204};
  739. static struct attn_hw_reg *cdu_prty_bb_b0_regs[1] = {
  740. &cdu_prty1_bb_b0};
  741. static struct attn_hw_reg ccfc_int0_bb_b0 = {
  742. 0, 2, 0x2e0180, 0x2e018c, 0x2e0188, 0x2e0184};
  743. static struct attn_hw_reg *ccfc_int_bb_b0_regs[1] = {
  744. &ccfc_int0_bb_b0};
  745. static struct attn_hw_reg ccfc_prty1_bb_b0 = {
  746. 0, 2, 0x2e0200, 0x2e020c, 0x2e0208, 0x2e0204};
  747. static struct attn_hw_reg ccfc_prty0_bb_b0 = {
  748. 1, 6, 0x2e05e4, 0x2e05f0, 0x2e05ec, 0x2e05e8};
  749. static struct attn_hw_reg *ccfc_prty_bb_b0_regs[2] = {
  750. &ccfc_prty1_bb_b0, &ccfc_prty0_bb_b0};
  751. static struct attn_hw_reg tcfc_int0_bb_b0 = {
  752. 0, 2, 0x2d0180, 0x2d018c, 0x2d0188, 0x2d0184};
  753. static struct attn_hw_reg *tcfc_int_bb_b0_regs[1] = {
  754. &tcfc_int0_bb_b0};
  755. static struct attn_hw_reg tcfc_prty1_bb_b0 = {
  756. 0, 2, 0x2d0200, 0x2d020c, 0x2d0208, 0x2d0204};
  757. static struct attn_hw_reg tcfc_prty0_bb_b0 = {
  758. 1, 6, 0x2d05e4, 0x2d05f0, 0x2d05ec, 0x2d05e8};
  759. static struct attn_hw_reg *tcfc_prty_bb_b0_regs[2] = {
  760. &tcfc_prty1_bb_b0, &tcfc_prty0_bb_b0};
  761. static struct attn_hw_reg igu_int0_bb_b0 = {
  762. 0, 11, 0x180180, 0x18018c, 0x180188, 0x180184};
  763. static struct attn_hw_reg *igu_int_bb_b0_regs[1] = {
  764. &igu_int0_bb_b0};
  765. static struct attn_hw_reg igu_prty0_bb_b0 = {
  766. 0, 1, 0x180190, 0x18019c, 0x180198, 0x180194};
  767. static struct attn_hw_reg igu_prty1_bb_b0 = {
  768. 1, 31, 0x180200, 0x18020c, 0x180208, 0x180204};
  769. static struct attn_hw_reg igu_prty2_bb_b0 = {
  770. 2, 1, 0x180210, 0x18021c, 0x180218, 0x180214};
  771. static struct attn_hw_reg *igu_prty_bb_b0_regs[3] = {
  772. &igu_prty0_bb_b0, &igu_prty1_bb_b0, &igu_prty2_bb_b0};
  773. static struct attn_hw_reg cau_int0_bb_b0 = {
  774. 0, 11, 0x1c00d4, 0x1c00d8, 0x1c00dc, 0x1c00e0};
  775. static struct attn_hw_reg *cau_int_bb_b0_regs[1] = {
  776. &cau_int0_bb_b0};
  777. static struct attn_hw_reg cau_prty1_bb_b0 = {
  778. 0, 13, 0x1c0200, 0x1c020c, 0x1c0208, 0x1c0204};
  779. static struct attn_hw_reg *cau_prty_bb_b0_regs[1] = {
  780. &cau_prty1_bb_b0};
  781. static struct attn_hw_reg dbg_int0_bb_b0 = {
  782. 0, 1, 0x10180, 0x1018c, 0x10188, 0x10184};
  783. static struct attn_hw_reg *dbg_int_bb_b0_regs[1] = {
  784. &dbg_int0_bb_b0};
  785. static struct attn_hw_reg dbg_prty1_bb_b0 = {
  786. 0, 1, 0x10200, 0x1020c, 0x10208, 0x10204};
  787. static struct attn_hw_reg *dbg_prty_bb_b0_regs[1] = {
  788. &dbg_prty1_bb_b0};
  789. static struct attn_hw_reg nig_int0_bb_b0 = {
  790. 0, 12, 0x500040, 0x50004c, 0x500048, 0x500044};
  791. static struct attn_hw_reg nig_int1_bb_b0 = {
  792. 1, 32, 0x500050, 0x50005c, 0x500058, 0x500054};
  793. static struct attn_hw_reg nig_int2_bb_b0 = {
  794. 2, 20, 0x500060, 0x50006c, 0x500068, 0x500064};
  795. static struct attn_hw_reg nig_int3_bb_b0 = {
  796. 3, 18, 0x500070, 0x50007c, 0x500078, 0x500074};
  797. static struct attn_hw_reg nig_int4_bb_b0 = {
  798. 4, 20, 0x500080, 0x50008c, 0x500088, 0x500084};
  799. static struct attn_hw_reg nig_int5_bb_b0 = {
  800. 5, 18, 0x500090, 0x50009c, 0x500098, 0x500094};
  801. static struct attn_hw_reg *nig_int_bb_b0_regs[6] = {
  802. &nig_int0_bb_b0, &nig_int1_bb_b0, &nig_int2_bb_b0, &nig_int3_bb_b0,
  803. &nig_int4_bb_b0, &nig_int5_bb_b0};
  804. static struct attn_hw_reg nig_prty0_bb_b0 = {
  805. 0, 1, 0x5000a0, 0x5000ac, 0x5000a8, 0x5000a4};
  806. static struct attn_hw_reg nig_prty1_bb_b0 = {
  807. 1, 31, 0x500200, 0x50020c, 0x500208, 0x500204};
  808. static struct attn_hw_reg nig_prty2_bb_b0 = {
  809. 2, 31, 0x500210, 0x50021c, 0x500218, 0x500214};
  810. static struct attn_hw_reg nig_prty3_bb_b0 = {
  811. 3, 31, 0x500220, 0x50022c, 0x500228, 0x500224};
  812. static struct attn_hw_reg nig_prty4_bb_b0 = {
  813. 4, 17, 0x500230, 0x50023c, 0x500238, 0x500234};
  814. static struct attn_hw_reg *nig_prty_bb_b0_regs[5] = {
  815. &nig_prty0_bb_b0, &nig_prty1_bb_b0, &nig_prty2_bb_b0,
  816. &nig_prty3_bb_b0, &nig_prty4_bb_b0};
  817. static struct attn_hw_reg ipc_int0_bb_b0 = {
  818. 0, 13, 0x2050c, 0x20518, 0x20514, 0x20510};
  819. static struct attn_hw_reg *ipc_int_bb_b0_regs[1] = {
  820. &ipc_int0_bb_b0};
  821. static struct attn_hw_reg ipc_prty0_bb_b0 = {
  822. 0, 1, 0x2051c, 0x20528, 0x20524, 0x20520};
  823. static struct attn_hw_reg *ipc_prty_bb_b0_regs[1] = {
  824. &ipc_prty0_bb_b0};
  825. static struct attn_hw_block attn_blocks[] = {
  826. {"grc", {{1, 1, grc_int_bb_b0_regs, grc_prty_bb_b0_regs} } },
  827. {"miscs", {{2, 1, miscs_int_bb_b0_regs, miscs_prty_bb_b0_regs} } },
  828. {"misc", {{1, 0, misc_int_bb_b0_regs, NULL} } },
  829. {"dbu", {{0, 0, NULL, NULL} } },
  830. {"pglue_b", {{1, 2, pglue_b_int_bb_b0_regs,
  831. pglue_b_prty_bb_b0_regs} } },
  832. {"cnig", {{1, 1, cnig_int_bb_b0_regs, cnig_prty_bb_b0_regs} } },
  833. {"cpmu", {{1, 0, cpmu_int_bb_b0_regs, NULL} } },
  834. {"ncsi", {{1, 1, ncsi_int_bb_b0_regs, ncsi_prty_bb_b0_regs} } },
  835. {"opte", {{0, 2, NULL, opte_prty_bb_b0_regs} } },
  836. {"bmb", {{12, 3, bmb_int_bb_b0_regs, bmb_prty_bb_b0_regs} } },
  837. {"pcie", {{0, 1, NULL, pcie_prty_bb_b0_regs} } },
  838. {"mcp", {{0, 0, NULL, NULL} } },
  839. {"mcp2", {{0, 2, NULL, mcp2_prty_bb_b0_regs} } },
  840. {"pswhst", {{1, 2, pswhst_int_bb_b0_regs, pswhst_prty_bb_b0_regs} } },
  841. {"pswhst2", {{1, 1, pswhst2_int_bb_b0_regs,
  842. pswhst2_prty_bb_b0_regs} } },
  843. {"pswrd", {{1, 1, pswrd_int_bb_b0_regs, pswrd_prty_bb_b0_regs} } },
  844. {"pswrd2", {{1, 3, pswrd2_int_bb_b0_regs, pswrd2_prty_bb_b0_regs} } },
  845. {"pswwr", {{1, 1, pswwr_int_bb_b0_regs, pswwr_prty_bb_b0_regs} } },
  846. {"pswwr2", {{1, 5, pswwr2_int_bb_b0_regs, pswwr2_prty_bb_b0_regs} } },
  847. {"pswrq", {{1, 1, pswrq_int_bb_b0_regs, pswrq_prty_bb_b0_regs} } },
  848. {"pswrq2", {{1, 1, pswrq2_int_bb_b0_regs, pswrq2_prty_bb_b0_regs} } },
  849. {"pglcs", {{1, 0, pglcs_int_bb_b0_regs, NULL} } },
  850. {"dmae", {{1, 1, dmae_int_bb_b0_regs, dmae_prty_bb_b0_regs} } },
  851. {"ptu", {{1, 1, ptu_int_bb_b0_regs, ptu_prty_bb_b0_regs} } },
  852. {"tcm", {{3, 2, tcm_int_bb_b0_regs, tcm_prty_bb_b0_regs} } },
  853. {"mcm", {{3, 2, mcm_int_bb_b0_regs, mcm_prty_bb_b0_regs} } },
  854. {"ucm", {{3, 2, ucm_int_bb_b0_regs, ucm_prty_bb_b0_regs} } },
  855. {"xcm", {{3, 2, xcm_int_bb_b0_regs, xcm_prty_bb_b0_regs} } },
  856. {"ycm", {{3, 2, ycm_int_bb_b0_regs, ycm_prty_bb_b0_regs} } },
  857. {"pcm", {{3, 1, pcm_int_bb_b0_regs, pcm_prty_bb_b0_regs} } },
  858. {"qm", {{1, 4, qm_int_bb_b0_regs, qm_prty_bb_b0_regs} } },
  859. {"tm", {{2, 1, tm_int_bb_b0_regs, tm_prty_bb_b0_regs} } },
  860. {"dorq", {{1, 2, dorq_int_bb_b0_regs, dorq_prty_bb_b0_regs} } },
  861. {"brb", {{12, 3, brb_int_bb_b0_regs, brb_prty_bb_b0_regs} } },
  862. {"src", {{1, 0, src_int_bb_b0_regs, NULL} } },
  863. {"prs", {{1, 3, prs_int_bb_b0_regs, prs_prty_bb_b0_regs} } },
  864. {"tsdm", {{1, 1, tsdm_int_bb_b0_regs, tsdm_prty_bb_b0_regs} } },
  865. {"msdm", {{1, 1, msdm_int_bb_b0_regs, msdm_prty_bb_b0_regs} } },
  866. {"usdm", {{1, 1, usdm_int_bb_b0_regs, usdm_prty_bb_b0_regs} } },
  867. {"xsdm", {{1, 1, xsdm_int_bb_b0_regs, xsdm_prty_bb_b0_regs} } },
  868. {"ysdm", {{1, 1, ysdm_int_bb_b0_regs, ysdm_prty_bb_b0_regs} } },
  869. {"psdm", {{1, 1, psdm_int_bb_b0_regs, psdm_prty_bb_b0_regs} } },
  870. {"tsem", {{3, 3, tsem_int_bb_b0_regs, tsem_prty_bb_b0_regs} } },
  871. {"msem", {{3, 2, msem_int_bb_b0_regs, msem_prty_bb_b0_regs} } },
  872. {"usem", {{3, 2, usem_int_bb_b0_regs, usem_prty_bb_b0_regs} } },
  873. {"xsem", {{3, 2, xsem_int_bb_b0_regs, xsem_prty_bb_b0_regs} } },
  874. {"ysem", {{3, 2, ysem_int_bb_b0_regs, ysem_prty_bb_b0_regs} } },
  875. {"psem", {{3, 3, psem_int_bb_b0_regs, psem_prty_bb_b0_regs} } },
  876. {"rss", {{1, 1, rss_int_bb_b0_regs, rss_prty_bb_b0_regs} } },
  877. {"tmld", {{1, 1, tmld_int_bb_b0_regs, tmld_prty_bb_b0_regs} } },
  878. {"muld", {{1, 1, muld_int_bb_b0_regs, muld_prty_bb_b0_regs} } },
  879. {"yuld", {{1, 1, yuld_int_bb_b0_regs, yuld_prty_bb_b0_regs} } },
  880. {"xyld", {{1, 1, xyld_int_bb_b0_regs, xyld_prty_bb_b0_regs} } },
  881. {"prm", {{1, 2, prm_int_bb_b0_regs, prm_prty_bb_b0_regs} } },
  882. {"pbf_pb1", {{1, 1, pbf_pb1_int_bb_b0_regs,
  883. pbf_pb1_prty_bb_b0_regs} } },
  884. {"pbf_pb2", {{1, 1, pbf_pb2_int_bb_b0_regs,
  885. pbf_pb2_prty_bb_b0_regs} } },
  886. {"rpb", { {1, 1, rpb_int_bb_b0_regs, rpb_prty_bb_b0_regs} } },
  887. {"btb", { {11, 2, btb_int_bb_b0_regs, btb_prty_bb_b0_regs} } },
  888. {"pbf", { {1, 3, pbf_int_bb_b0_regs, pbf_prty_bb_b0_regs} } },
  889. {"rdif", { {1, 1, rdif_int_bb_b0_regs, rdif_prty_bb_b0_regs} } },
  890. {"tdif", { {1, 2, tdif_int_bb_b0_regs, tdif_prty_bb_b0_regs} } },
  891. {"cdu", { {1, 1, cdu_int_bb_b0_regs, cdu_prty_bb_b0_regs} } },
  892. {"ccfc", { {1, 2, ccfc_int_bb_b0_regs, ccfc_prty_bb_b0_regs} } },
  893. {"tcfc", { {1, 2, tcfc_int_bb_b0_regs, tcfc_prty_bb_b0_regs} } },
  894. {"igu", { {1, 3, igu_int_bb_b0_regs, igu_prty_bb_b0_regs} } },
  895. {"cau", { {1, 1, cau_int_bb_b0_regs, cau_prty_bb_b0_regs} } },
  896. {"umac", { {0, 0, NULL, NULL} } },
  897. {"xmac", { {0, 0, NULL, NULL} } },
  898. {"dbg", { {1, 1, dbg_int_bb_b0_regs, dbg_prty_bb_b0_regs} } },
  899. {"nig", { {6, 5, nig_int_bb_b0_regs, nig_prty_bb_b0_regs} } },
  900. {"wol", { {0, 0, NULL, NULL} } },
  901. {"bmbn", { {0, 0, NULL, NULL} } },
  902. {"ipc", { {1, 1, ipc_int_bb_b0_regs, ipc_prty_bb_b0_regs} } },
  903. {"nwm", { {0, 0, NULL, NULL} } },
  904. {"nws", { {0, 0, NULL, NULL} } },
  905. {"ms", { {0, 0, NULL, NULL} } },
  906. {"phy_pcie", { {0, 0, NULL, NULL} } },
  907. {"misc_aeu", { {0, 0, NULL, NULL} } },
  908. {"bar0_map", { {0, 0, NULL, NULL} } },};
  909. /* Specific HW attention callbacks */
  910. static int qed_mcp_attn_cb(struct qed_hwfn *p_hwfn)
  911. {
  912. u32 tmp = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt, MCP_REG_CPU_STATE);
  913. /* This might occur on certain instances; Log it once then mask it */
  914. DP_INFO(p_hwfn->cdev, "MCP_REG_CPU_STATE: %08x - Masking...\n",
  915. tmp);
  916. qed_wr(p_hwfn, p_hwfn->p_dpc_ptt, MCP_REG_CPU_EVENT_MASK,
  917. 0xffffffff);
  918. return 0;
  919. }
  920. #define QED_PSWHST_ATTENTION_INCORRECT_ACCESS (0x1)
  921. #define ATTENTION_INCORRECT_ACCESS_WR_MASK (0x1)
  922. #define ATTENTION_INCORRECT_ACCESS_WR_SHIFT (0)
  923. #define ATTENTION_INCORRECT_ACCESS_CLIENT_MASK (0xf)
  924. #define ATTENTION_INCORRECT_ACCESS_CLIENT_SHIFT (1)
  925. #define ATTENTION_INCORRECT_ACCESS_VF_VALID_MASK (0x1)
  926. #define ATTENTION_INCORRECT_ACCESS_VF_VALID_SHIFT (5)
  927. #define ATTENTION_INCORRECT_ACCESS_VF_ID_MASK (0xff)
  928. #define ATTENTION_INCORRECT_ACCESS_VF_ID_SHIFT (6)
  929. #define ATTENTION_INCORRECT_ACCESS_PF_ID_MASK (0xf)
  930. #define ATTENTION_INCORRECT_ACCESS_PF_ID_SHIFT (14)
  931. #define ATTENTION_INCORRECT_ACCESS_BYTE_EN_MASK (0xff)
  932. #define ATTENTION_INCORRECT_ACCESS_BYTE_EN_SHIFT (18)
  933. static int qed_pswhst_attn_cb(struct qed_hwfn *p_hwfn)
  934. {
  935. u32 tmp = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  936. PSWHST_REG_INCORRECT_ACCESS_VALID);
  937. if (tmp & QED_PSWHST_ATTENTION_INCORRECT_ACCESS) {
  938. u32 addr, data, length;
  939. addr = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  940. PSWHST_REG_INCORRECT_ACCESS_ADDRESS);
  941. data = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  942. PSWHST_REG_INCORRECT_ACCESS_DATA);
  943. length = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  944. PSWHST_REG_INCORRECT_ACCESS_LENGTH);
  945. DP_INFO(p_hwfn->cdev,
  946. "Incorrect access to %08x of length %08x - PF [%02x] VF [%04x] [valid %02x] client [%02x] write [%02x] Byte-Enable [%04x] [%08x]\n",
  947. addr, length,
  948. (u8) GET_FIELD(data, ATTENTION_INCORRECT_ACCESS_PF_ID),
  949. (u8) GET_FIELD(data, ATTENTION_INCORRECT_ACCESS_VF_ID),
  950. (u8) GET_FIELD(data,
  951. ATTENTION_INCORRECT_ACCESS_VF_VALID),
  952. (u8) GET_FIELD(data,
  953. ATTENTION_INCORRECT_ACCESS_CLIENT),
  954. (u8) GET_FIELD(data, ATTENTION_INCORRECT_ACCESS_WR),
  955. (u8) GET_FIELD(data,
  956. ATTENTION_INCORRECT_ACCESS_BYTE_EN),
  957. data);
  958. }
  959. return 0;
  960. }
  961. #define QED_GRC_ATTENTION_VALID_BIT (1 << 0)
  962. #define QED_GRC_ATTENTION_ADDRESS_MASK (0x7fffff)
  963. #define QED_GRC_ATTENTION_ADDRESS_SHIFT (0)
  964. #define QED_GRC_ATTENTION_RDWR_BIT (1 << 23)
  965. #define QED_GRC_ATTENTION_MASTER_MASK (0xf)
  966. #define QED_GRC_ATTENTION_MASTER_SHIFT (24)
  967. #define QED_GRC_ATTENTION_PF_MASK (0xf)
  968. #define QED_GRC_ATTENTION_PF_SHIFT (0)
  969. #define QED_GRC_ATTENTION_VF_MASK (0xff)
  970. #define QED_GRC_ATTENTION_VF_SHIFT (4)
  971. #define QED_GRC_ATTENTION_PRIV_MASK (0x3)
  972. #define QED_GRC_ATTENTION_PRIV_SHIFT (14)
  973. #define QED_GRC_ATTENTION_PRIV_VF (0)
  974. static const char *attn_master_to_str(u8 master)
  975. {
  976. switch (master) {
  977. case 1: return "PXP";
  978. case 2: return "MCP";
  979. case 3: return "MSDM";
  980. case 4: return "PSDM";
  981. case 5: return "YSDM";
  982. case 6: return "USDM";
  983. case 7: return "TSDM";
  984. case 8: return "XSDM";
  985. case 9: return "DBU";
  986. case 10: return "DMAE";
  987. default:
  988. return "Unkown";
  989. }
  990. }
  991. static int qed_grc_attn_cb(struct qed_hwfn *p_hwfn)
  992. {
  993. u32 tmp, tmp2;
  994. /* We've already cleared the timeout interrupt register, so we learn
  995. * of interrupts via the validity register
  996. */
  997. tmp = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  998. GRC_REG_TIMEOUT_ATTN_ACCESS_VALID);
  999. if (!(tmp & QED_GRC_ATTENTION_VALID_BIT))
  1000. goto out;
  1001. /* Read the GRC timeout information */
  1002. tmp = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1003. GRC_REG_TIMEOUT_ATTN_ACCESS_DATA_0);
  1004. tmp2 = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1005. GRC_REG_TIMEOUT_ATTN_ACCESS_DATA_1);
  1006. DP_INFO(p_hwfn->cdev,
  1007. "GRC timeout [%08x:%08x] - %s Address [%08x] [Master %s] [PF: %02x %s %02x]\n",
  1008. tmp2, tmp,
  1009. (tmp & QED_GRC_ATTENTION_RDWR_BIT) ? "Write to" : "Read from",
  1010. GET_FIELD(tmp, QED_GRC_ATTENTION_ADDRESS) << 2,
  1011. attn_master_to_str(GET_FIELD(tmp, QED_GRC_ATTENTION_MASTER)),
  1012. GET_FIELD(tmp2, QED_GRC_ATTENTION_PF),
  1013. (GET_FIELD(tmp2, QED_GRC_ATTENTION_PRIV) ==
  1014. QED_GRC_ATTENTION_PRIV_VF) ? "VF" : "(Ireelevant)",
  1015. GET_FIELD(tmp2, QED_GRC_ATTENTION_VF));
  1016. out:
  1017. /* Regardles of anything else, clean the validity bit */
  1018. qed_wr(p_hwfn, p_hwfn->p_dpc_ptt,
  1019. GRC_REG_TIMEOUT_ATTN_ACCESS_VALID, 0);
  1020. return 0;
  1021. }
  1022. #define PGLUE_ATTENTION_VALID (1 << 29)
  1023. #define PGLUE_ATTENTION_RD_VALID (1 << 26)
  1024. #define PGLUE_ATTENTION_DETAILS_PFID_MASK (0xf)
  1025. #define PGLUE_ATTENTION_DETAILS_PFID_SHIFT (20)
  1026. #define PGLUE_ATTENTION_DETAILS_VF_VALID_MASK (0x1)
  1027. #define PGLUE_ATTENTION_DETAILS_VF_VALID_SHIFT (19)
  1028. #define PGLUE_ATTENTION_DETAILS_VFID_MASK (0xff)
  1029. #define PGLUE_ATTENTION_DETAILS_VFID_SHIFT (24)
  1030. #define PGLUE_ATTENTION_DETAILS2_WAS_ERR_MASK (0x1)
  1031. #define PGLUE_ATTENTION_DETAILS2_WAS_ERR_SHIFT (21)
  1032. #define PGLUE_ATTENTION_DETAILS2_BME_MASK (0x1)
  1033. #define PGLUE_ATTENTION_DETAILS2_BME_SHIFT (22)
  1034. #define PGLUE_ATTENTION_DETAILS2_FID_EN_MASK (0x1)
  1035. #define PGLUE_ATTENTION_DETAILS2_FID_EN_SHIFT (23)
  1036. #define PGLUE_ATTENTION_ICPL_VALID (1 << 23)
  1037. #define PGLUE_ATTENTION_ZLR_VALID (1 << 25)
  1038. #define PGLUE_ATTENTION_ILT_VALID (1 << 23)
  1039. static int qed_pglub_rbc_attn_cb(struct qed_hwfn *p_hwfn)
  1040. {
  1041. u32 tmp;
  1042. tmp = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1043. PGLUE_B_REG_TX_ERR_WR_DETAILS2);
  1044. if (tmp & PGLUE_ATTENTION_VALID) {
  1045. u32 addr_lo, addr_hi, details;
  1046. addr_lo = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1047. PGLUE_B_REG_TX_ERR_WR_ADD_31_0);
  1048. addr_hi = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1049. PGLUE_B_REG_TX_ERR_WR_ADD_63_32);
  1050. details = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1051. PGLUE_B_REG_TX_ERR_WR_DETAILS);
  1052. DP_INFO(p_hwfn,
  1053. "Illegal write by chip to [%08x:%08x] blocked.\n"
  1054. "Details: %08x [PFID %02x, VFID %02x, VF_VALID %02x]\n"
  1055. "Details2 %08x [Was_error %02x BME deassert %02x FID_enable deassert %02x]\n",
  1056. addr_hi, addr_lo, details,
  1057. (u8)GET_FIELD(details, PGLUE_ATTENTION_DETAILS_PFID),
  1058. (u8)GET_FIELD(details, PGLUE_ATTENTION_DETAILS_VFID),
  1059. GET_FIELD(details,
  1060. PGLUE_ATTENTION_DETAILS_VF_VALID) ? 1 : 0,
  1061. tmp,
  1062. GET_FIELD(tmp,
  1063. PGLUE_ATTENTION_DETAILS2_WAS_ERR) ? 1 : 0,
  1064. GET_FIELD(tmp,
  1065. PGLUE_ATTENTION_DETAILS2_BME) ? 1 : 0,
  1066. GET_FIELD(tmp,
  1067. PGLUE_ATTENTION_DETAILS2_FID_EN) ? 1 : 0);
  1068. }
  1069. tmp = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1070. PGLUE_B_REG_TX_ERR_RD_DETAILS2);
  1071. if (tmp & PGLUE_ATTENTION_RD_VALID) {
  1072. u32 addr_lo, addr_hi, details;
  1073. addr_lo = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1074. PGLUE_B_REG_TX_ERR_RD_ADD_31_0);
  1075. addr_hi = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1076. PGLUE_B_REG_TX_ERR_RD_ADD_63_32);
  1077. details = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1078. PGLUE_B_REG_TX_ERR_RD_DETAILS);
  1079. DP_INFO(p_hwfn,
  1080. "Illegal read by chip from [%08x:%08x] blocked.\n"
  1081. " Details: %08x [PFID %02x, VFID %02x, VF_VALID %02x]\n"
  1082. " Details2 %08x [Was_error %02x BME deassert %02x FID_enable deassert %02x]\n",
  1083. addr_hi, addr_lo, details,
  1084. (u8)GET_FIELD(details, PGLUE_ATTENTION_DETAILS_PFID),
  1085. (u8)GET_FIELD(details, PGLUE_ATTENTION_DETAILS_VFID),
  1086. GET_FIELD(details,
  1087. PGLUE_ATTENTION_DETAILS_VF_VALID) ? 1 : 0,
  1088. tmp,
  1089. GET_FIELD(tmp, PGLUE_ATTENTION_DETAILS2_WAS_ERR) ? 1
  1090. : 0,
  1091. GET_FIELD(tmp, PGLUE_ATTENTION_DETAILS2_BME) ? 1 : 0,
  1092. GET_FIELD(tmp, PGLUE_ATTENTION_DETAILS2_FID_EN) ? 1
  1093. : 0);
  1094. }
  1095. tmp = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1096. PGLUE_B_REG_TX_ERR_WR_DETAILS_ICPL);
  1097. if (tmp & PGLUE_ATTENTION_ICPL_VALID)
  1098. DP_INFO(p_hwfn, "ICPL eror - %08x\n", tmp);
  1099. tmp = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1100. PGLUE_B_REG_MASTER_ZLR_ERR_DETAILS);
  1101. if (tmp & PGLUE_ATTENTION_ZLR_VALID) {
  1102. u32 addr_hi, addr_lo;
  1103. addr_lo = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1104. PGLUE_B_REG_MASTER_ZLR_ERR_ADD_31_0);
  1105. addr_hi = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1106. PGLUE_B_REG_MASTER_ZLR_ERR_ADD_63_32);
  1107. DP_INFO(p_hwfn, "ZLR eror - %08x [Address %08x:%08x]\n",
  1108. tmp, addr_hi, addr_lo);
  1109. }
  1110. tmp = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1111. PGLUE_B_REG_VF_ILT_ERR_DETAILS2);
  1112. if (tmp & PGLUE_ATTENTION_ILT_VALID) {
  1113. u32 addr_hi, addr_lo, details;
  1114. addr_lo = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1115. PGLUE_B_REG_VF_ILT_ERR_ADD_31_0);
  1116. addr_hi = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1117. PGLUE_B_REG_VF_ILT_ERR_ADD_63_32);
  1118. details = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1119. PGLUE_B_REG_VF_ILT_ERR_DETAILS);
  1120. DP_INFO(p_hwfn,
  1121. "ILT error - Details %08x Details2 %08x [Address %08x:%08x]\n",
  1122. details, tmp, addr_hi, addr_lo);
  1123. }
  1124. /* Clear the indications */
  1125. qed_wr(p_hwfn, p_hwfn->p_dpc_ptt,
  1126. PGLUE_B_REG_LATCHED_ERRORS_CLR, (1 << 2));
  1127. return 0;
  1128. }
  1129. #define QED_DORQ_ATTENTION_REASON_MASK (0xfffff)
  1130. #define QED_DORQ_ATTENTION_OPAQUE_MASK (0xffff)
  1131. #define QED_DORQ_ATTENTION_SIZE_MASK (0x7f)
  1132. #define QED_DORQ_ATTENTION_SIZE_SHIFT (16)
  1133. static int qed_dorq_attn_cb(struct qed_hwfn *p_hwfn)
  1134. {
  1135. u32 reason;
  1136. reason = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt, DORQ_REG_DB_DROP_REASON) &
  1137. QED_DORQ_ATTENTION_REASON_MASK;
  1138. if (reason) {
  1139. u32 details = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1140. DORQ_REG_DB_DROP_DETAILS);
  1141. DP_INFO(p_hwfn->cdev,
  1142. "DORQ db_drop: adress 0x%08x Opaque FID 0x%04x Size [bytes] 0x%08x Reason: 0x%08x\n",
  1143. qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1144. DORQ_REG_DB_DROP_DETAILS_ADDRESS),
  1145. (u16)(details & QED_DORQ_ATTENTION_OPAQUE_MASK),
  1146. GET_FIELD(details, QED_DORQ_ATTENTION_SIZE) * 4,
  1147. reason);
  1148. }
  1149. return -EINVAL;
  1150. }
  1151. /* Notice aeu_invert_reg must be defined in the same order of bits as HW; */
  1152. static struct aeu_invert_reg aeu_descs[NUM_ATTN_REGS] = {
  1153. {
  1154. { /* After Invert 1 */
  1155. {"GPIO0 function%d",
  1156. (32 << ATTENTION_LENGTH_SHIFT), NULL, MAX_BLOCK_ID},
  1157. }
  1158. },
  1159. {
  1160. { /* After Invert 2 */
  1161. {"PGLUE config_space", ATTENTION_SINGLE,
  1162. NULL, MAX_BLOCK_ID},
  1163. {"PGLUE misc_flr", ATTENTION_SINGLE,
  1164. NULL, MAX_BLOCK_ID},
  1165. {"PGLUE B RBC", ATTENTION_PAR_INT,
  1166. qed_pglub_rbc_attn_cb, BLOCK_PGLUE_B},
  1167. {"PGLUE misc_mctp", ATTENTION_SINGLE,
  1168. NULL, MAX_BLOCK_ID},
  1169. {"Flash event", ATTENTION_SINGLE, NULL, MAX_BLOCK_ID},
  1170. {"SMB event", ATTENTION_SINGLE, NULL, MAX_BLOCK_ID},
  1171. {"Main Power", ATTENTION_SINGLE, NULL, MAX_BLOCK_ID},
  1172. {"SW timers #%d", (8 << ATTENTION_LENGTH_SHIFT) |
  1173. (1 << ATTENTION_OFFSET_SHIFT),
  1174. NULL, MAX_BLOCK_ID},
  1175. {"PCIE glue/PXP VPD %d",
  1176. (16 << ATTENTION_LENGTH_SHIFT), NULL, BLOCK_PGLCS},
  1177. }
  1178. },
  1179. {
  1180. { /* After Invert 3 */
  1181. {"General Attention %d",
  1182. (32 << ATTENTION_LENGTH_SHIFT), NULL, MAX_BLOCK_ID},
  1183. }
  1184. },
  1185. {
  1186. { /* After Invert 4 */
  1187. {"General Attention 32", ATTENTION_SINGLE,
  1188. NULL, MAX_BLOCK_ID},
  1189. {"General Attention %d",
  1190. (2 << ATTENTION_LENGTH_SHIFT) |
  1191. (33 << ATTENTION_OFFSET_SHIFT), NULL, MAX_BLOCK_ID},
  1192. {"General Attention 35", ATTENTION_SINGLE,
  1193. NULL, MAX_BLOCK_ID},
  1194. {"CNIG port %d", (4 << ATTENTION_LENGTH_SHIFT),
  1195. NULL, BLOCK_CNIG},
  1196. {"MCP CPU", ATTENTION_SINGLE,
  1197. qed_mcp_attn_cb, MAX_BLOCK_ID},
  1198. {"MCP Watchdog timer", ATTENTION_SINGLE,
  1199. NULL, MAX_BLOCK_ID},
  1200. {"MCP M2P", ATTENTION_SINGLE, NULL, MAX_BLOCK_ID},
  1201. {"AVS stop status ready", ATTENTION_SINGLE,
  1202. NULL, MAX_BLOCK_ID},
  1203. {"MSTAT", ATTENTION_PAR_INT, NULL, MAX_BLOCK_ID},
  1204. {"MSTAT per-path", ATTENTION_PAR_INT,
  1205. NULL, MAX_BLOCK_ID},
  1206. {"Reserved %d", (6 << ATTENTION_LENGTH_SHIFT),
  1207. NULL, MAX_BLOCK_ID},
  1208. {"NIG", ATTENTION_PAR_INT, NULL, BLOCK_NIG},
  1209. {"BMB/OPTE/MCP", ATTENTION_PAR_INT, NULL, BLOCK_BMB},
  1210. {"BTB", ATTENTION_PAR_INT, NULL, BLOCK_BTB},
  1211. {"BRB", ATTENTION_PAR_INT, NULL, BLOCK_BRB},
  1212. {"PRS", ATTENTION_PAR_INT, NULL, BLOCK_PRS},
  1213. }
  1214. },
  1215. {
  1216. { /* After Invert 5 */
  1217. {"SRC", ATTENTION_PAR_INT, NULL, BLOCK_SRC},
  1218. {"PB Client1", ATTENTION_PAR_INT, NULL, BLOCK_PBF_PB1},
  1219. {"PB Client2", ATTENTION_PAR_INT, NULL, BLOCK_PBF_PB2},
  1220. {"RPB", ATTENTION_PAR_INT, NULL, BLOCK_RPB},
  1221. {"PBF", ATTENTION_PAR_INT, NULL, BLOCK_PBF},
  1222. {"QM", ATTENTION_PAR_INT, NULL, BLOCK_QM},
  1223. {"TM", ATTENTION_PAR_INT, NULL, BLOCK_TM},
  1224. {"MCM", ATTENTION_PAR_INT, NULL, BLOCK_MCM},
  1225. {"MSDM", ATTENTION_PAR_INT, NULL, BLOCK_MSDM},
  1226. {"MSEM", ATTENTION_PAR_INT, NULL, BLOCK_MSEM},
  1227. {"PCM", ATTENTION_PAR_INT, NULL, BLOCK_PCM},
  1228. {"PSDM", ATTENTION_PAR_INT, NULL, BLOCK_PSDM},
  1229. {"PSEM", ATTENTION_PAR_INT, NULL, BLOCK_PSEM},
  1230. {"TCM", ATTENTION_PAR_INT, NULL, BLOCK_TCM},
  1231. {"TSDM", ATTENTION_PAR_INT, NULL, BLOCK_TSDM},
  1232. {"TSEM", ATTENTION_PAR_INT, NULL, BLOCK_TSEM},
  1233. }
  1234. },
  1235. {
  1236. { /* After Invert 6 */
  1237. {"UCM", ATTENTION_PAR_INT, NULL, BLOCK_UCM},
  1238. {"USDM", ATTENTION_PAR_INT, NULL, BLOCK_USDM},
  1239. {"USEM", ATTENTION_PAR_INT, NULL, BLOCK_USEM},
  1240. {"XCM", ATTENTION_PAR_INT, NULL, BLOCK_XCM},
  1241. {"XSDM", ATTENTION_PAR_INT, NULL, BLOCK_XSDM},
  1242. {"XSEM", ATTENTION_PAR_INT, NULL, BLOCK_XSEM},
  1243. {"YCM", ATTENTION_PAR_INT, NULL, BLOCK_YCM},
  1244. {"YSDM", ATTENTION_PAR_INT, NULL, BLOCK_YSDM},
  1245. {"YSEM", ATTENTION_PAR_INT, NULL, BLOCK_YSEM},
  1246. {"XYLD", ATTENTION_PAR_INT, NULL, BLOCK_XYLD},
  1247. {"TMLD", ATTENTION_PAR_INT, NULL, BLOCK_TMLD},
  1248. {"MYLD", ATTENTION_PAR_INT, NULL, BLOCK_MULD},
  1249. {"YULD", ATTENTION_PAR_INT, NULL, BLOCK_YULD},
  1250. {"DORQ", ATTENTION_PAR_INT,
  1251. qed_dorq_attn_cb, BLOCK_DORQ},
  1252. {"DBG", ATTENTION_PAR_INT, NULL, BLOCK_DBG},
  1253. {"IPC", ATTENTION_PAR_INT, NULL, BLOCK_IPC},
  1254. }
  1255. },
  1256. {
  1257. { /* After Invert 7 */
  1258. {"CCFC", ATTENTION_PAR_INT, NULL, BLOCK_CCFC},
  1259. {"CDU", ATTENTION_PAR_INT, NULL, BLOCK_CDU},
  1260. {"DMAE", ATTENTION_PAR_INT, NULL, BLOCK_DMAE},
  1261. {"IGU", ATTENTION_PAR_INT, NULL, BLOCK_IGU},
  1262. {"ATC", ATTENTION_PAR_INT, NULL, MAX_BLOCK_ID},
  1263. {"CAU", ATTENTION_PAR_INT, NULL, BLOCK_CAU},
  1264. {"PTU", ATTENTION_PAR_INT, NULL, BLOCK_PTU},
  1265. {"PRM", ATTENTION_PAR_INT, NULL, BLOCK_PRM},
  1266. {"TCFC", ATTENTION_PAR_INT, NULL, BLOCK_TCFC},
  1267. {"RDIF", ATTENTION_PAR_INT, NULL, BLOCK_RDIF},
  1268. {"TDIF", ATTENTION_PAR_INT, NULL, BLOCK_TDIF},
  1269. {"RSS", ATTENTION_PAR_INT, NULL, BLOCK_RSS},
  1270. {"MISC", ATTENTION_PAR_INT, NULL, BLOCK_MISC},
  1271. {"MISCS", ATTENTION_PAR_INT, NULL, BLOCK_MISCS},
  1272. {"PCIE", ATTENTION_PAR, NULL, BLOCK_PCIE},
  1273. {"Vaux PCI core", ATTENTION_SINGLE, NULL, BLOCK_PGLCS},
  1274. {"PSWRQ", ATTENTION_PAR_INT, NULL, BLOCK_PSWRQ},
  1275. }
  1276. },
  1277. {
  1278. { /* After Invert 8 */
  1279. {"PSWRQ (pci_clk)", ATTENTION_PAR_INT,
  1280. NULL, BLOCK_PSWRQ2},
  1281. {"PSWWR", ATTENTION_PAR_INT, NULL, BLOCK_PSWWR},
  1282. {"PSWWR (pci_clk)", ATTENTION_PAR_INT,
  1283. NULL, BLOCK_PSWWR2},
  1284. {"PSWRD", ATTENTION_PAR_INT, NULL, BLOCK_PSWRD},
  1285. {"PSWRD (pci_clk)", ATTENTION_PAR_INT,
  1286. NULL, BLOCK_PSWRD2},
  1287. {"PSWHST", ATTENTION_PAR_INT,
  1288. qed_pswhst_attn_cb, BLOCK_PSWHST},
  1289. {"PSWHST (pci_clk)", ATTENTION_PAR_INT,
  1290. NULL, BLOCK_PSWHST2},
  1291. {"GRC", ATTENTION_PAR_INT,
  1292. qed_grc_attn_cb, BLOCK_GRC},
  1293. {"CPMU", ATTENTION_PAR_INT, NULL, BLOCK_CPMU},
  1294. {"NCSI", ATTENTION_PAR_INT, NULL, BLOCK_NCSI},
  1295. {"MSEM PRAM", ATTENTION_PAR, NULL, MAX_BLOCK_ID},
  1296. {"PSEM PRAM", ATTENTION_PAR, NULL, MAX_BLOCK_ID},
  1297. {"TSEM PRAM", ATTENTION_PAR, NULL, MAX_BLOCK_ID},
  1298. {"USEM PRAM", ATTENTION_PAR, NULL, MAX_BLOCK_ID},
  1299. {"XSEM PRAM", ATTENTION_PAR, NULL, MAX_BLOCK_ID},
  1300. {"YSEM PRAM", ATTENTION_PAR, NULL, MAX_BLOCK_ID},
  1301. {"pxp_misc_mps", ATTENTION_PAR, NULL, BLOCK_PGLCS},
  1302. {"PCIE glue/PXP Exp. ROM", ATTENTION_SINGLE,
  1303. NULL, BLOCK_PGLCS},
  1304. {"PERST_B assertion", ATTENTION_SINGLE,
  1305. NULL, MAX_BLOCK_ID},
  1306. {"PERST_B deassertion", ATTENTION_SINGLE,
  1307. NULL, MAX_BLOCK_ID},
  1308. {"Reserved %d", (2 << ATTENTION_LENGTH_SHIFT),
  1309. NULL, MAX_BLOCK_ID},
  1310. }
  1311. },
  1312. {
  1313. { /* After Invert 9 */
  1314. {"MCP Latched memory", ATTENTION_PAR,
  1315. NULL, MAX_BLOCK_ID},
  1316. {"MCP Latched scratchpad cache", ATTENTION_SINGLE,
  1317. NULL, MAX_BLOCK_ID},
  1318. {"MCP Latched ump_tx", ATTENTION_PAR,
  1319. NULL, MAX_BLOCK_ID},
  1320. {"MCP Latched scratchpad", ATTENTION_PAR,
  1321. NULL, MAX_BLOCK_ID},
  1322. {"Reserved %d", (28 << ATTENTION_LENGTH_SHIFT),
  1323. NULL, MAX_BLOCK_ID},
  1324. }
  1325. },
  1326. };
  1327. #define ATTN_STATE_BITS (0xfff)
  1328. #define ATTN_BITS_MASKABLE (0x3ff)
  1329. struct qed_sb_attn_info {
  1330. /* Virtual & Physical address of the SB */
  1331. struct atten_status_block *sb_attn;
  1332. dma_addr_t sb_phys;
  1333. /* Last seen running index */
  1334. u16 index;
  1335. /* A mask of the AEU bits resulting in a parity error */
  1336. u32 parity_mask[NUM_ATTN_REGS];
  1337. /* A pointer to the attention description structure */
  1338. struct aeu_invert_reg *p_aeu_desc;
  1339. /* Previously asserted attentions, which are still unasserted */
  1340. u16 known_attn;
  1341. /* Cleanup address for the link's general hw attention */
  1342. u32 mfw_attn_addr;
  1343. };
  1344. static inline u16 qed_attn_update_idx(struct qed_hwfn *p_hwfn,
  1345. struct qed_sb_attn_info *p_sb_desc)
  1346. {
  1347. u16 rc = 0;
  1348. u16 index;
  1349. /* Make certain HW write took affect */
  1350. mmiowb();
  1351. index = le16_to_cpu(p_sb_desc->sb_attn->sb_index);
  1352. if (p_sb_desc->index != index) {
  1353. p_sb_desc->index = index;
  1354. rc = QED_SB_ATT_IDX;
  1355. }
  1356. /* Make certain we got a consistent view with HW */
  1357. mmiowb();
  1358. return rc;
  1359. }
  1360. /**
  1361. * @brief qed_int_assertion - handles asserted attention bits
  1362. *
  1363. * @param p_hwfn
  1364. * @param asserted_bits newly asserted bits
  1365. * @return int
  1366. */
  1367. static int qed_int_assertion(struct qed_hwfn *p_hwfn,
  1368. u16 asserted_bits)
  1369. {
  1370. struct qed_sb_attn_info *sb_attn_sw = p_hwfn->p_sb_attn;
  1371. u32 igu_mask;
  1372. /* Mask the source of the attention in the IGU */
  1373. igu_mask = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1374. IGU_REG_ATTENTION_ENABLE);
  1375. DP_VERBOSE(p_hwfn, NETIF_MSG_INTR, "IGU mask: 0x%08x --> 0x%08x\n",
  1376. igu_mask, igu_mask & ~(asserted_bits & ATTN_BITS_MASKABLE));
  1377. igu_mask &= ~(asserted_bits & ATTN_BITS_MASKABLE);
  1378. qed_wr(p_hwfn, p_hwfn->p_dpc_ptt, IGU_REG_ATTENTION_ENABLE, igu_mask);
  1379. DP_VERBOSE(p_hwfn, NETIF_MSG_INTR,
  1380. "inner known ATTN state: 0x%04x --> 0x%04x\n",
  1381. sb_attn_sw->known_attn,
  1382. sb_attn_sw->known_attn | asserted_bits);
  1383. sb_attn_sw->known_attn |= asserted_bits;
  1384. /* Handle MCP events */
  1385. if (asserted_bits & 0x100) {
  1386. qed_mcp_handle_events(p_hwfn, p_hwfn->p_dpc_ptt);
  1387. /* Clean the MCP attention */
  1388. qed_wr(p_hwfn, p_hwfn->p_dpc_ptt,
  1389. sb_attn_sw->mfw_attn_addr, 0);
  1390. }
  1391. DIRECT_REG_WR((u8 __iomem *)p_hwfn->regview +
  1392. GTT_BAR0_MAP_REG_IGU_CMD +
  1393. ((IGU_CMD_ATTN_BIT_SET_UPPER -
  1394. IGU_CMD_INT_ACK_BASE) << 3),
  1395. (u32)asserted_bits);
  1396. DP_VERBOSE(p_hwfn, NETIF_MSG_INTR, "set cmd IGU: 0x%04x\n",
  1397. asserted_bits);
  1398. return 0;
  1399. }
  1400. static void qed_int_deassertion_print_bit(struct qed_hwfn *p_hwfn,
  1401. struct attn_hw_reg *p_reg_desc,
  1402. struct attn_hw_block *p_block,
  1403. enum qed_attention_type type,
  1404. u32 val, u32 mask)
  1405. {
  1406. int j;
  1407. for (j = 0; j < p_reg_desc->num_of_bits; j++) {
  1408. if (!(val & (1 << j)))
  1409. continue;
  1410. DP_NOTICE(p_hwfn,
  1411. "%s (%s): reg %d [0x%08x], bit %d [%s]\n",
  1412. p_block->name,
  1413. type == QED_ATTN_TYPE_ATTN ? "Interrupt" :
  1414. "Parity",
  1415. p_reg_desc->reg_idx, p_reg_desc->sts_addr,
  1416. j, (mask & (1 << j)) ? " [MASKED]" : "");
  1417. }
  1418. }
  1419. /**
  1420. * @brief qed_int_deassertion_aeu_bit - handles the effects of a single
  1421. * cause of the attention
  1422. *
  1423. * @param p_hwfn
  1424. * @param p_aeu - descriptor of an AEU bit which caused the attention
  1425. * @param aeu_en_reg - register offset of the AEU enable reg. which configured
  1426. * this bit to this group.
  1427. * @param bit_index - index of this bit in the aeu_en_reg
  1428. *
  1429. * @return int
  1430. */
  1431. static int
  1432. qed_int_deassertion_aeu_bit(struct qed_hwfn *p_hwfn,
  1433. struct aeu_invert_reg_bit *p_aeu,
  1434. u32 aeu_en_reg,
  1435. u32 bitmask)
  1436. {
  1437. int rc = -EINVAL;
  1438. u32 val;
  1439. DP_INFO(p_hwfn, "Deasserted attention `%s'[%08x]\n",
  1440. p_aeu->bit_name, bitmask);
  1441. /* Call callback before clearing the interrupt status */
  1442. if (p_aeu->cb) {
  1443. DP_INFO(p_hwfn, "`%s (attention)': Calling Callback function\n",
  1444. p_aeu->bit_name);
  1445. rc = p_aeu->cb(p_hwfn);
  1446. }
  1447. /* Handle HW block interrupt registers */
  1448. if (p_aeu->block_index != MAX_BLOCK_ID) {
  1449. struct attn_hw_block *p_block;
  1450. u32 mask;
  1451. int i;
  1452. p_block = &attn_blocks[p_aeu->block_index];
  1453. /* Handle each interrupt register */
  1454. for (i = 0; i < p_block->chip_regs[0].num_of_int_regs; i++) {
  1455. struct attn_hw_reg *p_reg_desc;
  1456. u32 sts_addr;
  1457. p_reg_desc = p_block->chip_regs[0].int_regs[i];
  1458. /* In case of fatal attention, don't clear the status
  1459. * so it would appear in following idle check.
  1460. */
  1461. if (rc == 0)
  1462. sts_addr = p_reg_desc->sts_clr_addr;
  1463. else
  1464. sts_addr = p_reg_desc->sts_addr;
  1465. val = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt, sts_addr);
  1466. mask = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1467. p_reg_desc->mask_addr);
  1468. qed_int_deassertion_print_bit(p_hwfn, p_reg_desc,
  1469. p_block,
  1470. QED_ATTN_TYPE_ATTN,
  1471. val, mask);
  1472. }
  1473. }
  1474. /* If the attention is benign, no need to prevent it */
  1475. if (!rc)
  1476. goto out;
  1477. /* Prevent this Attention from being asserted in the future */
  1478. val = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt, aeu_en_reg);
  1479. qed_wr(p_hwfn, p_hwfn->p_dpc_ptt, aeu_en_reg, (val & ~bitmask));
  1480. DP_INFO(p_hwfn, "`%s' - Disabled future attentions\n",
  1481. p_aeu->bit_name);
  1482. out:
  1483. return rc;
  1484. }
  1485. static void qed_int_parity_print(struct qed_hwfn *p_hwfn,
  1486. struct aeu_invert_reg_bit *p_aeu,
  1487. struct attn_hw_block *p_block,
  1488. u8 bit_index)
  1489. {
  1490. int i;
  1491. for (i = 0; i < p_block->chip_regs[0].num_of_prty_regs; i++) {
  1492. struct attn_hw_reg *p_reg_desc;
  1493. u32 val, mask;
  1494. p_reg_desc = p_block->chip_regs[0].prty_regs[i];
  1495. val = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1496. p_reg_desc->sts_clr_addr);
  1497. mask = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1498. p_reg_desc->mask_addr);
  1499. qed_int_deassertion_print_bit(p_hwfn, p_reg_desc,
  1500. p_block,
  1501. QED_ATTN_TYPE_PARITY,
  1502. val, mask);
  1503. }
  1504. }
  1505. /**
  1506. * @brief qed_int_deassertion_parity - handle a single parity AEU source
  1507. *
  1508. * @param p_hwfn
  1509. * @param p_aeu - descriptor of an AEU bit which caused the parity
  1510. * @param bit_index
  1511. */
  1512. static void qed_int_deassertion_parity(struct qed_hwfn *p_hwfn,
  1513. struct aeu_invert_reg_bit *p_aeu,
  1514. u8 bit_index)
  1515. {
  1516. u32 block_id = p_aeu->block_index;
  1517. DP_INFO(p_hwfn->cdev, "%s[%d] parity attention is set\n",
  1518. p_aeu->bit_name, bit_index);
  1519. if (block_id != MAX_BLOCK_ID) {
  1520. qed_int_parity_print(p_hwfn, p_aeu, &attn_blocks[block_id],
  1521. bit_index);
  1522. /* In BB, there's a single parity bit for several blocks */
  1523. if (block_id == BLOCK_BTB) {
  1524. qed_int_parity_print(p_hwfn, p_aeu,
  1525. &attn_blocks[BLOCK_OPTE],
  1526. bit_index);
  1527. qed_int_parity_print(p_hwfn, p_aeu,
  1528. &attn_blocks[BLOCK_MCP],
  1529. bit_index);
  1530. }
  1531. }
  1532. }
  1533. /**
  1534. * @brief - handles deassertion of previously asserted attentions.
  1535. *
  1536. * @param p_hwfn
  1537. * @param deasserted_bits - newly deasserted bits
  1538. * @return int
  1539. *
  1540. */
  1541. static int qed_int_deassertion(struct qed_hwfn *p_hwfn,
  1542. u16 deasserted_bits)
  1543. {
  1544. struct qed_sb_attn_info *sb_attn_sw = p_hwfn->p_sb_attn;
  1545. u32 aeu_inv_arr[NUM_ATTN_REGS], aeu_mask;
  1546. u8 i, j, k, bit_idx;
  1547. int rc = 0;
  1548. /* Read the attention registers in the AEU */
  1549. for (i = 0; i < NUM_ATTN_REGS; i++) {
  1550. aeu_inv_arr[i] = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1551. MISC_REG_AEU_AFTER_INVERT_1_IGU +
  1552. i * 0x4);
  1553. DP_VERBOSE(p_hwfn, NETIF_MSG_INTR,
  1554. "Deasserted bits [%d]: %08x\n",
  1555. i, aeu_inv_arr[i]);
  1556. }
  1557. /* Find parity attentions first */
  1558. for (i = 0; i < NUM_ATTN_REGS; i++) {
  1559. struct aeu_invert_reg *p_aeu = &sb_attn_sw->p_aeu_desc[i];
  1560. u32 en = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1561. MISC_REG_AEU_ENABLE1_IGU_OUT_0 +
  1562. i * sizeof(u32));
  1563. u32 parities;
  1564. /* Skip register in which no parity bit is currently set */
  1565. parities = sb_attn_sw->parity_mask[i] & aeu_inv_arr[i] & en;
  1566. if (!parities)
  1567. continue;
  1568. for (j = 0, bit_idx = 0; bit_idx < 32; j++) {
  1569. struct aeu_invert_reg_bit *p_bit = &p_aeu->bits[j];
  1570. if ((p_bit->flags & ATTENTION_PARITY) &&
  1571. !!(parities & (1 << bit_idx)))
  1572. qed_int_deassertion_parity(p_hwfn, p_bit,
  1573. bit_idx);
  1574. bit_idx += ATTENTION_LENGTH(p_bit->flags);
  1575. }
  1576. }
  1577. /* Find non-parity cause for attention and act */
  1578. for (k = 0; k < MAX_ATTN_GRPS; k++) {
  1579. struct aeu_invert_reg_bit *p_aeu;
  1580. /* Handle only groups whose attention is currently deasserted */
  1581. if (!(deasserted_bits & (1 << k)))
  1582. continue;
  1583. for (i = 0; i < NUM_ATTN_REGS; i++) {
  1584. u32 aeu_en = MISC_REG_AEU_ENABLE1_IGU_OUT_0 +
  1585. i * sizeof(u32) +
  1586. k * sizeof(u32) * NUM_ATTN_REGS;
  1587. u32 en, bits;
  1588. en = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt, aeu_en);
  1589. bits = aeu_inv_arr[i] & en;
  1590. /* Skip if no bit from this group is currently set */
  1591. if (!bits)
  1592. continue;
  1593. /* Find all set bits from current register which belong
  1594. * to current group, making them responsible for the
  1595. * previous assertion.
  1596. */
  1597. for (j = 0, bit_idx = 0; bit_idx < 32; j++) {
  1598. u8 bit, bit_len;
  1599. u32 bitmask;
  1600. p_aeu = &sb_attn_sw->p_aeu_desc[i].bits[j];
  1601. /* No need to handle parity-only bits */
  1602. if (p_aeu->flags == ATTENTION_PAR)
  1603. continue;
  1604. bit = bit_idx;
  1605. bit_len = ATTENTION_LENGTH(p_aeu->flags);
  1606. if (p_aeu->flags & ATTENTION_PAR_INT) {
  1607. /* Skip Parity */
  1608. bit++;
  1609. bit_len--;
  1610. }
  1611. bitmask = bits & (((1 << bit_len) - 1) << bit);
  1612. if (bitmask) {
  1613. /* Handle source of the attention */
  1614. qed_int_deassertion_aeu_bit(p_hwfn,
  1615. p_aeu,
  1616. aeu_en,
  1617. bitmask);
  1618. }
  1619. bit_idx += ATTENTION_LENGTH(p_aeu->flags);
  1620. }
  1621. }
  1622. }
  1623. /* Clear IGU indication for the deasserted bits */
  1624. DIRECT_REG_WR((u8 __iomem *)p_hwfn->regview +
  1625. GTT_BAR0_MAP_REG_IGU_CMD +
  1626. ((IGU_CMD_ATTN_BIT_CLR_UPPER -
  1627. IGU_CMD_INT_ACK_BASE) << 3),
  1628. ~((u32)deasserted_bits));
  1629. /* Unmask deasserted attentions in IGU */
  1630. aeu_mask = qed_rd(p_hwfn, p_hwfn->p_dpc_ptt,
  1631. IGU_REG_ATTENTION_ENABLE);
  1632. aeu_mask |= (deasserted_bits & ATTN_BITS_MASKABLE);
  1633. qed_wr(p_hwfn, p_hwfn->p_dpc_ptt, IGU_REG_ATTENTION_ENABLE, aeu_mask);
  1634. /* Clear deassertion from inner state */
  1635. sb_attn_sw->known_attn &= ~deasserted_bits;
  1636. return rc;
  1637. }
  1638. static int qed_int_attentions(struct qed_hwfn *p_hwfn)
  1639. {
  1640. struct qed_sb_attn_info *p_sb_attn_sw = p_hwfn->p_sb_attn;
  1641. struct atten_status_block *p_sb_attn = p_sb_attn_sw->sb_attn;
  1642. u32 attn_bits = 0, attn_acks = 0;
  1643. u16 asserted_bits, deasserted_bits;
  1644. __le16 index;
  1645. int rc = 0;
  1646. /* Read current attention bits/acks - safeguard against attentions
  1647. * by guaranting work on a synchronized timeframe
  1648. */
  1649. do {
  1650. index = p_sb_attn->sb_index;
  1651. attn_bits = le32_to_cpu(p_sb_attn->atten_bits);
  1652. attn_acks = le32_to_cpu(p_sb_attn->atten_ack);
  1653. } while (index != p_sb_attn->sb_index);
  1654. p_sb_attn->sb_index = index;
  1655. /* Attention / Deassertion are meaningful (and in correct state)
  1656. * only when they differ and consistent with known state - deassertion
  1657. * when previous attention & current ack, and assertion when current
  1658. * attention with no previous attention
  1659. */
  1660. asserted_bits = (attn_bits & ~attn_acks & ATTN_STATE_BITS) &
  1661. ~p_sb_attn_sw->known_attn;
  1662. deasserted_bits = (~attn_bits & attn_acks & ATTN_STATE_BITS) &
  1663. p_sb_attn_sw->known_attn;
  1664. if ((asserted_bits & ~0x100) || (deasserted_bits & ~0x100)) {
  1665. DP_INFO(p_hwfn,
  1666. "Attention: Index: 0x%04x, Bits: 0x%08x, Acks: 0x%08x, asserted: 0x%04x, De-asserted 0x%04x [Prev. known: 0x%04x]\n",
  1667. index, attn_bits, attn_acks, asserted_bits,
  1668. deasserted_bits, p_sb_attn_sw->known_attn);
  1669. } else if (asserted_bits == 0x100) {
  1670. DP_INFO(p_hwfn,
  1671. "MFW indication via attention\n");
  1672. } else {
  1673. DP_VERBOSE(p_hwfn, NETIF_MSG_INTR,
  1674. "MFW indication [deassertion]\n");
  1675. }
  1676. if (asserted_bits) {
  1677. rc = qed_int_assertion(p_hwfn, asserted_bits);
  1678. if (rc)
  1679. return rc;
  1680. }
  1681. if (deasserted_bits) {
  1682. rc = qed_int_deassertion(p_hwfn, deasserted_bits);
  1683. if (rc)
  1684. return rc;
  1685. }
  1686. return rc;
  1687. }
  1688. static void qed_sb_ack_attn(struct qed_hwfn *p_hwfn,
  1689. void __iomem *igu_addr,
  1690. u32 ack_cons)
  1691. {
  1692. struct igu_prod_cons_update igu_ack = { 0 };
  1693. igu_ack.sb_id_and_flags =
  1694. ((ack_cons << IGU_PROD_CONS_UPDATE_SB_INDEX_SHIFT) |
  1695. (1 << IGU_PROD_CONS_UPDATE_UPDATE_FLAG_SHIFT) |
  1696. (IGU_INT_NOP << IGU_PROD_CONS_UPDATE_ENABLE_INT_SHIFT) |
  1697. (IGU_SEG_ACCESS_ATTN <<
  1698. IGU_PROD_CONS_UPDATE_SEGMENT_ACCESS_SHIFT));
  1699. DIRECT_REG_WR(igu_addr, igu_ack.sb_id_and_flags);
  1700. /* Both segments (interrupts & acks) are written to same place address;
  1701. * Need to guarantee all commands will be received (in-order) by HW.
  1702. */
  1703. mmiowb();
  1704. barrier();
  1705. }
  1706. void qed_int_sp_dpc(unsigned long hwfn_cookie)
  1707. {
  1708. struct qed_hwfn *p_hwfn = (struct qed_hwfn *)hwfn_cookie;
  1709. struct qed_pi_info *pi_info = NULL;
  1710. struct qed_sb_attn_info *sb_attn;
  1711. struct qed_sb_info *sb_info;
  1712. int arr_size;
  1713. u16 rc = 0;
  1714. if (!p_hwfn->p_sp_sb) {
  1715. DP_ERR(p_hwfn->cdev, "DPC called - no p_sp_sb\n");
  1716. return;
  1717. }
  1718. sb_info = &p_hwfn->p_sp_sb->sb_info;
  1719. arr_size = ARRAY_SIZE(p_hwfn->p_sp_sb->pi_info_arr);
  1720. if (!sb_info) {
  1721. DP_ERR(p_hwfn->cdev,
  1722. "Status block is NULL - cannot ack interrupts\n");
  1723. return;
  1724. }
  1725. if (!p_hwfn->p_sb_attn) {
  1726. DP_ERR(p_hwfn->cdev, "DPC called - no p_sb_attn");
  1727. return;
  1728. }
  1729. sb_attn = p_hwfn->p_sb_attn;
  1730. DP_VERBOSE(p_hwfn, NETIF_MSG_INTR, "DPC Called! (hwfn %p %d)\n",
  1731. p_hwfn, p_hwfn->my_id);
  1732. /* Disable ack for def status block. Required both for msix +
  1733. * inta in non-mask mode, in inta does no harm.
  1734. */
  1735. qed_sb_ack(sb_info, IGU_INT_DISABLE, 0);
  1736. /* Gather Interrupts/Attentions information */
  1737. if (!sb_info->sb_virt) {
  1738. DP_ERR(
  1739. p_hwfn->cdev,
  1740. "Interrupt Status block is NULL - cannot check for new interrupts!\n");
  1741. } else {
  1742. u32 tmp_index = sb_info->sb_ack;
  1743. rc = qed_sb_update_sb_idx(sb_info);
  1744. DP_VERBOSE(p_hwfn->cdev, NETIF_MSG_INTR,
  1745. "Interrupt indices: 0x%08x --> 0x%08x\n",
  1746. tmp_index, sb_info->sb_ack);
  1747. }
  1748. if (!sb_attn || !sb_attn->sb_attn) {
  1749. DP_ERR(
  1750. p_hwfn->cdev,
  1751. "Attentions Status block is NULL - cannot check for new attentions!\n");
  1752. } else {
  1753. u16 tmp_index = sb_attn->index;
  1754. rc |= qed_attn_update_idx(p_hwfn, sb_attn);
  1755. DP_VERBOSE(p_hwfn->cdev, NETIF_MSG_INTR,
  1756. "Attention indices: 0x%08x --> 0x%08x\n",
  1757. tmp_index, sb_attn->index);
  1758. }
  1759. /* Check if we expect interrupts at this time. if not just ack them */
  1760. if (!(rc & QED_SB_EVENT_MASK)) {
  1761. qed_sb_ack(sb_info, IGU_INT_ENABLE, 1);
  1762. return;
  1763. }
  1764. /* Check the validity of the DPC ptt. If not ack interrupts and fail */
  1765. if (!p_hwfn->p_dpc_ptt) {
  1766. DP_NOTICE(p_hwfn->cdev, "Failed to allocate PTT\n");
  1767. qed_sb_ack(sb_info, IGU_INT_ENABLE, 1);
  1768. return;
  1769. }
  1770. if (rc & QED_SB_ATT_IDX)
  1771. qed_int_attentions(p_hwfn);
  1772. if (rc & QED_SB_IDX) {
  1773. int pi;
  1774. /* Look for a free index */
  1775. for (pi = 0; pi < arr_size; pi++) {
  1776. pi_info = &p_hwfn->p_sp_sb->pi_info_arr[pi];
  1777. if (pi_info->comp_cb)
  1778. pi_info->comp_cb(p_hwfn, pi_info->cookie);
  1779. }
  1780. }
  1781. if (sb_attn && (rc & QED_SB_ATT_IDX))
  1782. /* This should be done before the interrupts are enabled,
  1783. * since otherwise a new attention will be generated.
  1784. */
  1785. qed_sb_ack_attn(p_hwfn, sb_info->igu_addr, sb_attn->index);
  1786. qed_sb_ack(sb_info, IGU_INT_ENABLE, 1);
  1787. }
  1788. static void qed_int_sb_attn_free(struct qed_hwfn *p_hwfn)
  1789. {
  1790. struct qed_sb_attn_info *p_sb = p_hwfn->p_sb_attn;
  1791. if (!p_sb)
  1792. return;
  1793. if (p_sb->sb_attn)
  1794. dma_free_coherent(&p_hwfn->cdev->pdev->dev,
  1795. SB_ATTN_ALIGNED_SIZE(p_hwfn),
  1796. p_sb->sb_attn,
  1797. p_sb->sb_phys);
  1798. kfree(p_sb);
  1799. }
  1800. static void qed_int_sb_attn_setup(struct qed_hwfn *p_hwfn,
  1801. struct qed_ptt *p_ptt)
  1802. {
  1803. struct qed_sb_attn_info *sb_info = p_hwfn->p_sb_attn;
  1804. memset(sb_info->sb_attn, 0, sizeof(*sb_info->sb_attn));
  1805. sb_info->index = 0;
  1806. sb_info->known_attn = 0;
  1807. /* Configure Attention Status Block in IGU */
  1808. qed_wr(p_hwfn, p_ptt, IGU_REG_ATTN_MSG_ADDR_L,
  1809. lower_32_bits(p_hwfn->p_sb_attn->sb_phys));
  1810. qed_wr(p_hwfn, p_ptt, IGU_REG_ATTN_MSG_ADDR_H,
  1811. upper_32_bits(p_hwfn->p_sb_attn->sb_phys));
  1812. }
  1813. static void qed_int_sb_attn_init(struct qed_hwfn *p_hwfn,
  1814. struct qed_ptt *p_ptt,
  1815. void *sb_virt_addr,
  1816. dma_addr_t sb_phy_addr)
  1817. {
  1818. struct qed_sb_attn_info *sb_info = p_hwfn->p_sb_attn;
  1819. int i, j, k;
  1820. sb_info->sb_attn = sb_virt_addr;
  1821. sb_info->sb_phys = sb_phy_addr;
  1822. /* Set the pointer to the AEU descriptors */
  1823. sb_info->p_aeu_desc = aeu_descs;
  1824. /* Calculate Parity Masks */
  1825. memset(sb_info->parity_mask, 0, sizeof(u32) * NUM_ATTN_REGS);
  1826. for (i = 0; i < NUM_ATTN_REGS; i++) {
  1827. /* j is array index, k is bit index */
  1828. for (j = 0, k = 0; k < 32; j++) {
  1829. unsigned int flags = aeu_descs[i].bits[j].flags;
  1830. if (flags & ATTENTION_PARITY)
  1831. sb_info->parity_mask[i] |= 1 << k;
  1832. k += ATTENTION_LENGTH(flags);
  1833. }
  1834. DP_VERBOSE(p_hwfn, NETIF_MSG_INTR,
  1835. "Attn Mask [Reg %d]: 0x%08x\n",
  1836. i, sb_info->parity_mask[i]);
  1837. }
  1838. /* Set the address of cleanup for the mcp attention */
  1839. sb_info->mfw_attn_addr = (p_hwfn->rel_pf_id << 3) +
  1840. MISC_REG_AEU_GENERAL_ATTN_0;
  1841. qed_int_sb_attn_setup(p_hwfn, p_ptt);
  1842. }
  1843. static int qed_int_sb_attn_alloc(struct qed_hwfn *p_hwfn,
  1844. struct qed_ptt *p_ptt)
  1845. {
  1846. struct qed_dev *cdev = p_hwfn->cdev;
  1847. struct qed_sb_attn_info *p_sb;
  1848. void *p_virt;
  1849. dma_addr_t p_phys = 0;
  1850. /* SB struct */
  1851. p_sb = kmalloc(sizeof(*p_sb), GFP_KERNEL);
  1852. if (!p_sb) {
  1853. DP_NOTICE(cdev, "Failed to allocate `struct qed_sb_attn_info'\n");
  1854. return -ENOMEM;
  1855. }
  1856. /* SB ring */
  1857. p_virt = dma_alloc_coherent(&cdev->pdev->dev,
  1858. SB_ATTN_ALIGNED_SIZE(p_hwfn),
  1859. &p_phys, GFP_KERNEL);
  1860. if (!p_virt) {
  1861. DP_NOTICE(cdev, "Failed to allocate status block (attentions)\n");
  1862. kfree(p_sb);
  1863. return -ENOMEM;
  1864. }
  1865. /* Attention setup */
  1866. p_hwfn->p_sb_attn = p_sb;
  1867. qed_int_sb_attn_init(p_hwfn, p_ptt, p_virt, p_phys);
  1868. return 0;
  1869. }
  1870. /* coalescing timeout = timeset << (timer_res + 1) */
  1871. #define QED_CAU_DEF_RX_USECS 24
  1872. #define QED_CAU_DEF_TX_USECS 48
  1873. void qed_init_cau_sb_entry(struct qed_hwfn *p_hwfn,
  1874. struct cau_sb_entry *p_sb_entry,
  1875. u8 pf_id,
  1876. u16 vf_number,
  1877. u8 vf_valid)
  1878. {
  1879. struct qed_dev *cdev = p_hwfn->cdev;
  1880. u32 cau_state;
  1881. memset(p_sb_entry, 0, sizeof(*p_sb_entry));
  1882. SET_FIELD(p_sb_entry->params, CAU_SB_ENTRY_PF_NUMBER, pf_id);
  1883. SET_FIELD(p_sb_entry->params, CAU_SB_ENTRY_VF_NUMBER, vf_number);
  1884. SET_FIELD(p_sb_entry->params, CAU_SB_ENTRY_VF_VALID, vf_valid);
  1885. SET_FIELD(p_sb_entry->params, CAU_SB_ENTRY_SB_TIMESET0, 0x7F);
  1886. SET_FIELD(p_sb_entry->params, CAU_SB_ENTRY_SB_TIMESET1, 0x7F);
  1887. /* setting the time resultion to a fixed value ( = 1) */
  1888. SET_FIELD(p_sb_entry->params, CAU_SB_ENTRY_TIMER_RES0,
  1889. QED_CAU_DEF_RX_TIMER_RES);
  1890. SET_FIELD(p_sb_entry->params, CAU_SB_ENTRY_TIMER_RES1,
  1891. QED_CAU_DEF_TX_TIMER_RES);
  1892. cau_state = CAU_HC_DISABLE_STATE;
  1893. if (cdev->int_coalescing_mode == QED_COAL_MODE_ENABLE) {
  1894. cau_state = CAU_HC_ENABLE_STATE;
  1895. if (!cdev->rx_coalesce_usecs)
  1896. cdev->rx_coalesce_usecs = QED_CAU_DEF_RX_USECS;
  1897. if (!cdev->tx_coalesce_usecs)
  1898. cdev->tx_coalesce_usecs = QED_CAU_DEF_TX_USECS;
  1899. }
  1900. SET_FIELD(p_sb_entry->data, CAU_SB_ENTRY_STATE0, cau_state);
  1901. SET_FIELD(p_sb_entry->data, CAU_SB_ENTRY_STATE1, cau_state);
  1902. }
  1903. void qed_int_cau_conf_sb(struct qed_hwfn *p_hwfn,
  1904. struct qed_ptt *p_ptt,
  1905. dma_addr_t sb_phys,
  1906. u16 igu_sb_id,
  1907. u16 vf_number,
  1908. u8 vf_valid)
  1909. {
  1910. struct cau_sb_entry sb_entry;
  1911. qed_init_cau_sb_entry(p_hwfn, &sb_entry, p_hwfn->rel_pf_id,
  1912. vf_number, vf_valid);
  1913. if (p_hwfn->hw_init_done) {
  1914. /* Wide-bus, initialize via DMAE */
  1915. u64 phys_addr = (u64)sb_phys;
  1916. qed_dmae_host2grc(p_hwfn, p_ptt, (u64)(uintptr_t)&phys_addr,
  1917. CAU_REG_SB_ADDR_MEMORY +
  1918. igu_sb_id * sizeof(u64), 2, 0);
  1919. qed_dmae_host2grc(p_hwfn, p_ptt, (u64)(uintptr_t)&sb_entry,
  1920. CAU_REG_SB_VAR_MEMORY +
  1921. igu_sb_id * sizeof(u64), 2, 0);
  1922. } else {
  1923. /* Initialize Status Block Address */
  1924. STORE_RT_REG_AGG(p_hwfn,
  1925. CAU_REG_SB_ADDR_MEMORY_RT_OFFSET +
  1926. igu_sb_id * 2,
  1927. sb_phys);
  1928. STORE_RT_REG_AGG(p_hwfn,
  1929. CAU_REG_SB_VAR_MEMORY_RT_OFFSET +
  1930. igu_sb_id * 2,
  1931. sb_entry);
  1932. }
  1933. /* Configure pi coalescing if set */
  1934. if (p_hwfn->cdev->int_coalescing_mode == QED_COAL_MODE_ENABLE) {
  1935. u8 timeset = p_hwfn->cdev->rx_coalesce_usecs >>
  1936. (QED_CAU_DEF_RX_TIMER_RES + 1);
  1937. u8 num_tc = 1, i;
  1938. qed_int_cau_conf_pi(p_hwfn, p_ptt, igu_sb_id, RX_PI,
  1939. QED_COAL_RX_STATE_MACHINE,
  1940. timeset);
  1941. timeset = p_hwfn->cdev->tx_coalesce_usecs >>
  1942. (QED_CAU_DEF_TX_TIMER_RES + 1);
  1943. for (i = 0; i < num_tc; i++) {
  1944. qed_int_cau_conf_pi(p_hwfn, p_ptt,
  1945. igu_sb_id, TX_PI(i),
  1946. QED_COAL_TX_STATE_MACHINE,
  1947. timeset);
  1948. }
  1949. }
  1950. }
  1951. void qed_int_cau_conf_pi(struct qed_hwfn *p_hwfn,
  1952. struct qed_ptt *p_ptt,
  1953. u16 igu_sb_id,
  1954. u32 pi_index,
  1955. enum qed_coalescing_fsm coalescing_fsm,
  1956. u8 timeset)
  1957. {
  1958. struct cau_pi_entry pi_entry;
  1959. u32 sb_offset;
  1960. u32 pi_offset;
  1961. sb_offset = igu_sb_id * PIS_PER_SB;
  1962. memset(&pi_entry, 0, sizeof(struct cau_pi_entry));
  1963. SET_FIELD(pi_entry.prod, CAU_PI_ENTRY_PI_TIMESET, timeset);
  1964. if (coalescing_fsm == QED_COAL_RX_STATE_MACHINE)
  1965. SET_FIELD(pi_entry.prod, CAU_PI_ENTRY_FSM_SEL, 0);
  1966. else
  1967. SET_FIELD(pi_entry.prod, CAU_PI_ENTRY_FSM_SEL, 1);
  1968. pi_offset = sb_offset + pi_index;
  1969. if (p_hwfn->hw_init_done) {
  1970. qed_wr(p_hwfn, p_ptt,
  1971. CAU_REG_PI_MEMORY + pi_offset * sizeof(u32),
  1972. *((u32 *)&(pi_entry)));
  1973. } else {
  1974. STORE_RT_REG(p_hwfn,
  1975. CAU_REG_PI_MEMORY_RT_OFFSET + pi_offset,
  1976. *((u32 *)&(pi_entry)));
  1977. }
  1978. }
  1979. void qed_int_sb_setup(struct qed_hwfn *p_hwfn,
  1980. struct qed_ptt *p_ptt,
  1981. struct qed_sb_info *sb_info)
  1982. {
  1983. /* zero status block and ack counter */
  1984. sb_info->sb_ack = 0;
  1985. memset(sb_info->sb_virt, 0, sizeof(*sb_info->sb_virt));
  1986. qed_int_cau_conf_sb(p_hwfn, p_ptt, sb_info->sb_phys,
  1987. sb_info->igu_sb_id, 0, 0);
  1988. }
  1989. /**
  1990. * @brief qed_get_igu_sb_id - given a sw sb_id return the
  1991. * igu_sb_id
  1992. *
  1993. * @param p_hwfn
  1994. * @param sb_id
  1995. *
  1996. * @return u16
  1997. */
  1998. static u16 qed_get_igu_sb_id(struct qed_hwfn *p_hwfn,
  1999. u16 sb_id)
  2000. {
  2001. u16 igu_sb_id;
  2002. /* Assuming continuous set of IGU SBs dedicated for given PF */
  2003. if (sb_id == QED_SP_SB_ID)
  2004. igu_sb_id = p_hwfn->hw_info.p_igu_info->igu_dsb_id;
  2005. else
  2006. igu_sb_id = sb_id + p_hwfn->hw_info.p_igu_info->igu_base_sb;
  2007. DP_VERBOSE(p_hwfn, NETIF_MSG_INTR, "SB [%s] index is 0x%04x\n",
  2008. (sb_id == QED_SP_SB_ID) ? "DSB" : "non-DSB", igu_sb_id);
  2009. return igu_sb_id;
  2010. }
  2011. int qed_int_sb_init(struct qed_hwfn *p_hwfn,
  2012. struct qed_ptt *p_ptt,
  2013. struct qed_sb_info *sb_info,
  2014. void *sb_virt_addr,
  2015. dma_addr_t sb_phy_addr,
  2016. u16 sb_id)
  2017. {
  2018. sb_info->sb_virt = sb_virt_addr;
  2019. sb_info->sb_phys = sb_phy_addr;
  2020. sb_info->igu_sb_id = qed_get_igu_sb_id(p_hwfn, sb_id);
  2021. if (sb_id != QED_SP_SB_ID) {
  2022. p_hwfn->sbs_info[sb_id] = sb_info;
  2023. p_hwfn->num_sbs++;
  2024. }
  2025. sb_info->cdev = p_hwfn->cdev;
  2026. /* The igu address will hold the absolute address that needs to be
  2027. * written to for a specific status block
  2028. */
  2029. sb_info->igu_addr = (u8 __iomem *)p_hwfn->regview +
  2030. GTT_BAR0_MAP_REG_IGU_CMD +
  2031. (sb_info->igu_sb_id << 3);
  2032. sb_info->flags |= QED_SB_INFO_INIT;
  2033. qed_int_sb_setup(p_hwfn, p_ptt, sb_info);
  2034. return 0;
  2035. }
  2036. int qed_int_sb_release(struct qed_hwfn *p_hwfn,
  2037. struct qed_sb_info *sb_info,
  2038. u16 sb_id)
  2039. {
  2040. if (sb_id == QED_SP_SB_ID) {
  2041. DP_ERR(p_hwfn, "Do Not free sp sb using this function");
  2042. return -EINVAL;
  2043. }
  2044. /* zero status block and ack counter */
  2045. sb_info->sb_ack = 0;
  2046. memset(sb_info->sb_virt, 0, sizeof(*sb_info->sb_virt));
  2047. if (p_hwfn->sbs_info[sb_id] != NULL) {
  2048. p_hwfn->sbs_info[sb_id] = NULL;
  2049. p_hwfn->num_sbs--;
  2050. }
  2051. return 0;
  2052. }
  2053. static void qed_int_sp_sb_free(struct qed_hwfn *p_hwfn)
  2054. {
  2055. struct qed_sb_sp_info *p_sb = p_hwfn->p_sp_sb;
  2056. if (!p_sb)
  2057. return;
  2058. if (p_sb->sb_info.sb_virt)
  2059. dma_free_coherent(&p_hwfn->cdev->pdev->dev,
  2060. SB_ALIGNED_SIZE(p_hwfn),
  2061. p_sb->sb_info.sb_virt,
  2062. p_sb->sb_info.sb_phys);
  2063. kfree(p_sb);
  2064. }
  2065. static int qed_int_sp_sb_alloc(struct qed_hwfn *p_hwfn,
  2066. struct qed_ptt *p_ptt)
  2067. {
  2068. struct qed_sb_sp_info *p_sb;
  2069. dma_addr_t p_phys = 0;
  2070. void *p_virt;
  2071. /* SB struct */
  2072. p_sb = kmalloc(sizeof(*p_sb), GFP_KERNEL);
  2073. if (!p_sb) {
  2074. DP_NOTICE(p_hwfn, "Failed to allocate `struct qed_sb_info'\n");
  2075. return -ENOMEM;
  2076. }
  2077. /* SB ring */
  2078. p_virt = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev,
  2079. SB_ALIGNED_SIZE(p_hwfn),
  2080. &p_phys, GFP_KERNEL);
  2081. if (!p_virt) {
  2082. DP_NOTICE(p_hwfn, "Failed to allocate status block\n");
  2083. kfree(p_sb);
  2084. return -ENOMEM;
  2085. }
  2086. /* Status Block setup */
  2087. p_hwfn->p_sp_sb = p_sb;
  2088. qed_int_sb_init(p_hwfn, p_ptt, &p_sb->sb_info, p_virt,
  2089. p_phys, QED_SP_SB_ID);
  2090. memset(p_sb->pi_info_arr, 0, sizeof(p_sb->pi_info_arr));
  2091. return 0;
  2092. }
  2093. int qed_int_register_cb(struct qed_hwfn *p_hwfn,
  2094. qed_int_comp_cb_t comp_cb,
  2095. void *cookie,
  2096. u8 *sb_idx,
  2097. __le16 **p_fw_cons)
  2098. {
  2099. struct qed_sb_sp_info *p_sp_sb = p_hwfn->p_sp_sb;
  2100. int rc = -ENOMEM;
  2101. u8 pi;
  2102. /* Look for a free index */
  2103. for (pi = 0; pi < ARRAY_SIZE(p_sp_sb->pi_info_arr); pi++) {
  2104. if (p_sp_sb->pi_info_arr[pi].comp_cb)
  2105. continue;
  2106. p_sp_sb->pi_info_arr[pi].comp_cb = comp_cb;
  2107. p_sp_sb->pi_info_arr[pi].cookie = cookie;
  2108. *sb_idx = pi;
  2109. *p_fw_cons = &p_sp_sb->sb_info.sb_virt->pi_array[pi];
  2110. rc = 0;
  2111. break;
  2112. }
  2113. return rc;
  2114. }
  2115. int qed_int_unregister_cb(struct qed_hwfn *p_hwfn, u8 pi)
  2116. {
  2117. struct qed_sb_sp_info *p_sp_sb = p_hwfn->p_sp_sb;
  2118. if (p_sp_sb->pi_info_arr[pi].comp_cb == NULL)
  2119. return -ENOMEM;
  2120. p_sp_sb->pi_info_arr[pi].comp_cb = NULL;
  2121. p_sp_sb->pi_info_arr[pi].cookie = NULL;
  2122. return 0;
  2123. }
  2124. u16 qed_int_get_sp_sb_id(struct qed_hwfn *p_hwfn)
  2125. {
  2126. return p_hwfn->p_sp_sb->sb_info.igu_sb_id;
  2127. }
  2128. void qed_int_igu_enable_int(struct qed_hwfn *p_hwfn,
  2129. struct qed_ptt *p_ptt,
  2130. enum qed_int_mode int_mode)
  2131. {
  2132. u32 igu_pf_conf = IGU_PF_CONF_FUNC_EN | IGU_PF_CONF_ATTN_BIT_EN;
  2133. p_hwfn->cdev->int_mode = int_mode;
  2134. switch (p_hwfn->cdev->int_mode) {
  2135. case QED_INT_MODE_INTA:
  2136. igu_pf_conf |= IGU_PF_CONF_INT_LINE_EN;
  2137. igu_pf_conf |= IGU_PF_CONF_SINGLE_ISR_EN;
  2138. break;
  2139. case QED_INT_MODE_MSI:
  2140. igu_pf_conf |= IGU_PF_CONF_MSI_MSIX_EN;
  2141. igu_pf_conf |= IGU_PF_CONF_SINGLE_ISR_EN;
  2142. break;
  2143. case QED_INT_MODE_MSIX:
  2144. igu_pf_conf |= IGU_PF_CONF_MSI_MSIX_EN;
  2145. break;
  2146. case QED_INT_MODE_POLL:
  2147. break;
  2148. }
  2149. qed_wr(p_hwfn, p_ptt, IGU_REG_PF_CONFIGURATION, igu_pf_conf);
  2150. }
  2151. int qed_int_igu_enable(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt,
  2152. enum qed_int_mode int_mode)
  2153. {
  2154. int rc;
  2155. /* Configure AEU signal change to produce attentions */
  2156. qed_wr(p_hwfn, p_ptt, IGU_REG_ATTENTION_ENABLE, 0);
  2157. qed_wr(p_hwfn, p_ptt, IGU_REG_LEADING_EDGE_LATCH, 0xfff);
  2158. qed_wr(p_hwfn, p_ptt, IGU_REG_TRAILING_EDGE_LATCH, 0xfff);
  2159. qed_wr(p_hwfn, p_ptt, IGU_REG_ATTENTION_ENABLE, 0xfff);
  2160. /* Flush the writes to IGU */
  2161. mmiowb();
  2162. /* Unmask AEU signals toward IGU */
  2163. qed_wr(p_hwfn, p_ptt, MISC_REG_AEU_MASK_ATTN_IGU, 0xff);
  2164. if ((int_mode != QED_INT_MODE_INTA) || IS_LEAD_HWFN(p_hwfn)) {
  2165. rc = qed_slowpath_irq_req(p_hwfn);
  2166. if (rc != 0) {
  2167. DP_NOTICE(p_hwfn, "Slowpath IRQ request failed\n");
  2168. return -EINVAL;
  2169. }
  2170. p_hwfn->b_int_requested = true;
  2171. }
  2172. /* Enable interrupt Generation */
  2173. qed_int_igu_enable_int(p_hwfn, p_ptt, int_mode);
  2174. p_hwfn->b_int_enabled = 1;
  2175. return rc;
  2176. }
  2177. void qed_int_igu_disable_int(struct qed_hwfn *p_hwfn,
  2178. struct qed_ptt *p_ptt)
  2179. {
  2180. p_hwfn->b_int_enabled = 0;
  2181. qed_wr(p_hwfn, p_ptt, IGU_REG_PF_CONFIGURATION, 0);
  2182. }
  2183. #define IGU_CLEANUP_SLEEP_LENGTH (1000)
  2184. void qed_int_igu_cleanup_sb(struct qed_hwfn *p_hwfn,
  2185. struct qed_ptt *p_ptt,
  2186. u32 sb_id,
  2187. bool cleanup_set,
  2188. u16 opaque_fid
  2189. )
  2190. {
  2191. u32 pxp_addr = IGU_CMD_INT_ACK_BASE + sb_id;
  2192. u32 sleep_cnt = IGU_CLEANUP_SLEEP_LENGTH;
  2193. u32 data = 0;
  2194. u32 cmd_ctrl = 0;
  2195. u32 val = 0;
  2196. u32 sb_bit = 0;
  2197. u32 sb_bit_addr = 0;
  2198. /* Set the data field */
  2199. SET_FIELD(data, IGU_CLEANUP_CLEANUP_SET, cleanup_set ? 1 : 0);
  2200. SET_FIELD(data, IGU_CLEANUP_CLEANUP_TYPE, 0);
  2201. SET_FIELD(data, IGU_CLEANUP_COMMAND_TYPE, IGU_COMMAND_TYPE_SET);
  2202. /* Set the control register */
  2203. SET_FIELD(cmd_ctrl, IGU_CTRL_REG_PXP_ADDR, pxp_addr);
  2204. SET_FIELD(cmd_ctrl, IGU_CTRL_REG_FID, opaque_fid);
  2205. SET_FIELD(cmd_ctrl, IGU_CTRL_REG_TYPE, IGU_CTRL_CMD_TYPE_WR);
  2206. qed_wr(p_hwfn, p_ptt, IGU_REG_COMMAND_REG_32LSB_DATA, data);
  2207. barrier();
  2208. qed_wr(p_hwfn, p_ptt, IGU_REG_COMMAND_REG_CTRL, cmd_ctrl);
  2209. /* Flush the write to IGU */
  2210. mmiowb();
  2211. /* calculate where to read the status bit from */
  2212. sb_bit = 1 << (sb_id % 32);
  2213. sb_bit_addr = sb_id / 32 * sizeof(u32);
  2214. sb_bit_addr += IGU_REG_CLEANUP_STATUS_0;
  2215. /* Now wait for the command to complete */
  2216. do {
  2217. val = qed_rd(p_hwfn, p_ptt, sb_bit_addr);
  2218. if ((val & sb_bit) == (cleanup_set ? sb_bit : 0))
  2219. break;
  2220. usleep_range(5000, 10000);
  2221. } while (--sleep_cnt);
  2222. if (!sleep_cnt)
  2223. DP_NOTICE(p_hwfn,
  2224. "Timeout waiting for clear status 0x%08x [for sb %d]\n",
  2225. val, sb_id);
  2226. }
  2227. void qed_int_igu_init_pure_rt_single(struct qed_hwfn *p_hwfn,
  2228. struct qed_ptt *p_ptt,
  2229. u32 sb_id,
  2230. u16 opaque,
  2231. bool b_set)
  2232. {
  2233. int pi;
  2234. /* Set */
  2235. if (b_set)
  2236. qed_int_igu_cleanup_sb(p_hwfn, p_ptt, sb_id, 1, opaque);
  2237. /* Clear */
  2238. qed_int_igu_cleanup_sb(p_hwfn, p_ptt, sb_id, 0, opaque);
  2239. /* Clear the CAU for the SB */
  2240. for (pi = 0; pi < 12; pi++)
  2241. qed_wr(p_hwfn, p_ptt,
  2242. CAU_REG_PI_MEMORY + (sb_id * 12 + pi) * 4, 0);
  2243. }
  2244. void qed_int_igu_init_pure_rt(struct qed_hwfn *p_hwfn,
  2245. struct qed_ptt *p_ptt,
  2246. bool b_set,
  2247. bool b_slowpath)
  2248. {
  2249. u32 igu_base_sb = p_hwfn->hw_info.p_igu_info->igu_base_sb;
  2250. u32 igu_sb_cnt = p_hwfn->hw_info.p_igu_info->igu_sb_cnt;
  2251. u32 sb_id = 0;
  2252. u32 val = 0;
  2253. val = qed_rd(p_hwfn, p_ptt, IGU_REG_BLOCK_CONFIGURATION);
  2254. val |= IGU_REG_BLOCK_CONFIGURATION_VF_CLEANUP_EN;
  2255. val &= ~IGU_REG_BLOCK_CONFIGURATION_PXP_TPH_INTERFACE_EN;
  2256. qed_wr(p_hwfn, p_ptt, IGU_REG_BLOCK_CONFIGURATION, val);
  2257. DP_VERBOSE(p_hwfn, NETIF_MSG_INTR,
  2258. "IGU cleaning SBs [%d,...,%d]\n",
  2259. igu_base_sb, igu_base_sb + igu_sb_cnt - 1);
  2260. for (sb_id = igu_base_sb; sb_id < igu_base_sb + igu_sb_cnt; sb_id++)
  2261. qed_int_igu_init_pure_rt_single(p_hwfn, p_ptt, sb_id,
  2262. p_hwfn->hw_info.opaque_fid,
  2263. b_set);
  2264. if (b_slowpath) {
  2265. sb_id = p_hwfn->hw_info.p_igu_info->igu_dsb_id;
  2266. DP_VERBOSE(p_hwfn, NETIF_MSG_INTR,
  2267. "IGU cleaning slowpath SB [%d]\n", sb_id);
  2268. qed_int_igu_init_pure_rt_single(p_hwfn, p_ptt, sb_id,
  2269. p_hwfn->hw_info.opaque_fid,
  2270. b_set);
  2271. }
  2272. }
  2273. static u32 qed_int_igu_read_cam_block(struct qed_hwfn *p_hwfn,
  2274. struct qed_ptt *p_ptt,
  2275. u16 sb_id)
  2276. {
  2277. u32 val = qed_rd(p_hwfn, p_ptt,
  2278. IGU_REG_MAPPING_MEMORY +
  2279. sizeof(u32) * sb_id);
  2280. struct qed_igu_block *p_block;
  2281. p_block = &p_hwfn->hw_info.p_igu_info->igu_map.igu_blocks[sb_id];
  2282. /* stop scanning when hit first invalid PF entry */
  2283. if (!GET_FIELD(val, IGU_MAPPING_LINE_VALID) &&
  2284. GET_FIELD(val, IGU_MAPPING_LINE_PF_VALID))
  2285. goto out;
  2286. /* Fill the block information */
  2287. p_block->status = QED_IGU_STATUS_VALID;
  2288. p_block->function_id = GET_FIELD(val,
  2289. IGU_MAPPING_LINE_FUNCTION_NUMBER);
  2290. p_block->is_pf = GET_FIELD(val, IGU_MAPPING_LINE_PF_VALID);
  2291. p_block->vector_number = GET_FIELD(val,
  2292. IGU_MAPPING_LINE_VECTOR_NUMBER);
  2293. DP_VERBOSE(p_hwfn, NETIF_MSG_INTR,
  2294. "IGU_BLOCK: [SB 0x%04x, Value in CAM 0x%08x] func_id = %d is_pf = %d vector_num = 0x%x\n",
  2295. sb_id, val, p_block->function_id,
  2296. p_block->is_pf, p_block->vector_number);
  2297. out:
  2298. return val;
  2299. }
  2300. int qed_int_igu_read_cam(struct qed_hwfn *p_hwfn,
  2301. struct qed_ptt *p_ptt)
  2302. {
  2303. struct qed_igu_info *p_igu_info;
  2304. struct qed_igu_block *blk;
  2305. u32 val;
  2306. u16 sb_id;
  2307. u16 prev_sb_id = 0xFF;
  2308. p_hwfn->hw_info.p_igu_info = kzalloc(sizeof(*p_igu_info), GFP_KERNEL);
  2309. if (!p_hwfn->hw_info.p_igu_info)
  2310. return -ENOMEM;
  2311. p_igu_info = p_hwfn->hw_info.p_igu_info;
  2312. /* Initialize base sb / sb cnt for PFs */
  2313. p_igu_info->igu_base_sb = 0xffff;
  2314. p_igu_info->igu_sb_cnt = 0;
  2315. p_igu_info->igu_dsb_id = 0xffff;
  2316. p_igu_info->igu_base_sb_iov = 0xffff;
  2317. for (sb_id = 0; sb_id < QED_MAPPING_MEMORY_SIZE(p_hwfn->cdev);
  2318. sb_id++) {
  2319. blk = &p_igu_info->igu_map.igu_blocks[sb_id];
  2320. val = qed_int_igu_read_cam_block(p_hwfn, p_ptt, sb_id);
  2321. /* stop scanning when hit first invalid PF entry */
  2322. if (!GET_FIELD(val, IGU_MAPPING_LINE_VALID) &&
  2323. GET_FIELD(val, IGU_MAPPING_LINE_PF_VALID))
  2324. break;
  2325. if (blk->is_pf) {
  2326. if (blk->function_id == p_hwfn->rel_pf_id) {
  2327. blk->status |= QED_IGU_STATUS_PF;
  2328. if (blk->vector_number == 0) {
  2329. if (p_igu_info->igu_dsb_id == 0xffff)
  2330. p_igu_info->igu_dsb_id = sb_id;
  2331. } else {
  2332. if (p_igu_info->igu_base_sb ==
  2333. 0xffff) {
  2334. p_igu_info->igu_base_sb = sb_id;
  2335. } else if (prev_sb_id != sb_id - 1) {
  2336. DP_NOTICE(p_hwfn->cdev,
  2337. "consecutive igu vectors for HWFN %x broken",
  2338. p_hwfn->rel_pf_id);
  2339. break;
  2340. }
  2341. prev_sb_id = sb_id;
  2342. /* we don't count the default */
  2343. (p_igu_info->igu_sb_cnt)++;
  2344. }
  2345. }
  2346. }
  2347. }
  2348. DP_VERBOSE(p_hwfn, NETIF_MSG_INTR,
  2349. "IGU igu_base_sb=0x%x igu_sb_cnt=%d igu_dsb_id=0x%x\n",
  2350. p_igu_info->igu_base_sb,
  2351. p_igu_info->igu_sb_cnt,
  2352. p_igu_info->igu_dsb_id);
  2353. if (p_igu_info->igu_base_sb == 0xffff ||
  2354. p_igu_info->igu_dsb_id == 0xffff ||
  2355. p_igu_info->igu_sb_cnt == 0) {
  2356. DP_NOTICE(p_hwfn,
  2357. "IGU CAM returned invalid values igu_base_sb=0x%x igu_sb_cnt=%d igu_dsb_id=0x%x\n",
  2358. p_igu_info->igu_base_sb,
  2359. p_igu_info->igu_sb_cnt,
  2360. p_igu_info->igu_dsb_id);
  2361. return -EINVAL;
  2362. }
  2363. return 0;
  2364. }
  2365. /**
  2366. * @brief Initialize igu runtime registers
  2367. *
  2368. * @param p_hwfn
  2369. */
  2370. void qed_int_igu_init_rt(struct qed_hwfn *p_hwfn)
  2371. {
  2372. u32 igu_pf_conf = 0;
  2373. igu_pf_conf |= IGU_PF_CONF_FUNC_EN;
  2374. STORE_RT_REG(p_hwfn, IGU_REG_PF_CONFIGURATION_RT_OFFSET, igu_pf_conf);
  2375. }
  2376. u64 qed_int_igu_read_sisr_reg(struct qed_hwfn *p_hwfn)
  2377. {
  2378. u64 intr_status = 0;
  2379. u32 intr_status_lo = 0;
  2380. u32 intr_status_hi = 0;
  2381. u32 lsb_igu_cmd_addr = IGU_REG_SISR_MDPC_WMASK_LSB_UPPER -
  2382. IGU_CMD_INT_ACK_BASE;
  2383. u32 msb_igu_cmd_addr = IGU_REG_SISR_MDPC_WMASK_MSB_UPPER -
  2384. IGU_CMD_INT_ACK_BASE;
  2385. intr_status_lo = REG_RD(p_hwfn,
  2386. GTT_BAR0_MAP_REG_IGU_CMD +
  2387. lsb_igu_cmd_addr * 8);
  2388. intr_status_hi = REG_RD(p_hwfn,
  2389. GTT_BAR0_MAP_REG_IGU_CMD +
  2390. msb_igu_cmd_addr * 8);
  2391. intr_status = ((u64)intr_status_hi << 32) + (u64)intr_status_lo;
  2392. return intr_status;
  2393. }
  2394. static void qed_int_sp_dpc_setup(struct qed_hwfn *p_hwfn)
  2395. {
  2396. tasklet_init(p_hwfn->sp_dpc,
  2397. qed_int_sp_dpc, (unsigned long)p_hwfn);
  2398. p_hwfn->b_sp_dpc_enabled = true;
  2399. }
  2400. static int qed_int_sp_dpc_alloc(struct qed_hwfn *p_hwfn)
  2401. {
  2402. p_hwfn->sp_dpc = kmalloc(sizeof(*p_hwfn->sp_dpc), GFP_KERNEL);
  2403. if (!p_hwfn->sp_dpc)
  2404. return -ENOMEM;
  2405. return 0;
  2406. }
  2407. static void qed_int_sp_dpc_free(struct qed_hwfn *p_hwfn)
  2408. {
  2409. kfree(p_hwfn->sp_dpc);
  2410. }
  2411. int qed_int_alloc(struct qed_hwfn *p_hwfn,
  2412. struct qed_ptt *p_ptt)
  2413. {
  2414. int rc = 0;
  2415. rc = qed_int_sp_dpc_alloc(p_hwfn);
  2416. if (rc) {
  2417. DP_ERR(p_hwfn->cdev, "Failed to allocate sp dpc mem\n");
  2418. return rc;
  2419. }
  2420. rc = qed_int_sp_sb_alloc(p_hwfn, p_ptt);
  2421. if (rc) {
  2422. DP_ERR(p_hwfn->cdev, "Failed to allocate sp sb mem\n");
  2423. return rc;
  2424. }
  2425. rc = qed_int_sb_attn_alloc(p_hwfn, p_ptt);
  2426. if (rc) {
  2427. DP_ERR(p_hwfn->cdev, "Failed to allocate sb attn mem\n");
  2428. return rc;
  2429. }
  2430. return rc;
  2431. }
  2432. void qed_int_free(struct qed_hwfn *p_hwfn)
  2433. {
  2434. qed_int_sp_sb_free(p_hwfn);
  2435. qed_int_sb_attn_free(p_hwfn);
  2436. qed_int_sp_dpc_free(p_hwfn);
  2437. }
  2438. void qed_int_setup(struct qed_hwfn *p_hwfn,
  2439. struct qed_ptt *p_ptt)
  2440. {
  2441. qed_int_sb_setup(p_hwfn, p_ptt, &p_hwfn->p_sp_sb->sb_info);
  2442. qed_int_sb_attn_setup(p_hwfn, p_ptt);
  2443. qed_int_sp_dpc_setup(p_hwfn);
  2444. }
  2445. void qed_int_get_num_sbs(struct qed_hwfn *p_hwfn,
  2446. struct qed_sb_cnt_info *p_sb_cnt_info)
  2447. {
  2448. struct qed_igu_info *info = p_hwfn->hw_info.p_igu_info;
  2449. if (!info || !p_sb_cnt_info)
  2450. return;
  2451. p_sb_cnt_info->sb_cnt = info->igu_sb_cnt;
  2452. p_sb_cnt_info->sb_iov_cnt = info->igu_sb_cnt_iov;
  2453. p_sb_cnt_info->sb_free_blk = info->free_blks;
  2454. }
  2455. void qed_int_disable_post_isr_release(struct qed_dev *cdev)
  2456. {
  2457. int i;
  2458. for_each_hwfn(cdev, i)
  2459. cdev->hwfns[i].b_int_requested = false;
  2460. }