tegra194-cbb.c 94 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved
  4. *
  5. * The driver handles Error's from Control Backbone(CBB) generated due to
  6. * illegal accesses. When an error is reported from a NOC within CBB,
  7. * the driver checks ErrVld status of all three Error Logger's of that NOC.
  8. * It then prints debug information about failed transaction using ErrLog
  9. * registers of error logger which has ErrVld set. Currently, SLV, DEC,
  10. * TMO, SEC, UNS are the codes which are supported by CBB.
  11. */
  12. #include <linux/clk.h>
  13. #include <linux/cpufeature.h>
  14. #include <linux/debugfs.h>
  15. #include <linux/module.h>
  16. #include <linux/of.h>
  17. #include <linux/of_address.h>
  18. #include <linux/platform_device.h>
  19. #include <linux/device.h>
  20. #include <linux/io.h>
  21. #include <linux/interrupt.h>
  22. #include <linux/ioport.h>
  23. #include <soc/tegra/fuse.h>
  24. #include <soc/tegra/tegra-cbb.h>
  25. #define ERRLOGGER_0_ID_COREID_0 0x00000000
  26. #define ERRLOGGER_0_ID_REVISIONID_0 0x00000004
  27. #define ERRLOGGER_0_FAULTEN_0 0x00000008
  28. #define ERRLOGGER_0_ERRVLD_0 0x0000000c
  29. #define ERRLOGGER_0_ERRCLR_0 0x00000010
  30. #define ERRLOGGER_0_ERRLOG0_0 0x00000014
  31. #define ERRLOGGER_0_ERRLOG1_0 0x00000018
  32. #define ERRLOGGER_0_RSVD_00_0 0x0000001c
  33. #define ERRLOGGER_0_ERRLOG3_0 0x00000020
  34. #define ERRLOGGER_0_ERRLOG4_0 0x00000024
  35. #define ERRLOGGER_0_ERRLOG5_0 0x00000028
  36. #define ERRLOGGER_0_STALLEN_0 0x00000038
  37. #define ERRLOGGER_1_ID_COREID_0 0x00000080
  38. #define ERRLOGGER_1_ID_REVISIONID_0 0x00000084
  39. #define ERRLOGGER_1_FAULTEN_0 0x00000088
  40. #define ERRLOGGER_1_ERRVLD_0 0x0000008c
  41. #define ERRLOGGER_1_ERRCLR_0 0x00000090
  42. #define ERRLOGGER_1_ERRLOG0_0 0x00000094
  43. #define ERRLOGGER_1_ERRLOG1_0 0x00000098
  44. #define ERRLOGGER_1_RSVD_00_0 0x0000009c
  45. #define ERRLOGGER_1_ERRLOG3_0 0x000000a0
  46. #define ERRLOGGER_1_ERRLOG4_0 0x000000a4
  47. #define ERRLOGGER_1_ERRLOG5_0 0x000000a8
  48. #define ERRLOGGER_1_STALLEN_0 0x000000b8
  49. #define ERRLOGGER_2_ID_COREID_0 0x00000100
  50. #define ERRLOGGER_2_ID_REVISIONID_0 0x00000104
  51. #define ERRLOGGER_2_FAULTEN_0 0x00000108
  52. #define ERRLOGGER_2_ERRVLD_0 0x0000010c
  53. #define ERRLOGGER_2_ERRCLR_0 0x00000110
  54. #define ERRLOGGER_2_ERRLOG0_0 0x00000114
  55. #define ERRLOGGER_2_ERRLOG1_0 0x00000118
  56. #define ERRLOGGER_2_RSVD_00_0 0x0000011c
  57. #define ERRLOGGER_2_ERRLOG3_0 0x00000120
  58. #define ERRLOGGER_2_ERRLOG4_0 0x00000124
  59. #define ERRLOGGER_2_ERRLOG5_0 0x00000128
  60. #define ERRLOGGER_2_STALLEN_0 0x00000138
  61. #define CBB_NOC_INITFLOW GENMASK(23, 20)
  62. #define CBB_NOC_TARGFLOW GENMASK(19, 16)
  63. #define CBB_NOC_TARG_SUBRANGE GENMASK(15, 9)
  64. #define CBB_NOC_SEQID GENMASK(8, 0)
  65. #define BPMP_NOC_INITFLOW GENMASK(20, 18)
  66. #define BPMP_NOC_TARGFLOW GENMASK(17, 13)
  67. #define BPMP_NOC_TARG_SUBRANGE GENMASK(12, 9)
  68. #define BPMP_NOC_SEQID GENMASK(8, 0)
  69. #define AON_NOC_INITFLOW GENMASK(22, 21)
  70. #define AON_NOC_TARGFLOW GENMASK(20, 15)
  71. #define AON_NOC_TARG_SUBRANGE GENMASK(14, 9)
  72. #define AON_NOC_SEQID GENMASK(8, 0)
  73. #define SCE_NOC_INITFLOW GENMASK(21, 19)
  74. #define SCE_NOC_TARGFLOW GENMASK(18, 14)
  75. #define SCE_NOC_TARG_SUBRANGE GENMASK(13, 9)
  76. #define SCE_NOC_SEQID GENMASK(8, 0)
  77. #define CBB_NOC_AXCACHE GENMASK(3, 0)
  78. #define CBB_NOC_NON_MOD GENMASK(4, 4)
  79. #define CBB_NOC_AXPROT GENMASK(7, 5)
  80. #define CBB_NOC_FALCONSEC GENMASK(9, 8)
  81. #define CBB_NOC_GRPSEC GENMASK(16, 10)
  82. #define CBB_NOC_VQC GENMASK(18, 17)
  83. #define CBB_NOC_MSTR_ID GENMASK(22, 19)
  84. #define CBB_NOC_AXI_ID GENMASK(30, 23)
  85. #define CLUSTER_NOC_AXCACHE GENMASK(3, 0)
  86. #define CLUSTER_NOC_AXPROT GENMASK(6, 4)
  87. #define CLUSTER_NOC_FALCONSEC GENMASK(8, 7)
  88. #define CLUSTER_NOC_GRPSEC GENMASK(15, 9)
  89. #define CLUSTER_NOC_VQC GENMASK(17, 16)
  90. #define CLUSTER_NOC_MSTR_ID GENMASK(21, 18)
  91. #define CBB_ERR_OPC GENMASK(4, 1)
  92. #define CBB_ERR_ERRCODE GENMASK(10, 8)
  93. #define CBB_ERR_LEN1 GENMASK(27, 16)
  94. #define DMAAPB_X_RAW_INTERRUPT_STATUS 0x2ec
  95. struct tegra194_cbb_packet_header {
  96. bool lock; // [0]
  97. u8 opc; // [4:1]
  98. u8 errcode; // [10:8]= RD, RDW, RDL, RDX, WR, WRW, WRC, PRE, URG
  99. u16 len1; // [27:16]
  100. bool format; // [31] = 1 -> FlexNoC versions 2.7 & above
  101. };
  102. struct tegra194_cbb_aperture {
  103. u8 initflow;
  104. u8 targflow;
  105. u8 targ_subrange;
  106. u8 init_mapping;
  107. u32 init_localaddress;
  108. u8 targ_mapping;
  109. u32 targ_localaddress;
  110. u16 seqid;
  111. };
  112. struct tegra194_cbb_userbits {
  113. u8 axcache;
  114. u8 non_mod;
  115. u8 axprot;
  116. u8 falconsec;
  117. u8 grpsec;
  118. u8 vqc;
  119. u8 mstr_id;
  120. u8 axi_id;
  121. };
  122. struct tegra194_cbb_noc_data {
  123. const char *name;
  124. bool erd_mask_inband_err;
  125. const char * const *master_id;
  126. unsigned int max_aperture;
  127. const struct tegra194_cbb_aperture *noc_aperture;
  128. const char * const *routeid_initflow;
  129. const char * const *routeid_targflow;
  130. void (*parse_routeid)(struct tegra194_cbb_aperture *info, u64 routeid);
  131. void (*parse_userbits)(struct tegra194_cbb_userbits *usrbits, u32 elog_5);
  132. };
  133. struct tegra194_axi2apb_bridge {
  134. struct resource res;
  135. void __iomem *base;
  136. };
  137. struct tegra194_cbb {
  138. struct tegra_cbb base;
  139. const struct tegra194_cbb_noc_data *noc;
  140. struct resource *res;
  141. void __iomem *regs;
  142. unsigned int num_intr;
  143. unsigned int sec_irq;
  144. unsigned int nonsec_irq;
  145. u32 errlog0;
  146. u32 errlog1;
  147. u32 errlog2;
  148. u32 errlog3;
  149. u32 errlog4;
  150. u32 errlog5;
  151. struct tegra194_axi2apb_bridge *bridges;
  152. unsigned int num_bridges;
  153. };
  154. static inline struct tegra194_cbb *to_tegra194_cbb(struct tegra_cbb *cbb)
  155. {
  156. return container_of(cbb, struct tegra194_cbb, base);
  157. }
  158. static LIST_HEAD(cbb_list);
  159. static DEFINE_SPINLOCK(cbb_lock);
  160. static const char * const tegra194_cbb_trantype[] = {
  161. "RD - Read, Incrementing",
  162. "RDW - Read, Wrap", /* Not Supported */
  163. "RDX - Exclusive Read", /* Not Supported */
  164. "RDL - Linked Read", /* Not Supported */
  165. "WR - Write, Incrementing",
  166. "WRW - Write, Wrap", /* Not Supported */
  167. "WRC - Exclusive Write", /* Not Supported */
  168. "PRE - Preamble Sequence for Fixed Accesses"
  169. };
  170. static const char * const tegra194_axi2apb_error[] = {
  171. "SFIFONE - Status FIFO Not Empty interrupt",
  172. "SFIFOF - Status FIFO Full interrupt",
  173. "TIM - Timer(Timeout) interrupt",
  174. "SLV - SLVERR interrupt",
  175. "NULL",
  176. "ERBF - Early response buffer Full interrupt",
  177. "NULL",
  178. "RDFIFOF - Read Response FIFO Full interrupt",
  179. "WRFIFOF - Write Response FIFO Full interrupt",
  180. "CH0DFIFOF - Ch0 Data FIFO Full interrupt",
  181. "CH1DFIFOF - Ch1 Data FIFO Full interrupt",
  182. "CH2DFIFOF - Ch2 Data FIFO Full interrupt",
  183. "UAT - Unsupported alignment type error",
  184. "UBS - Unsupported burst size error",
  185. "UBE - Unsupported Byte Enable error",
  186. "UBT - Unsupported burst type error",
  187. "BFS - Block Firewall security error",
  188. "ARFS - Address Range Firewall security error",
  189. "CH0RFIFOF - Ch0 Request FIFO Full interrupt",
  190. "CH1RFIFOF - Ch1 Request FIFO Full interrupt",
  191. "CH2RFIFOF - Ch2 Request FIFO Full interrupt"
  192. };
  193. static const char * const tegra194_master_id[] = {
  194. [0x0] = "CCPLEX",
  195. [0x1] = "CCPLEX_DPMU",
  196. [0x2] = "BPMP",
  197. [0x3] = "AON",
  198. [0x4] = "SCE",
  199. [0x5] = "GPCDMA_PERIPHERAL",
  200. [0x6] = "TSECA",
  201. [0x7] = "TSECB",
  202. [0x8] = "JTAGM_DFT",
  203. [0x9] = "CORESIGHT_AXIAP",
  204. [0xa] = "APE",
  205. [0xb] = "PEATR",
  206. [0xc] = "NVDEC",
  207. [0xd] = "RCE",
  208. [0xe] = "NVDEC1"
  209. };
  210. static const struct tegra_cbb_error tegra194_cbb_errors[] = {
  211. {
  212. .code = "SLV",
  213. .source = "Target",
  214. .desc = "Target error detected by CBB slave"
  215. }, {
  216. .code = "DEC",
  217. .source = "Initiator NIU",
  218. .desc = "Address decode error"
  219. }, {
  220. .code = "UNS",
  221. .source = "Target NIU",
  222. .desc = "Unsupported request. Not a valid transaction"
  223. }, {
  224. .code = "DISC", /* Not Supported by CBB */
  225. .source = "Power Disconnect",
  226. .desc = "Disconnected target or domain"
  227. }, {
  228. .code = "SEC",
  229. .source = "Initiator NIU or Firewall",
  230. .desc = "Security violation. Firewall error"
  231. }, {
  232. .code = "HIDE", /* Not Supported by CBB */
  233. .source = "Firewall",
  234. .desc = "Hidden security violation, reported as OK to initiator"
  235. }, {
  236. .code = "TMO",
  237. .source = "Target NIU",
  238. .desc = "Target time-out error"
  239. }, {
  240. .code = "RSV",
  241. .source = "None",
  242. .desc = "Reserved"
  243. }
  244. };
  245. /*
  246. * CBB NOC aperture lookup table as per file "cbb_central_noc_Structure.info".
  247. */
  248. static const char * const tegra194_cbbcentralnoc_routeid_initflow[] = {
  249. [0x0] = "aon_p2ps/I/aon",
  250. [0x1] = "ape_p2ps/I/ape_p2ps",
  251. [0x2] = "bpmp_p2ps/I/bpmp_p2ps",
  252. [0x3] = "ccroc_p2ps/I/ccroc_p2ps",
  253. [0x4] = "csite_p2ps/I/0",
  254. [0x5] = "gpcdma_mmio_p2ps/I/0",
  255. [0x6] = "jtag_p2ps/I/0",
  256. [0x7] = "nvdec1_p2ps/I/0",
  257. [0x8] = "nvdec_p2ps/I/0",
  258. [0x9] = "rce_p2ps/I/rce_p2ps",
  259. [0xa] = "sce_p2ps/I/sce_p2ps",
  260. [0xb] = "tseca_p2ps/I/0",
  261. [0xc] = "tsecb_p2ps/I/0",
  262. [0xd] = "RESERVED",
  263. [0xe] = "RESERVED",
  264. [0xf] = "RESERVED"
  265. };
  266. static const char * const tegra194_cbbcentralnoc_routeid_targflow[] = {
  267. [0x0] = "SVC/T/intreg",
  268. [0x1] = "axis_satellite_axi2apb_p2pm/T/axis_satellite_axi2apb_p2pm",
  269. [0x2] = "axis_satellite_grout/T/axis_satellite_grout",
  270. [0x3] = "cbb_firewall/T/cbb_firewall",
  271. [0x4] = "gpu_p2pm/T/gpu_p2pm",
  272. [0x5] = "host1x_p2pm/T/host1x_p2pm",
  273. [0x6] = "sapb_3_p2pm/T/sapb_3_p2pm",
  274. [0x7] = "smmu0_p2pm/T/smmu0_p2pm",
  275. [0x8] = "smmu1_p2pm/T/smmu1_p2pm",
  276. [0x9] = "smmu2_p2pm/T/smmu2_p2pm",
  277. [0xa] = "stm_p2pm/T/stm_p2pm",
  278. [0xb] = "RESERVED",
  279. [0xc] = "RESERVED",
  280. [0xd] = "RESERVED",
  281. [0xe] = "RESERVED",
  282. [0xf] = "RESERVED"
  283. };
  284. /*
  285. * Fields of CBB NOC lookup table:
  286. * Init flow, Targ flow, Targ subrange, Init mapping, Init localAddress,
  287. * Targ mapping, Targ localAddress
  288. * ----------------------------------------------------------------------------
  289. */
  290. static const struct tegra194_cbb_aperture tegra194_cbbcentralnoc_apert_lookup[] = {
  291. { 0x0, 0x0, 0x00, 0x0, 0x02300000, 0, 0x00000000 },
  292. { 0x0, 0x1, 0x00, 0x0, 0x02003000, 0, 0x02003000 },
  293. { 0x0, 0x1, 0x01, 0x0, 0x02006000, 2, 0x02006000 },
  294. { 0x0, 0x1, 0x02, 0x0, 0x02016000, 3, 0x02016000 },
  295. { 0x0, 0x1, 0x03, 0x0, 0x0201d000, 4, 0x0201d000 },
  296. { 0x0, 0x1, 0x04, 0x0, 0x0202b000, 6, 0x0202b000 },
  297. { 0x0, 0x1, 0x05, 0x0, 0x02434000, 20, 0x02434000 },
  298. { 0x0, 0x1, 0x06, 0x0, 0x02436000, 21, 0x02436000 },
  299. { 0x0, 0x1, 0x07, 0x0, 0x02438000, 22, 0x02438000 },
  300. { 0x0, 0x1, 0x08, 0x0, 0x02445000, 24, 0x02445000 },
  301. { 0x0, 0x1, 0x09, 0x0, 0x02446000, 25, 0x02446000 },
  302. { 0x0, 0x1, 0x0a, 0x0, 0x02004000, 1, 0x02004000 },
  303. { 0x0, 0x1, 0x0b, 0x0, 0x0201e000, 5, 0x0201e000 },
  304. { 0x0, 0x1, 0x0c, 0x0, 0x0202c000, 7, 0x0202c000 },
  305. { 0x0, 0x1, 0x0d, 0x0, 0x02204000, 8, 0x02204000 },
  306. { 0x0, 0x1, 0x0e, 0x0, 0x02214000, 9, 0x02214000 },
  307. { 0x0, 0x1, 0x0f, 0x0, 0x02224000, 10, 0x02224000 },
  308. { 0x0, 0x1, 0x10, 0x0, 0x02234000, 11, 0x02234000 },
  309. { 0x0, 0x1, 0x11, 0x0, 0x02244000, 12, 0x02244000 },
  310. { 0x0, 0x1, 0x12, 0x0, 0x02254000, 13, 0x02254000 },
  311. { 0x0, 0x1, 0x13, 0x0, 0x02264000, 14, 0x02264000 },
  312. { 0x0, 0x1, 0x14, 0x0, 0x02274000, 15, 0x02274000 },
  313. { 0x0, 0x1, 0x15, 0x0, 0x02284000, 16, 0x02284000 },
  314. { 0x0, 0x1, 0x16, 0x0, 0x0243a000, 23, 0x0243a000 },
  315. { 0x0, 0x1, 0x17, 0x0, 0x02370000, 17, 0x02370000 },
  316. { 0x0, 0x1, 0x18, 0x0, 0x023d0000, 18, 0x023d0000 },
  317. { 0x0, 0x1, 0x19, 0x0, 0x023e0000, 19, 0x023e0000 },
  318. { 0x0, 0x1, 0x1a, 0x0, 0x02450000, 26, 0x02450000 },
  319. { 0x0, 0x1, 0x1b, 0x0, 0x02460000, 27, 0x02460000 },
  320. { 0x0, 0x1, 0x1c, 0x0, 0x02490000, 28, 0x02490000 },
  321. { 0x0, 0x1, 0x1d, 0x0, 0x03130000, 31, 0x03130000 },
  322. { 0x0, 0x1, 0x1e, 0x0, 0x03160000, 32, 0x03160000 },
  323. { 0x0, 0x1, 0x1f, 0x0, 0x03270000, 33, 0x03270000 },
  324. { 0x0, 0x1, 0x20, 0x0, 0x032e0000, 35, 0x032e0000 },
  325. { 0x0, 0x1, 0x21, 0x0, 0x03300000, 36, 0x03300000 },
  326. { 0x0, 0x1, 0x22, 0x0, 0x13090000, 40, 0x13090000 },
  327. { 0x0, 0x1, 0x23, 0x0, 0x20120000, 43, 0x20120000 },
  328. { 0x0, 0x1, 0x24, 0x0, 0x20170000, 44, 0x20170000 },
  329. { 0x0, 0x1, 0x25, 0x0, 0x20190000, 45, 0x20190000 },
  330. { 0x0, 0x1, 0x26, 0x0, 0x201b0000, 46, 0x201b0000 },
  331. { 0x0, 0x1, 0x27, 0x0, 0x20250000, 47, 0x20250000 },
  332. { 0x0, 0x1, 0x28, 0x0, 0x20260000, 48, 0x20260000 },
  333. { 0x0, 0x1, 0x29, 0x0, 0x20420000, 49, 0x20420000 },
  334. { 0x0, 0x1, 0x2a, 0x0, 0x20460000, 50, 0x20460000 },
  335. { 0x0, 0x1, 0x2b, 0x0, 0x204f0000, 51, 0x204f0000 },
  336. { 0x0, 0x1, 0x2c, 0x0, 0x20520000, 52, 0x20520000 },
  337. { 0x0, 0x1, 0x2d, 0x0, 0x20580000, 53, 0x20580000 },
  338. { 0x0, 0x1, 0x2e, 0x0, 0x205a0000, 54, 0x205a0000 },
  339. { 0x0, 0x1, 0x2f, 0x0, 0x205c0000, 55, 0x205c0000 },
  340. { 0x0, 0x1, 0x30, 0x0, 0x20690000, 56, 0x20690000 },
  341. { 0x0, 0x1, 0x31, 0x0, 0x20770000, 57, 0x20770000 },
  342. { 0x0, 0x1, 0x32, 0x0, 0x20790000, 58, 0x20790000 },
  343. { 0x0, 0x1, 0x33, 0x0, 0x20880000, 59, 0x20880000 },
  344. { 0x0, 0x1, 0x34, 0x0, 0x20990000, 62, 0x20990000 },
  345. { 0x0, 0x1, 0x35, 0x0, 0x20e10000, 65, 0x20e10000 },
  346. { 0x0, 0x1, 0x36, 0x0, 0x20e70000, 66, 0x20e70000 },
  347. { 0x0, 0x1, 0x37, 0x0, 0x20e80000, 67, 0x20e80000 },
  348. { 0x0, 0x1, 0x38, 0x0, 0x20f30000, 68, 0x20f30000 },
  349. { 0x0, 0x1, 0x39, 0x0, 0x20f50000, 69, 0x20f50000 },
  350. { 0x0, 0x1, 0x3a, 0x0, 0x20fc0000, 70, 0x20fc0000 },
  351. { 0x0, 0x1, 0x3b, 0x0, 0x21110000, 72, 0x21110000 },
  352. { 0x0, 0x1, 0x3c, 0x0, 0x21270000, 73, 0x21270000 },
  353. { 0x0, 0x1, 0x3d, 0x0, 0x21290000, 74, 0x21290000 },
  354. { 0x0, 0x1, 0x3e, 0x0, 0x21840000, 75, 0x21840000 },
  355. { 0x0, 0x1, 0x3f, 0x0, 0x21880000, 76, 0x21880000 },
  356. { 0x0, 0x1, 0x40, 0x0, 0x218d0000, 77, 0x218d0000 },
  357. { 0x0, 0x1, 0x41, 0x0, 0x21950000, 78, 0x21950000 },
  358. { 0x0, 0x1, 0x42, 0x0, 0x21960000, 79, 0x21960000 },
  359. { 0x0, 0x1, 0x43, 0x0, 0x21a10000, 80, 0x21a10000 },
  360. { 0x0, 0x1, 0x44, 0x0, 0x024a0000, 29, 0x024a0000 },
  361. { 0x0, 0x1, 0x45, 0x0, 0x024c0000, 30, 0x024c0000 },
  362. { 0x0, 0x1, 0x46, 0x0, 0x032c0000, 34, 0x032c0000 },
  363. { 0x0, 0x1, 0x47, 0x0, 0x03400000, 37, 0x03400000 },
  364. { 0x0, 0x1, 0x48, 0x0, 0x130a0000, 41, 0x130a0000 },
  365. { 0x0, 0x1, 0x49, 0x0, 0x130c0000, 42, 0x130c0000 },
  366. { 0x0, 0x1, 0x4a, 0x0, 0x208a0000, 60, 0x208a0000 },
  367. { 0x0, 0x1, 0x4b, 0x0, 0x208c0000, 61, 0x208c0000 },
  368. { 0x0, 0x1, 0x4c, 0x0, 0x209a0000, 63, 0x209a0000 },
  369. { 0x0, 0x1, 0x4d, 0x0, 0x21a40000, 81, 0x21a40000 },
  370. { 0x0, 0x1, 0x4e, 0x0, 0x03440000, 38, 0x03440000 },
  371. { 0x0, 0x1, 0x4f, 0x0, 0x20d00000, 64, 0x20d00000 },
  372. { 0x0, 0x1, 0x50, 0x0, 0x21000000, 71, 0x21000000 },
  373. { 0x0, 0x1, 0x51, 0x0, 0x0b000000, 39, 0x0b000000 },
  374. { 0x0, 0x2, 0x00, 0x0, 0x00000000, 0, 0x00000000 },
  375. { 0x0, 0x3, 0x00, 0x0, 0x02340000, 0, 0x00000000 },
  376. { 0x0, 0x4, 0x00, 0x0, 0x17000000, 0, 0x17000000 },
  377. { 0x0, 0x4, 0x01, 0x0, 0x18000000, 1, 0x18000000 },
  378. { 0x0, 0x5, 0x00, 0x0, 0x13e80000, 1, 0x13e80000 },
  379. { 0x0, 0x5, 0x01, 0x0, 0x15810000, 12, 0x15810000 },
  380. { 0x0, 0x5, 0x02, 0x0, 0x15840000, 14, 0x15840000 },
  381. { 0x0, 0x5, 0x03, 0x0, 0x15a40000, 17, 0x15a40000 },
  382. { 0x0, 0x5, 0x04, 0x0, 0x13f00000, 3, 0x13f00000 },
  383. { 0x0, 0x5, 0x05, 0x0, 0x15820000, 13, 0x15820000 },
  384. { 0x0, 0x5, 0x06, 0x0, 0x13ec0000, 2, 0x13ec0000 },
  385. { 0x0, 0x5, 0x07, 0x0, 0x15200000, 6, 0x15200000 },
  386. { 0x0, 0x5, 0x08, 0x0, 0x15340000, 7, 0x15340000 },
  387. { 0x0, 0x5, 0x09, 0x0, 0x15380000, 8, 0x15380000 },
  388. { 0x0, 0x5, 0x0a, 0x0, 0x15500000, 10, 0x15500000 },
  389. { 0x0, 0x5, 0x0b, 0x0, 0x155c0000, 11, 0x155c0000 },
  390. { 0x0, 0x5, 0x0c, 0x0, 0x15a00000, 16, 0x15a00000 },
  391. { 0x0, 0x5, 0x0d, 0x0, 0x13e00000, 0, 0x13e00000 },
  392. { 0x0, 0x5, 0x0e, 0x0, 0x15100000, 5, 0x15100000 },
  393. { 0x0, 0x5, 0x0f, 0x0, 0x15480000, 9, 0x15480000 },
  394. { 0x0, 0x5, 0x10, 0x0, 0x15880000, 15, 0x15880000 },
  395. { 0x0, 0x5, 0x11, 0x0, 0x15a80000, 18, 0x15a80000 },
  396. { 0x0, 0x5, 0x12, 0x0, 0x15b00000, 19, 0x15b00000 },
  397. { 0x0, 0x5, 0x13, 0x0, 0x14800000, 4, 0x14800000 },
  398. { 0x0, 0x5, 0x14, 0x0, 0x15c00000, 20, 0x15c00000 },
  399. { 0x0, 0x5, 0x15, 0x0, 0x16000000, 21, 0x16000000 },
  400. { 0x0, 0x6, 0x00, 0x0, 0x02000000, 4, 0x02000000 },
  401. { 0x0, 0x6, 0x01, 0x0, 0x02007000, 5, 0x02007000 },
  402. { 0x0, 0x6, 0x02, 0x0, 0x02008000, 6, 0x02008000 },
  403. { 0x0, 0x6, 0x03, 0x0, 0x02013000, 7, 0x02013000 },
  404. { 0x0, 0x6, 0x04, 0x0, 0x0201c000, 8, 0x0201c000 },
  405. { 0x0, 0x6, 0x05, 0x0, 0x02020000, 9, 0x02020000 },
  406. { 0x0, 0x6, 0x06, 0x0, 0x0202a000, 10, 0x0202a000 },
  407. { 0x0, 0x6, 0x07, 0x0, 0x0202e000, 11, 0x0202e000 },
  408. { 0x0, 0x6, 0x08, 0x0, 0x06400000, 33, 0x06400000 },
  409. { 0x0, 0x6, 0x09, 0x0, 0x02038000, 12, 0x02038000 },
  410. { 0x0, 0x6, 0x0a, 0x0, 0x00100000, 0, 0x00100000 },
  411. { 0x0, 0x6, 0x0b, 0x0, 0x023b0000, 13, 0x023b0000 },
  412. { 0x0, 0x6, 0x0c, 0x0, 0x02800000, 16, 0x02800000 },
  413. { 0x0, 0x6, 0x0d, 0x0, 0x030e0000, 22, 0x030e0000 },
  414. { 0x0, 0x6, 0x0e, 0x0, 0x03800000, 23, 0x03800000 },
  415. { 0x0, 0x6, 0x0f, 0x0, 0x03980000, 25, 0x03980000 },
  416. { 0x0, 0x6, 0x10, 0x0, 0x03a60000, 26, 0x03a60000 },
  417. { 0x0, 0x6, 0x11, 0x0, 0x03d80000, 31, 0x03d80000 },
  418. { 0x0, 0x6, 0x12, 0x0, 0x20000000, 36, 0x20000000 },
  419. { 0x0, 0x6, 0x13, 0x0, 0x20050000, 38, 0x20050000 },
  420. { 0x0, 0x6, 0x14, 0x0, 0x201e0000, 40, 0x201e0000 },
  421. { 0x0, 0x6, 0x15, 0x0, 0x20280000, 42, 0x20280000 },
  422. { 0x0, 0x6, 0x16, 0x0, 0x202c0000, 43, 0x202c0000 },
  423. { 0x0, 0x6, 0x17, 0x0, 0x20390000, 44, 0x20390000 },
  424. { 0x0, 0x6, 0x18, 0x0, 0x20430000, 45, 0x20430000 },
  425. { 0x0, 0x6, 0x19, 0x0, 0x20440000, 46, 0x20440000 },
  426. { 0x0, 0x6, 0x1a, 0x0, 0x204e0000, 47, 0x204e0000 },
  427. { 0x0, 0x6, 0x1b, 0x0, 0x20550000, 48, 0x20550000 },
  428. { 0x0, 0x6, 0x1c, 0x0, 0x20570000, 49, 0x20570000 },
  429. { 0x0, 0x6, 0x1d, 0x0, 0x20590000, 50, 0x20590000 },
  430. { 0x0, 0x6, 0x1e, 0x0, 0x20730000, 52, 0x20730000 },
  431. { 0x0, 0x6, 0x1f, 0x0, 0x209f0000, 54, 0x209f0000 },
  432. { 0x0, 0x6, 0x20, 0x0, 0x20e20000, 55, 0x20e20000 },
  433. { 0x0, 0x6, 0x21, 0x0, 0x20ed0000, 56, 0x20ed0000 },
  434. { 0x0, 0x6, 0x22, 0x0, 0x20fd0000, 57, 0x20fd0000 },
  435. { 0x0, 0x6, 0x23, 0x0, 0x21120000, 59, 0x21120000 },
  436. { 0x0, 0x6, 0x24, 0x0, 0x211a0000, 60, 0x211a0000 },
  437. { 0x0, 0x6, 0x25, 0x0, 0x21850000, 61, 0x21850000 },
  438. { 0x0, 0x6, 0x26, 0x0, 0x21860000, 62, 0x21860000 },
  439. { 0x0, 0x6, 0x27, 0x0, 0x21890000, 63, 0x21890000 },
  440. { 0x0, 0x6, 0x28, 0x0, 0x21970000, 64, 0x21970000 },
  441. { 0x0, 0x6, 0x29, 0x0, 0x21990000, 65, 0x21990000 },
  442. { 0x0, 0x6, 0x2a, 0x0, 0x21a00000, 66, 0x21a00000 },
  443. { 0x0, 0x6, 0x2b, 0x0, 0x21a90000, 68, 0x21a90000 },
  444. { 0x0, 0x6, 0x2c, 0x0, 0x21ac0000, 70, 0x21ac0000 },
  445. { 0x0, 0x6, 0x2d, 0x0, 0x01f80000, 3, 0x01f80000 },
  446. { 0x0, 0x6, 0x2e, 0x0, 0x024e0000, 14, 0x024e0000 },
  447. { 0x0, 0x6, 0x2f, 0x0, 0x030c0000, 21, 0x030c0000 },
  448. { 0x0, 0x6, 0x30, 0x0, 0x03820000, 24, 0x03820000 },
  449. { 0x0, 0x6, 0x31, 0x0, 0x03aa0000, 27, 0x03aa0000 },
  450. { 0x0, 0x6, 0x32, 0x0, 0x03c80000, 29, 0x03c80000 },
  451. { 0x0, 0x6, 0x33, 0x0, 0x130e0000, 34, 0x130e0000 },
  452. { 0x0, 0x6, 0x34, 0x0, 0x20020000, 37, 0x20020000 },
  453. { 0x0, 0x6, 0x35, 0x0, 0x20060000, 39, 0x20060000 },
  454. { 0x0, 0x6, 0x36, 0x0, 0x20200000, 41, 0x20200000 },
  455. { 0x0, 0x6, 0x37, 0x0, 0x206a0000, 51, 0x206a0000 },
  456. { 0x0, 0x6, 0x38, 0x0, 0x20740000, 53, 0x20740000 },
  457. { 0x0, 0x6, 0x39, 0x0, 0x20fe0000, 58, 0x20fe0000 },
  458. { 0x0, 0x6, 0x3a, 0x0, 0x21a20000, 67, 0x21a20000 },
  459. { 0x0, 0x6, 0x3b, 0x0, 0x21aa0000, 69, 0x21aa0000 },
  460. { 0x0, 0x6, 0x3c, 0x0, 0x02b80000, 17, 0x02b80000 },
  461. { 0x0, 0x6, 0x3d, 0x0, 0x03080000, 20, 0x03080000 },
  462. { 0x0, 0x6, 0x3e, 0x0, 0x13100000, 35, 0x13100000 },
  463. { 0x0, 0x6, 0x3f, 0x0, 0x01f00000, 2, 0x01f00000 },
  464. { 0x0, 0x6, 0x40, 0x0, 0x03000000, 19, 0x03000000 },
  465. { 0x0, 0x6, 0x41, 0x0, 0x03c00000, 28, 0x03c00000 },
  466. { 0x0, 0x6, 0x42, 0x0, 0x03d00000, 30, 0x03d00000 },
  467. { 0x0, 0x6, 0x43, 0x0, 0x01700000, 1, 0x01700000 },
  468. { 0x0, 0x6, 0x44, 0x0, 0x02c00000, 18, 0x02c00000 },
  469. { 0x0, 0x6, 0x45, 0x0, 0x02600000, 15, 0x02600000 },
  470. { 0x0, 0x6, 0x46, 0x0, 0x06000000, 32, 0x06000000 },
  471. { 0x0, 0x6, 0x47, 0x0, 0x24000000, 71, 0x24000000 },
  472. { 0x0, 0x7, 0x00, 0x0, 0x12000000, 0, 0x12000000 },
  473. { 0x0, 0x8, 0x00, 0x0, 0x11000000, 0, 0x11000000 },
  474. { 0x0, 0x9, 0x00, 0x0, 0x10000000, 0, 0x10000000 },
  475. { 0x0, 0xa, 0x00, 0x0, 0x22000000, 0, 0x22000000 }
  476. };
  477. /*
  478. * BPMP NOC aperture lookup table as per file "BPMP_NOC_Structure.info".
  479. */
  480. static const char * const tegra194_bpmpnoc_routeid_initflow[] = {
  481. [0x0] = "cbb_i/I/0",
  482. [0x1] = "cpu_m_i/I/0",
  483. [0x2] = "cpu_p_i/I/0",
  484. [0x3] = "cvc_i/I/0",
  485. [0x4] = "dma_m_i/I/0",
  486. [0x5] = "dma_p_i/I/0",
  487. [0x6] = "RESERVED",
  488. [0x7] = "RESERVED"
  489. };
  490. static const char * const tegra194_bpmpnoc_routeid_targflow[] = {
  491. [0x00] = "multiport0_t/T/actmon",
  492. [0x01] = "multiport0_t/T/ast_0",
  493. [0x02] = "multiport0_t/T/ast_1",
  494. [0x03] = "multiport0_t/T/atcm_cfg",
  495. [0x04] = "multiport0_t/T/car",
  496. [0x05] = "multiport0_t/T/central_pwr_mgr",
  497. [0x06] = "multiport0_t/T/central_vtg_ctlr",
  498. [0x07] = "multiport0_t/T/cfg",
  499. [0x08] = "multiport0_t/T/dma",
  500. [0x09] = "multiport0_t/T/err_collator",
  501. [0x0a] = "multiport0_t/T/err_collator_car",
  502. [0x0b] = "multiport0_t/T/fpga_misc",
  503. [0x0c] = "multiport0_t/T/fpga_uart",
  504. [0x0d] = "multiport0_t/T/gte",
  505. [0x0e] = "multiport0_t/T/hsp",
  506. [0x0f] = "multiport0_t/T/misc",
  507. [0x10] = "multiport0_t/T/pm",
  508. [0x11] = "multiport0_t/T/simon0",
  509. [0x12] = "multiport0_t/T/simon1",
  510. [0x13] = "multiport0_t/T/simon2",
  511. [0x14] = "multiport0_t/T/simon3",
  512. [0x15] = "multiport0_t/T/simon4",
  513. [0x16] = "multiport0_t/T/soc_therm",
  514. [0x17] = "multiport0_t/T/tke",
  515. [0x18] = "multiport0_t/T/vic_0",
  516. [0x19] = "multiport0_t/T/vic_1",
  517. [0x1a] = "ast0_t/T/0",
  518. [0x1b] = "ast1_t/T/0",
  519. [0x1c] = "bpmp_noc_firewall/T/0",
  520. [0x1d] = "cbb_t/T/0",
  521. [0x1e] = "cpu_t/T/0",
  522. [0x1f] = "svc_t/T/0"
  523. };
  524. /*
  525. * Fields of BPMP NOC lookup table:
  526. * Init flow, Targ flow, Targ subrange, Init mapping, Init localAddress,
  527. * Targ mapping, Targ localAddress
  528. * ----------------------------------------------------------------------------
  529. */
  530. static const struct tegra194_cbb_aperture tegra194_bpmpnoc_apert_lookup[] = {
  531. { 0x0, 0x1c, 0x0, 0x0, 0x0d640000, 0, 0x00000000 },
  532. { 0x0, 0x1e, 0x0, 0x0, 0x0d400000, 0, 0x0d400000 },
  533. { 0x0, 0x00, 0x0, 0x0, 0x0d230000, 0, 0x00000000 },
  534. { 0x0, 0x01, 0x0, 0x0, 0x0d040000, 0, 0x00000000 },
  535. { 0x0, 0x02, 0x0, 0x0, 0x0d050000, 0, 0x00000000 },
  536. { 0x0, 0x03, 0x0, 0x0, 0x0d000000, 0, 0x00000000 },
  537. { 0x0, 0x04, 0x0, 0x0, 0x20ae0000, 3, 0x000e0000 },
  538. { 0x0, 0x04, 0x1, 0x0, 0x20ac0000, 2, 0x000c0000 },
  539. { 0x0, 0x04, 0x2, 0x0, 0x20a80000, 1, 0x00080000 },
  540. { 0x0, 0x04, 0x3, 0x0, 0x20a00000, 0, 0x00000000 },
  541. { 0x0, 0x05, 0x0, 0x0, 0x0d2a0000, 0, 0x00000000 },
  542. { 0x0, 0x06, 0x0, 0x0, 0x0d290000, 0, 0x00000000 },
  543. { 0x0, 0x07, 0x0, 0x0, 0x0d2c0000, 0, 0x00000000 },
  544. { 0x0, 0x08, 0x0, 0x0, 0x0d0e0000, 4, 0x00080000 },
  545. { 0x0, 0x08, 0x1, 0x0, 0x0d060000, 0, 0x00000000 },
  546. { 0x0, 0x08, 0x2, 0x0, 0x0d080000, 1, 0x00020000 },
  547. { 0x0, 0x08, 0x3, 0x0, 0x0d0a0000, 2, 0x00040000 },
  548. { 0x0, 0x08, 0x4, 0x0, 0x0d0c0000, 3, 0x00060000 },
  549. { 0x0, 0x09, 0x0, 0x0, 0x0d650000, 0, 0x00000000 },
  550. { 0x0, 0x0a, 0x0, 0x0, 0x20af0000, 0, 0x00000000 },
  551. { 0x0, 0x0b, 0x0, 0x0, 0x0d3e0000, 0, 0x00000000 },
  552. { 0x0, 0x0c, 0x0, 0x0, 0x0d3d0000, 0, 0x00000000 },
  553. { 0x0, 0x0d, 0x0, 0x0, 0x0d1e0000, 0, 0x00000000 },
  554. { 0x0, 0x0e, 0x0, 0x0, 0x0d150000, 0, 0x00000000 },
  555. { 0x0, 0x0e, 0x1, 0x0, 0x0d160000, 1, 0x00010000 },
  556. { 0x0, 0x0e, 0x2, 0x0, 0x0d170000, 2, 0x00020000 },
  557. { 0x0, 0x0e, 0x3, 0x0, 0x0d180000, 3, 0x00030000 },
  558. { 0x0, 0x0e, 0x4, 0x0, 0x0d190000, 4, 0x00040000 },
  559. { 0x0, 0x0e, 0x5, 0x0, 0x0d1a0000, 5, 0x00050000 },
  560. { 0x0, 0x0e, 0x6, 0x0, 0x0d1b0000, 6, 0x00060000 },
  561. { 0x0, 0x0e, 0x7, 0x0, 0x0d1c0000, 7, 0x00070000 },
  562. { 0x0, 0x0e, 0x8, 0x0, 0x0d1d0000, 8, 0x00080000 },
  563. { 0x0, 0x0f, 0x0, 0x0, 0x0d660000, 0, 0x00000000 },
  564. { 0x0, 0x10, 0x0, 0x0, 0x0d1f0000, 0, 0x00000000 },
  565. { 0x0, 0x10, 0x1, 0x0, 0x0d200000, 1, 0x00010000 },
  566. { 0x0, 0x10, 0x2, 0x0, 0x0d210000, 2, 0x00020000 },
  567. { 0x0, 0x10, 0x3, 0x0, 0x0d220000, 3, 0x00030000 },
  568. { 0x0, 0x11, 0x0, 0x0, 0x0d240000, 0, 0x00000000 },
  569. { 0x0, 0x12, 0x0, 0x0, 0x0d250000, 0, 0x00000000 },
  570. { 0x0, 0x13, 0x0, 0x0, 0x0d260000, 0, 0x00000000 },
  571. { 0x0, 0x14, 0x0, 0x0, 0x0d270000, 0, 0x00000000 },
  572. { 0x0, 0x15, 0x0, 0x0, 0x0d2b0000, 0, 0x00000000 },
  573. { 0x0, 0x16, 0x0, 0x0, 0x0d280000, 0, 0x00000000 },
  574. { 0x0, 0x17, 0x0, 0x0, 0x0d0f0000, 0, 0x00000000 },
  575. { 0x0, 0x17, 0x1, 0x0, 0x0d100000, 1, 0x00010000 },
  576. { 0x0, 0x17, 0x2, 0x0, 0x0d110000, 2, 0x00020000 },
  577. { 0x0, 0x17, 0x3, 0x0, 0x0d120000, 3, 0x00030000 },
  578. { 0x0, 0x17, 0x4, 0x0, 0x0d130000, 4, 0x00040000 },
  579. { 0x0, 0x17, 0x5, 0x0, 0x0d140000, 5, 0x00050000 },
  580. { 0x0, 0x18, 0x0, 0x0, 0x0d020000, 0, 0x00000000 },
  581. { 0x0, 0x19, 0x0, 0x0, 0x0d030000, 0, 0x00000000 },
  582. { 0x0, 0x1f, 0x0, 0x0, 0x0d600000, 0, 0x00000000 },
  583. { 0x0, 0x1f, 0x1, 0x0, 0x00000000, 0, 0x00000000 },
  584. { 0x1, 0x1a, 0x0, 0x0, 0x40000000, 0, 0x40000000 },
  585. { 0x1, 0x1a, 0x1, 0x1, 0x80000000, 1, 0x80000000 },
  586. { 0x1, 0x1a, 0x2, 0x0, 0x00000000, 0, 0x00000000 },
  587. { 0x2, 0x1c, 0x0, 0x0, 0x0d640000, 0, 0x00000000 },
  588. { 0x2, 0x1d, 0x0, 0x0, 0x20b00000, 8, 0x20b00000 },
  589. { 0x2, 0x1d, 0x1, 0x0, 0x20800000, 7, 0x20800000 },
  590. { 0x2, 0x1d, 0x2, 0x0, 0x20c00000, 9, 0x20c00000 },
  591. { 0x2, 0x1d, 0x3, 0x0, 0x0d800000, 3, 0x0d800000 },
  592. { 0x2, 0x1d, 0x4, 0x0, 0x20000000, 6, 0x20000000 },
  593. { 0x2, 0x1d, 0x5, 0x0, 0x0c000000, 2, 0x0c000000 },
  594. { 0x2, 0x1d, 0x6, 0x0, 0x21000000, 10, 0x21000000 },
  595. { 0x2, 0x1d, 0x7, 0x0, 0x0e000000, 4, 0x0e000000 },
  596. { 0x2, 0x1d, 0x8, 0x0, 0x22000000, 11, 0x22000000 },
  597. { 0x2, 0x1d, 0x9, 0x0, 0x08000000, 1, 0x08000000 },
  598. { 0x2, 0x1d, 0xa, 0x0, 0x24000000, 12, 0x24000000 },
  599. { 0x2, 0x1d, 0xb, 0x0, 0x00000000, 0, 0x00000000 },
  600. { 0x2, 0x1d, 0xc, 0x0, 0x28000000, 13, 0x28000000 },
  601. { 0x2, 0x1d, 0xd, 0x0, 0x10000000, 5, 0x10000000 },
  602. { 0x2, 0x1d, 0xe, 0x0, 0x30000000, 14, 0x30000000 },
  603. { 0x2, 0x00, 0x0, 0x0, 0x0d230000, 0, 0x00000000 },
  604. { 0x2, 0x01, 0x0, 0x0, 0x0d040000, 0, 0x00000000 },
  605. { 0x2, 0x02, 0x0, 0x0, 0x0d050000, 0, 0x00000000 },
  606. { 0x2, 0x03, 0x0, 0x0, 0x0d000000, 0, 0x00000000 },
  607. { 0x2, 0x04, 0x0, 0x0, 0x20ae0000, 3, 0x000e0000 },
  608. { 0x2, 0x04, 0x1, 0x0, 0x20ac0000, 2, 0x000c0000 },
  609. { 0x2, 0x04, 0x2, 0x0, 0x20a80000, 1, 0x00080000 },
  610. { 0x2, 0x04, 0x3, 0x0, 0x20a00000, 0, 0x00000000 },
  611. { 0x2, 0x05, 0x0, 0x0, 0x0d2a0000, 0, 0x00000000 },
  612. { 0x2, 0x06, 0x0, 0x0, 0x0d290000, 0, 0x00000000 },
  613. { 0x2, 0x07, 0x0, 0x0, 0x0d2c0000, 0, 0x00000000 },
  614. { 0x2, 0x08, 0x0, 0x0, 0x0d0e0000, 4, 0x00080000 },
  615. { 0x2, 0x08, 0x1, 0x0, 0x0d060000, 0, 0x00000000 },
  616. { 0x2, 0x08, 0x2, 0x0, 0x0d080000, 1, 0x00020000 },
  617. { 0x2, 0x08, 0x3, 0x0, 0x0d0a0000, 2, 0x00040000 },
  618. { 0x2, 0x08, 0x4, 0x0, 0x0d0c0000, 3, 0x00060000 },
  619. { 0x2, 0x09, 0x0, 0x0, 0x0d650000, 0, 0x00000000 },
  620. { 0x2, 0x0a, 0x0, 0x0, 0x20af0000, 0, 0x00000000 },
  621. { 0x2, 0x0b, 0x0, 0x0, 0x0d3e0000, 0, 0x00000000 },
  622. { 0x2, 0x0c, 0x0, 0x0, 0x0d3d0000, 0, 0x00000000 },
  623. { 0x2, 0x0d, 0x0, 0x0, 0x0d1e0000, 0, 0x00000000 },
  624. { 0x2, 0x0e, 0x0, 0x0, 0x0d150000, 0, 0x00000000 },
  625. { 0x2, 0x0e, 0x1, 0x0, 0x0d160000, 1, 0x00010000 },
  626. { 0x2, 0x0e, 0x2, 0x0, 0x0d170000, 2, 0x00020000 },
  627. { 0x2, 0x0e, 0x3, 0x0, 0x0d180000, 3, 0x00030000 },
  628. { 0x2, 0x0e, 0x4, 0x0, 0x0d190000, 4, 0x00040000 },
  629. { 0x2, 0x0e, 0x5, 0x0, 0x0d1a0000, 5, 0x00050000 },
  630. { 0x2, 0x0e, 0x6, 0x0, 0x0d1b0000, 6, 0x00060000 },
  631. { 0x2, 0x0e, 0x7, 0x0, 0x0d1c0000, 7, 0x00070000 },
  632. { 0x2, 0x0e, 0x8, 0x0, 0x0d1d0000, 8, 0x00080000 },
  633. { 0x2, 0x0f, 0x0, 0x0, 0x0d660000, 0, 0x00000000 },
  634. { 0x2, 0x10, 0x0, 0x0, 0x0d1f0000, 0, 0x00000000 },
  635. { 0x2, 0x10, 0x1, 0x0, 0x0d200000, 1, 0x00010000 },
  636. { 0x2, 0x10, 0x2, 0x0, 0x0d210000, 2, 0x00020000 },
  637. { 0x2, 0x10, 0x3, 0x0, 0x0d220000, 3, 0x00030000 },
  638. { 0x2, 0x11, 0x0, 0x0, 0x0d240000, 0, 0x00000000 },
  639. { 0x2, 0x12, 0x0, 0x0, 0x0d250000, 0, 0x00000000 },
  640. { 0x2, 0x13, 0x0, 0x0, 0x0d260000, 0, 0x00000000 },
  641. { 0x2, 0x14, 0x0, 0x0, 0x0d270000, 0, 0x00000000 },
  642. { 0x2, 0x15, 0x0, 0x0, 0x0d2b0000, 0, 0x00000000 },
  643. { 0x2, 0x16, 0x0, 0x0, 0x0d280000, 0, 0x00000000 },
  644. { 0x2, 0x17, 0x0, 0x0, 0x0d0f0000, 0, 0x00000000 },
  645. { 0x2, 0x17, 0x1, 0x0, 0x0d100000, 1, 0x00010000 },
  646. { 0x2, 0x17, 0x2, 0x0, 0x0d110000, 2, 0x00020000 },
  647. { 0x2, 0x17, 0x3, 0x0, 0x0d120000, 3, 0x00030000 },
  648. { 0x2, 0x17, 0x4, 0x0, 0x0d130000, 4, 0x00040000 },
  649. { 0x2, 0x17, 0x5, 0x0, 0x0d140000, 5, 0x00050000 },
  650. { 0x2, 0x18, 0x0, 0x0, 0x0d020000, 0, 0x00000000 },
  651. { 0x2, 0x19, 0x0, 0x0, 0x0d030000, 0, 0x00000000 },
  652. { 0x2, 0x1f, 0x0, 0x0, 0x0d600000, 0, 0x00000000 },
  653. { 0x2, 0x1f, 0x1, 0x0, 0x00000000, 0, 0x00000000 },
  654. { 0x3, 0x1b, 0x0, 0x0, 0x40000000, 0, 0x40000000 },
  655. { 0x3, 0x1b, 0x1, 0x1, 0x80000000, 1, 0x80000000 },
  656. { 0x3, 0x1c, 0x0, 0x2, 0x0d640000, 0, 0x00000000 },
  657. { 0x3, 0x1d, 0x0, 0x2, 0x20b00000, 8, 0x20b00000 },
  658. { 0x3, 0x1d, 0x1, 0x2, 0x20800000, 7, 0x20800000 },
  659. { 0x3, 0x1d, 0x2, 0x2, 0x20c00000, 9, 0x20c00000 },
  660. { 0x3, 0x1d, 0x3, 0x2, 0x0d800000, 3, 0x0d800000 },
  661. { 0x3, 0x1d, 0x4, 0x2, 0x20000000, 6, 0x20000000 },
  662. { 0x3, 0x1d, 0x5, 0x2, 0x0c000000, 2, 0x0c000000 },
  663. { 0x3, 0x1d, 0x6, 0x2, 0x21000000, 10, 0x21000000 },
  664. { 0x3, 0x1d, 0x7, 0x2, 0x0e000000, 4, 0x0e000000 },
  665. { 0x3, 0x1d, 0x8, 0x2, 0x22000000, 11, 0x22000000 },
  666. { 0x3, 0x1d, 0x9, 0x2, 0x08000000, 1, 0x08000000 },
  667. { 0x3, 0x1d, 0xa, 0x2, 0x24000000, 12, 0x24000000 },
  668. { 0x3, 0x1d, 0xb, 0x2, 0x00000000, 0, 0x00000000 },
  669. { 0x3, 0x1d, 0xc, 0x2, 0x28000000, 13, 0x28000000 },
  670. { 0x3, 0x1d, 0xd, 0x2, 0x10000000, 5, 0x10000000 },
  671. { 0x3, 0x1d, 0xe, 0x2, 0x30000000, 14, 0x30000000 },
  672. { 0x3, 0x1e, 0x0, 0x2, 0x0d400000, 0, 0x0d400000 },
  673. { 0x3, 0x00, 0x0, 0x2, 0x0d230000, 0, 0x00000000 },
  674. { 0x3, 0x01, 0x0, 0x2, 0x0d040000, 0, 0x00000000 },
  675. { 0x3, 0x02, 0x0, 0x2, 0x0d050000, 0, 0x00000000 },
  676. { 0x3, 0x03, 0x0, 0x2, 0x0d000000, 0, 0x00000000 },
  677. { 0x3, 0x04, 0x0, 0x2, 0x20ae0000, 3, 0x000e0000 },
  678. { 0x3, 0x04, 0x1, 0x2, 0x20ac0000, 2, 0x000c0000 },
  679. { 0x3, 0x04, 0x2, 0x2, 0x20a80000, 1, 0x00080000 },
  680. { 0x3, 0x04, 0x3, 0x2, 0x20a00000, 0, 0x00000000 },
  681. { 0x3, 0x05, 0x0, 0x2, 0x0d2a0000, 0, 0x00000000 },
  682. { 0x3, 0x06, 0x0, 0x2, 0x0d290000, 0, 0x00000000 },
  683. { 0x3, 0x07, 0x0, 0x2, 0x0d2c0000, 0, 0x00000000 },
  684. { 0x3, 0x08, 0x0, 0x2, 0x0d0e0000, 4, 0x00080000 },
  685. { 0x3, 0x08, 0x1, 0x2, 0x0d060000, 0, 0x00000000 },
  686. { 0x3, 0x08, 0x2, 0x2, 0x0d080000, 1, 0x00020000 },
  687. { 0x3, 0x08, 0x3, 0x2, 0x0d0a0000, 2, 0x00040000 },
  688. { 0x3, 0x08, 0x4, 0x2, 0x0d0c0000, 3, 0x00060000 },
  689. { 0x3, 0x09, 0x0, 0x2, 0x0d650000, 0, 0x00000000 },
  690. { 0x3, 0x0a, 0x0, 0x2, 0x20af0000, 0, 0x00000000 },
  691. { 0x3, 0x0b, 0x0, 0x2, 0x0d3e0000, 0, 0x00000000 },
  692. { 0x3, 0x0c, 0x0, 0x2, 0x0d3d0000, 0, 0x00000000 },
  693. { 0x3, 0x0d, 0x0, 0x2, 0x0d1e0000, 0, 0x00000000 },
  694. { 0x3, 0x0e, 0x0, 0x2, 0x0d150000, 0, 0x00000000 },
  695. { 0x3, 0x0e, 0x1, 0x2, 0x0d160000, 1, 0x00010000 },
  696. { 0x3, 0x0e, 0x2, 0x2, 0x0d170000, 2, 0x00020000 },
  697. { 0x3, 0x0e, 0x3, 0x2, 0x0d180000, 3, 0x00030000 },
  698. { 0x3, 0x0e, 0x4, 0x2, 0x0d190000, 4, 0x00040000 },
  699. { 0x3, 0x0e, 0x5, 0x2, 0x0d1a0000, 5, 0x00050000 },
  700. { 0x3, 0x0e, 0x6, 0x2, 0x0d1b0000, 6, 0x00060000 },
  701. { 0x3, 0x0e, 0x7, 0x2, 0x0d1c0000, 7, 0x00070000 },
  702. { 0x3, 0x0e, 0x8, 0x2, 0x0d1d0000, 8, 0x00080000 },
  703. { 0x3, 0x0f, 0x0, 0x2, 0x0d660000, 0, 0x00000000 },
  704. { 0x3, 0x10, 0x0, 0x2, 0x0d1f0000, 0, 0x00000000 },
  705. { 0x3, 0x10, 0x1, 0x2, 0x0d200000, 1, 0x00010000 },
  706. { 0x3, 0x10, 0x2, 0x2, 0x0d210000, 2, 0x00020000 },
  707. { 0x3, 0x10, 0x3, 0x2, 0x0d220000, 3, 0x00030000 },
  708. { 0x3, 0x11, 0x0, 0x2, 0x0d240000, 0, 0x00000000 },
  709. { 0x3, 0x12, 0x0, 0x2, 0x0d250000, 0, 0x00000000 },
  710. { 0x3, 0x13, 0x0, 0x2, 0x0d260000, 0, 0x00000000 },
  711. { 0x3, 0x14, 0x0, 0x2, 0x0d270000, 0, 0x00000000 },
  712. { 0x3, 0x15, 0x0, 0x2, 0x0d2b0000, 0, 0x00000000 },
  713. { 0x3, 0x16, 0x0, 0x2, 0x0d280000, 0, 0x00000000 },
  714. { 0x3, 0x17, 0x0, 0x2, 0x0d0f0000, 0, 0x00000000 },
  715. { 0x3, 0x17, 0x1, 0x2, 0x0d100000, 1, 0x00010000 },
  716. { 0x3, 0x17, 0x2, 0x2, 0x0d110000, 2, 0x00020000 },
  717. { 0x3, 0x17, 0x3, 0x2, 0x0d120000, 3, 0x00030000 },
  718. { 0x3, 0x17, 0x4, 0x2, 0x0d130000, 4, 0x00040000 },
  719. { 0x3, 0x17, 0x5, 0x2, 0x0d140000, 5, 0x00050000 },
  720. { 0x3, 0x18, 0x0, 0x2, 0x0d020000, 0, 0x00000000 },
  721. { 0x3, 0x19, 0x0, 0x2, 0x0d030000, 0, 0x00000000 },
  722. { 0x3, 0x1f, 0x0, 0x2, 0x0d600000, 0, 0x00000000 },
  723. { 0x3, 0x1f, 0x1, 0x0, 0x00000000, 0, 0x00000000 },
  724. { 0x4, 0x1b, 0x0, 0x0, 0x40000000, 0, 0x40000000 },
  725. { 0x4, 0x1b, 0x1, 0x1, 0x80000000, 1, 0x80000000 },
  726. { 0x4, 0x1e, 0x0, 0x2, 0x0d400000, 0, 0x0d400000 },
  727. { 0x4, 0x1e, 0x1, 0x0, 0x00000000, 0, 0x00000000 },
  728. { 0x5, 0x1c, 0x0, 0x0, 0x0d640000, 0, 0x00000000 },
  729. { 0x5, 0x1d, 0x0, 0x0, 0x20b00000, 8, 0x20b00000 },
  730. { 0x5, 0x1d, 0x1, 0x0, 0x20800000, 7, 0x20800000 },
  731. { 0x5, 0x1d, 0x2, 0x0, 0x20c00000, 9, 0x20c00000 },
  732. { 0x5, 0x1d, 0x3, 0x0, 0x0d800000, 3, 0x0d800000 },
  733. { 0x5, 0x1d, 0x4, 0x0, 0x20000000, 6, 0x20000000 },
  734. { 0x5, 0x1d, 0x5, 0x0, 0x0c000000, 2, 0x0c000000 },
  735. { 0x5, 0x1d, 0x6, 0x0, 0x21000000, 10, 0x21000000 },
  736. { 0x5, 0x1d, 0x7, 0x0, 0x0e000000, 4, 0x0e000000 },
  737. { 0x5, 0x1d, 0x8, 0x0, 0x22000000, 11, 0x22000000 },
  738. { 0x5, 0x1d, 0x9, 0x0, 0x08000000, 1, 0x08000000 },
  739. { 0x5, 0x1d, 0xa, 0x0, 0x24000000, 12, 0x24000000 },
  740. { 0x5, 0x1d, 0xb, 0x0, 0x00000000, 0, 0x00000000 },
  741. { 0x5, 0x1d, 0xc, 0x0, 0x28000000, 13, 0x28000000 },
  742. { 0x5, 0x1d, 0xd, 0x0, 0x10000000, 5, 0x10000000 },
  743. { 0x5, 0x1d, 0xe, 0x0, 0x30000000, 14, 0x30000000 },
  744. { 0x5, 0x00, 0x0, 0x0, 0x0d230000, 0, 0x00000000 },
  745. { 0x5, 0x01, 0x0, 0x0, 0x0d040000, 0, 0x00000000 },
  746. { 0x5, 0x02, 0x0, 0x0, 0x0d050000, 0, 0x00000000 },
  747. { 0x5, 0x03, 0x0, 0x0, 0x0d000000, 0, 0x00000000 },
  748. { 0x5, 0x04, 0x0, 0x0, 0x20ae0000, 3, 0x000e0000 },
  749. { 0x5, 0x04, 0x1, 0x0, 0x20ac0000, 2, 0x000c0000 },
  750. { 0x5, 0x04, 0x2, 0x0, 0x20a80000, 1, 0x00080000 },
  751. { 0x5, 0x04, 0x3, 0x0, 0x20a00000, 0, 0x00000000 },
  752. { 0x5, 0x05, 0x0, 0x0, 0x0d2a0000, 0, 0x00000000 },
  753. { 0x5, 0x06, 0x0, 0x0, 0x0d290000, 0, 0x00000000 },
  754. { 0x5, 0x07, 0x0, 0x0, 0x0d2c0000, 0, 0x00000000 },
  755. { 0x5, 0x08, 0x0, 0x0, 0x0d0e0000, 4, 0x00080000 },
  756. { 0x5, 0x08, 0x1, 0x0, 0x0d060000, 0, 0x00000000 },
  757. { 0x5, 0x08, 0x2, 0x0, 0x0d080000, 1, 0x00020000 },
  758. { 0x5, 0x08, 0x3, 0x0, 0x0d0a0000, 2, 0x00040000 },
  759. { 0x5, 0x08, 0x4, 0x0, 0x0d0c0000, 3, 0x00060000 },
  760. { 0x5, 0x09, 0x0, 0x0, 0x0d650000, 0, 0x00000000 },
  761. { 0x5, 0x0a, 0x0, 0x0, 0x20af0000, 0, 0x00000000 },
  762. { 0x5, 0x0b, 0x0, 0x0, 0x0d3e0000, 0, 0x00000000 },
  763. { 0x5, 0x0c, 0x0, 0x0, 0x0d3d0000, 0, 0x00000000 },
  764. { 0x5, 0x0d, 0x0, 0x0, 0x0d1e0000, 0, 0x00000000 },
  765. { 0x5, 0x0e, 0x0, 0x0, 0x0d150000, 0, 0x00000000 },
  766. { 0x5, 0x0e, 0x1, 0x0, 0x0d160000, 1, 0x00010000 },
  767. { 0x5, 0x0e, 0x2, 0x0, 0x0d170000, 2, 0x00020000 },
  768. { 0x5, 0x0e, 0x3, 0x0, 0x0d180000, 3, 0x00030000 },
  769. { 0x5, 0x0e, 0x4, 0x0, 0x0d190000, 4, 0x00040000 },
  770. { 0x5, 0x0e, 0x5, 0x0, 0x0d1a0000, 5, 0x00050000 },
  771. { 0x5, 0x0e, 0x6, 0x0, 0x0d1b0000, 6, 0x00060000 },
  772. { 0x5, 0x0e, 0x7, 0x0, 0x0d1c0000, 7, 0x00070000 },
  773. { 0x5, 0x0e, 0x8, 0x0, 0x0d1d0000, 8, 0x00080000 },
  774. { 0x5, 0x0f, 0x0, 0x0, 0x0d660000, 0, 0x00000000 },
  775. { 0x5, 0x10, 0x0, 0x0, 0x0d1f0000, 0, 0x00000000 },
  776. { 0x5, 0x10, 0x1, 0x0, 0x0d200000, 1, 0x00010000 },
  777. { 0x5, 0x10, 0x2, 0x0, 0x0d210000, 2, 0x00020000 },
  778. { 0x5, 0x10, 0x3, 0x0, 0x0d220000, 3, 0x00030000 },
  779. { 0x5, 0x11, 0x0, 0x0, 0x0d240000, 0, 0x00000000 },
  780. { 0x5, 0x12, 0x0, 0x0, 0x0d250000, 0, 0x00000000 },
  781. { 0x5, 0x13, 0x0, 0x0, 0x0d260000, 0, 0x00000000 },
  782. { 0x5, 0x14, 0x0, 0x0, 0x0d270000, 0, 0x00000000 },
  783. { 0x5, 0x15, 0x0, 0x0, 0x0d2b0000, 0, 0x00000000 },
  784. { 0x5, 0x16, 0x0, 0x0, 0x0d280000, 0, 0x00000000 },
  785. { 0x5, 0x17, 0x0, 0x0, 0x0d0f0000, 0, 0x00000000 },
  786. { 0x5, 0x17, 0x1, 0x0, 0x0d100000, 1, 0x00010000 },
  787. { 0x5, 0x17, 0x2, 0x0, 0x0d110000, 2, 0x00020000 },
  788. { 0x5, 0x17, 0x3, 0x0, 0x0d120000, 3, 0x00030000 },
  789. { 0x5, 0x17, 0x4, 0x0, 0x0d130000, 4, 0x00040000 },
  790. { 0x5, 0x17, 0x5, 0x0, 0x0d140000, 5, 0x00050000 },
  791. { 0x5, 0x18, 0x0, 0x0, 0x0d020000, 0, 0x00000000 },
  792. { 0x5, 0x19, 0x0, 0x0, 0x0d030000, 0, 0x00000000 },
  793. { 0x5, 0x1f, 0x0, 0x0, 0x0d600000, 0, 0x00000000 },
  794. { 0x5, 0x1f, 0x1, 0x0, 0x00000000, 0, 0x00000000 }
  795. };
  796. /*
  797. * AON NOC aperture lookup table as per file "AON_NOC_Structure.info".
  798. */
  799. static const char * const tegra194_aonnoc_routeid_initflow[] = {
  800. [0x0] = "cbb_i/I/0",
  801. [0x1] = "cpu_p_i/I/0",
  802. [0x2] = "dma_m_i/I/0",
  803. [0x3] = "dma_p_i/I/0"
  804. };
  805. static const char * const tegra194_aonnoc_routeid_targflow[] = {
  806. [0x00] = "multiport1_t/T/aon_misc",
  807. [0x01] = "multiport1_t/T/avic0",
  808. [0x02] = "multiport1_t/T/avic1",
  809. [0x03] = "multiport1_t/T/can1",
  810. [0x04] = "multiport1_t/T/can2",
  811. [0x05] = "multiport1_t/T/dma",
  812. [0x06] = "multiport1_t/T/dmic",
  813. [0x07] = "multiport1_t/T/err_collator",
  814. [0x08] = "multiport1_t/T/fpga_misc",
  815. [0x09] = "multiport1_t/T/gte",
  816. [0x0a] = "multiport1_t/T/hsp",
  817. [0x0b] = "multiport1_t/T/i2c2",
  818. [0x0c] = "multiport1_t/T/i2c8",
  819. [0x0d] = "multiport1_t/T/pwm",
  820. [0x0e] = "multiport1_t/T/spi2",
  821. [0x0f] = "multiport1_t/T/tke",
  822. [0x10] = "multiport1_t/T/uartg",
  823. [0x11] = "RESERVED",
  824. [0x12] = "RESERVED",
  825. [0x13] = "RESERVED",
  826. [0x14] = "RESERVED",
  827. [0x15] = "RESERVED",
  828. [0x16] = "RESERVED",
  829. [0x17] = "RESERVED",
  830. [0x18] = "RESERVED",
  831. [0x19] = "RESERVED",
  832. [0x1a] = "RESERVED",
  833. [0x1b] = "RESERVED",
  834. [0x1c] = "RESERVED",
  835. [0x1d] = "RESERVED",
  836. [0x1e] = "RESERVED",
  837. [0x1f] = "RESERVED",
  838. [0x20] = "multiport0_t/T/aovc",
  839. [0x21] = "multiport0_t/T/atcm",
  840. [0x22] = "multiport0_t/T/cast",
  841. [0x23] = "multiport0_t/T/dast",
  842. [0x24] = "multiport0_t/T/err_collator_car",
  843. [0x25] = "multiport0_t/T/gpio",
  844. [0x26] = "multiport0_t/T/i2c10",
  845. [0x27] = "multiport0_t/T/mss",
  846. [0x28] = "multiport0_t/T/padctl_a12",
  847. [0x29] = "multiport0_t/T/padctl_a14",
  848. [0x2a] = "multiport0_t/T/padctl_a15",
  849. [0x2b] = "multiport0_t/T/rtc",
  850. [0x2c] = "multiport0_t/T/tsc",
  851. [0x2d] = "RESERVED",
  852. [0x2e] = "RESERVED",
  853. [0x2f] = "RESERVED",
  854. [0x30] = "multiport2_t/T/aon_vref_ro",
  855. [0x31] = "multiport2_t/T/aopm",
  856. [0x32] = "multiport2_t/T/car",
  857. [0x33] = "multiport2_t/T/pmc",
  858. [0x34] = "ast1_t/T/0",
  859. [0x35] = "cbb_t/T/0",
  860. [0x36] = "cpu_t/T/0",
  861. [0x37] = "firewall_t/T/0",
  862. [0x38] = "svc_t/T/0",
  863. [0x39] = "uartc/T/uartc",
  864. [0x3a] = "RESERVED",
  865. [0x3b] = "RESERVED",
  866. [0x3c] = "RESERVED",
  867. [0x3d] = "RESERVED",
  868. [0x3e] = "RESERVED",
  869. [0x3f] = "RESERVED"
  870. };
  871. /*
  872. * Fields of AON NOC lookup table:
  873. * Init flow, Targ flow, Targ subrange, Init mapping, Init localAddress,
  874. * Targ mapping, Targ localAddress
  875. * ----------------------------------------------------------------------------
  876. */
  877. static const struct tegra194_cbb_aperture tegra194_aonnoc_aperture_lookup[] = {
  878. { 0x0, 0x37, 0x00, 0, 0x0c640000, 0, 0x00000000 },
  879. { 0x0, 0x20, 0x00, 0, 0x0c3b0000, 0, 0x00000000 },
  880. { 0x0, 0x21, 0x00, 0, 0x0c000000, 0, 0x00000000 },
  881. { 0x0, 0x22, 0x00, 0, 0x0c040000, 0, 0x00000000 },
  882. { 0x0, 0x23, 0x00, 0, 0x0c050000, 0, 0x00000000 },
  883. { 0x0, 0x24, 0x00, 0, 0x20cf0000, 0, 0x00000000 },
  884. { 0x0, 0x25, 0x00, 0, 0x0c2f0000, 0, 0x00000000 },
  885. { 0x0, 0x26, 0x00, 0, 0x0c230000, 0, 0x00000000 },
  886. { 0x0, 0x27, 0x00, 0, 0x0c350000, 0, 0x00000000 },
  887. { 0x0, 0x28, 0x00, 0, 0x0c301000, 0, 0x00000000 },
  888. { 0x0, 0x29, 0x00, 0, 0x0c302000, 0, 0x00000000 },
  889. { 0x0, 0x2a, 0x00, 0, 0x0c303000, 0, 0x00000000 },
  890. { 0x0, 0x2b, 0x00, 0, 0x0c2a0000, 0, 0x00000000 },
  891. { 0x0, 0x2c, 0x00, 0, 0x0c2b0000, 0, 0x00000000 },
  892. { 0x0, 0x2c, 0x01, 0, 0x0c2c0000, 1, 0x00010000 },
  893. { 0x0, 0x2c, 0x02, 0, 0x0c2d0000, 2, 0x00020000 },
  894. { 0x0, 0x2c, 0x03, 0, 0x0c2e0000, 3, 0x00030000 },
  895. { 0x0, 0x00, 0x00, 0, 0x0c660000, 0, 0x00000000 },
  896. { 0x0, 0x01, 0x00, 0, 0x0c020000, 0, 0x00000000 },
  897. { 0x0, 0x02, 0x00, 0, 0x0c030000, 0, 0x00000000 },
  898. { 0x0, 0x03, 0x00, 0, 0x0c310000, 0, 0x00000000 },
  899. { 0x0, 0x04, 0x00, 0, 0x0c320000, 0, 0x00000000 },
  900. { 0x0, 0x05, 0x00, 0, 0x0c0a0000, 2, 0x00040000 },
  901. { 0x0, 0x05, 0x01, 0, 0x0c0b0000, 3, 0x00050000 },
  902. { 0x0, 0x05, 0x02, 0, 0x0c0e0000, 5, 0x00080000 },
  903. { 0x0, 0x05, 0x03, 0, 0x0c060000, 0, 0x00000000 },
  904. { 0x0, 0x05, 0x04, 0, 0x0c080000, 1, 0x00020000 },
  905. { 0x0, 0x05, 0x05, 0, 0x0c0c0000, 4, 0x00060000 },
  906. { 0x0, 0x06, 0x00, 0, 0x0c330000, 0, 0x00000000 },
  907. { 0x0, 0x07, 0x00, 0, 0x0c650000, 0, 0x00000000 },
  908. { 0x0, 0x08, 0x00, 0, 0x0c3e0000, 0, 0x00000000 },
  909. { 0x0, 0x09, 0x00, 0, 0x0c1e0000, 0, 0x00000000 },
  910. { 0x0, 0x0a, 0x00, 0, 0x0c150000, 0, 0x00000000 },
  911. { 0x0, 0x0a, 0x01, 0, 0x0c160000, 1, 0x00010000 },
  912. { 0x0, 0x0a, 0x02, 0, 0x0c170000, 2, 0x00020000 },
  913. { 0x0, 0x0a, 0x03, 0, 0x0c180000, 3, 0x00030000 },
  914. { 0x0, 0x0a, 0x04, 0, 0x0c190000, 4, 0x00040000 },
  915. { 0x0, 0x0a, 0x05, 0, 0x0c1a0000, 5, 0x00050000 },
  916. { 0x0, 0x0a, 0x06, 0, 0x0c1b0000, 6, 0x00060000 },
  917. { 0x0, 0x0a, 0x07, 0, 0x0c1c0000, 7, 0x00070000 },
  918. { 0x0, 0x0a, 0x08, 0, 0x0c1d0000, 8, 0x00080000 },
  919. { 0x0, 0x0b, 0x00, 0, 0x0c240000, 0, 0x00000000 },
  920. { 0x0, 0x0c, 0x00, 0, 0x0c250000, 0, 0x00000000 },
  921. { 0x0, 0x0d, 0x00, 0, 0x0c340000, 0, 0x00000000 },
  922. { 0x0, 0x0e, 0x00, 0, 0x0c260000, 0, 0x00000000 },
  923. { 0x0, 0x0f, 0x00, 0, 0x0c0f0000, 0, 0x00000000 },
  924. { 0x0, 0x0f, 0x01, 0, 0x0c100000, 1, 0x00010000 },
  925. { 0x0, 0x0f, 0x02, 0, 0x0c110000, 2, 0x00020000 },
  926. { 0x0, 0x0f, 0x03, 0, 0x0c120000, 3, 0x00030000 },
  927. { 0x0, 0x0f, 0x04, 0, 0x0c130000, 4, 0x00040000 },
  928. { 0x0, 0x0f, 0x05, 0, 0x0c140000, 5, 0x00050000 },
  929. { 0x0, 0x10, 0x00, 0, 0x0c290000, 0, 0x00000000 },
  930. { 0x0, 0x30, 0x00, 0, 0x20ce0000, 0, 0x00000000 },
  931. { 0x0, 0x31, 0x00, 0, 0x0c1f0000, 0, 0x00000000 },
  932. { 0x0, 0x31, 0x01, 0, 0x0c200000, 1, 0x00010000 },
  933. { 0x0, 0x31, 0x02, 0, 0x0c210000, 2, 0x00020000 },
  934. { 0x0, 0x31, 0x03, 0, 0x0c220000, 3, 0x00030000 },
  935. { 0x0, 0x32, 0x00, 0, 0x20cc0000, 3, 0x001c0000 },
  936. { 0x0, 0x32, 0x01, 0, 0x20c80000, 2, 0x00180000 },
  937. { 0x0, 0x32, 0x02, 0, 0x20c00000, 1, 0x00100000 },
  938. { 0x0, 0x32, 0x03, 0, 0x20b00000, 0, 0x00000000 },
  939. { 0x0, 0x33, 0x00, 0, 0x0c360000, 0, 0x00000000 },
  940. { 0x0, 0x33, 0x01, 0, 0x0c370000, 1, 0x00010000 },
  941. { 0x0, 0x33, 0x02, 0, 0x0c3a0000, 3, 0x00040000 },
  942. { 0x0, 0x33, 0x03, 0, 0x0c380000, 2, 0x00020000 },
  943. { 0x0, 0x38, 0x00, 0, 0x0c600000, 0, 0x00000000 },
  944. { 0x0, 0x38, 0x01, 0, 0x00000000, 0, 0x00000000 },
  945. { 0x0, 0x39, 0x00, 0, 0x0c280000, 0, 0x00000000 },
  946. { 0x1, 0x35, 0x00, 0, 0x00000000, 0, 0x00000000 },
  947. { 0x1, 0x35, 0x01, 0, 0x00100000, 1, 0x00100000 },
  948. { 0x1, 0x35, 0x02, 0, 0x05a00000, 11, 0x05a00000 },
  949. { 0x1, 0x35, 0x03, 0, 0x05b00000, 32, 0x05b00000 },
  950. { 0x1, 0x35, 0x04, 0, 0x05c00000, 33, 0x05c00000 },
  951. { 0x1, 0x35, 0x05, 0, 0x05d00000, 12, 0x05d00000 },
  952. { 0x1, 0x35, 0x06, 0, 0x20000000, 19, 0x20000000 },
  953. { 0x1, 0x35, 0x07, 0, 0x20100000, 20, 0x20100000 },
  954. { 0x1, 0x35, 0x08, 0, 0x20a00000, 24, 0x20a00000 },
  955. { 0x1, 0x35, 0x09, 0, 0x20d00000, 25, 0x20d00000 },
  956. { 0x1, 0x35, 0x0a, 0, 0x00200000, 2, 0x00200000 },
  957. { 0x1, 0x35, 0x0b, 0, 0x05800000, 10, 0x05800000 },
  958. { 0x1, 0x35, 0x0c, 0, 0x05e00000, 13, 0x05e00000 },
  959. { 0x1, 0x35, 0x0d, 0, 0x20200000, 21, 0x20200000 },
  960. { 0x1, 0x35, 0x0e, 0, 0x20800000, 23, 0x20800000 },
  961. { 0x1, 0x35, 0x0f, 0, 0x20e00000, 26, 0x20e00000 },
  962. { 0x1, 0x35, 0x10, 0, 0x00400000, 3, 0x00400000 },
  963. { 0x1, 0x35, 0x11, 0, 0x20400000, 22, 0x20400000 },
  964. { 0x1, 0x35, 0x12, 0, 0x00800000, 4, 0x00800000 },
  965. { 0x1, 0x35, 0x13, 0, 0x05000000, 9, 0x05000000 },
  966. { 0x1, 0x35, 0x14, 0, 0x0c800000, 34, 0x0c800000 },
  967. { 0x1, 0x35, 0x15, 0, 0x01000000, 5, 0x01000000 },
  968. { 0x1, 0x35, 0x16, 0, 0x03000000, 7, 0x03000000 },
  969. { 0x1, 0x35, 0x17, 0, 0x04000000, 8, 0x04000000 },
  970. { 0x1, 0x35, 0x18, 0, 0x0d000000, 16, 0x0d000000 },
  971. { 0x1, 0x35, 0x19, 0, 0x21000000, 27, 0x21000000 },
  972. { 0x1, 0x35, 0x1a, 0, 0x02000000, 6, 0x02000000 },
  973. { 0x1, 0x35, 0x1b, 0, 0x06000000, 14, 0x06000000 },
  974. { 0x1, 0x35, 0x1c, 0, 0x0e000000, 17, 0x0e000000 },
  975. { 0x1, 0x35, 0x1d, 0, 0x22000000, 28, 0x22000000 },
  976. { 0x1, 0x35, 0x1e, 0, 0x08000000, 15, 0x08000000 },
  977. { 0x1, 0x35, 0x1f, 0, 0x24000000, 29, 0x24000000 },
  978. { 0x1, 0x35, 0x20, 0, 0x28000000, 30, 0x28000000 },
  979. { 0x1, 0x35, 0x21, 0, 0x10000000, 18, 0x10000000 },
  980. { 0x1, 0x35, 0x22, 0, 0x30000000, 31, 0x30000000 },
  981. { 0x1, 0x37, 0x00, 0, 0x0c640000, 0, 0x00000000 },
  982. { 0x1, 0x20, 0x00, 0, 0x0c3b0000, 0, 0x00000000 },
  983. { 0x1, 0x21, 0x00, 0, 0x0c000000, 0, 0x00000000 },
  984. { 0x1, 0x22, 0x00, 0, 0x0c040000, 0, 0x00000000 },
  985. { 0x1, 0x23, 0x00, 0, 0x0c050000, 0, 0x00000000 },
  986. { 0x1, 0x24, 0x00, 0, 0x20cf0000, 0, 0x00000000 },
  987. { 0x1, 0x25, 0x00, 0, 0x0c2f0000, 0, 0x00000000 },
  988. { 0x1, 0x26, 0x00, 0, 0x0c230000, 0, 0x00000000 },
  989. { 0x1, 0x27, 0x00, 0, 0x0c350000, 0, 0x00000000 },
  990. { 0x1, 0x28, 0x00, 0, 0x0c301000, 0, 0x00000000 },
  991. { 0x1, 0x29, 0x00, 0, 0x0c302000, 0, 0x00000000 },
  992. { 0x1, 0x2a, 0x00, 0, 0x0c303000, 0, 0x00000000 },
  993. { 0x1, 0x2b, 0x00, 0, 0x0c2a0000, 0, 0x00000000 },
  994. { 0x1, 0x2c, 0x00, 0, 0x0c2b0000, 0, 0x00000000 },
  995. { 0x1, 0x2c, 0x01, 0, 0x0c2c0000, 1, 0x00010000 },
  996. { 0x1, 0x2c, 0x02, 0, 0x0c2d0000, 2, 0x00020000 },
  997. { 0x1, 0x2c, 0x03, 0, 0x0c2e0000, 3, 0x00030000 },
  998. { 0x1, 0x00, 0x00, 0, 0x0c660000, 0, 0x00000000 },
  999. { 0x1, 0x01, 0x00, 0, 0x0c020000, 0, 0x00000000 },
  1000. { 0x1, 0x02, 0x00, 0, 0x0c030000, 0, 0x00000000 },
  1001. { 0x1, 0x03, 0x00, 0, 0x0c310000, 0, 0x00000000 },
  1002. { 0x1, 0x04, 0x00, 0, 0x0c320000, 0, 0x00000000 },
  1003. { 0x1, 0x05, 0x00, 0, 0x0c0a0000, 2, 0x00040000 },
  1004. { 0x1, 0x05, 0x01, 0, 0x0c0b0000, 3, 0x00050000 },
  1005. { 0x1, 0x05, 0x02, 0, 0x0c0e0000, 5, 0x00080000 },
  1006. { 0x1, 0x05, 0x03, 0, 0x0c060000, 0, 0x00000000 },
  1007. { 0x1, 0x05, 0x04, 0, 0x0c080000, 1, 0x00020000 },
  1008. { 0x1, 0x05, 0x05, 0, 0x0c0c0000, 4, 0x00060000 },
  1009. { 0x1, 0x06, 0x00, 0, 0x0c330000, 0, 0x00000000 },
  1010. { 0x1, 0x07, 0x00, 0, 0x0c650000, 0, 0x00000000 },
  1011. { 0x1, 0x08, 0x00, 0, 0x0c3e0000, 0, 0x00000000 },
  1012. { 0x1, 0x09, 0x00, 0, 0x0c1e0000, 0, 0x00000000 },
  1013. { 0x1, 0x0a, 0x00, 0, 0x0c150000, 0, 0x00000000 },
  1014. { 0x1, 0x0a, 0x01, 0, 0x0c160000, 1, 0x00010000 },
  1015. { 0x1, 0x0a, 0x02, 0, 0x0c170000, 2, 0x00020000 },
  1016. { 0x1, 0x0a, 0x03, 0, 0x0c180000, 3, 0x00030000 },
  1017. { 0x1, 0x0a, 0x04, 0, 0x0c190000, 4, 0x00040000 },
  1018. { 0x1, 0x0a, 0x05, 0, 0x0c1a0000, 5, 0x00050000 },
  1019. { 0x1, 0x0a, 0x06, 0, 0x0c1b0000, 6, 0x00060000 },
  1020. { 0x1, 0x0a, 0x07, 0, 0x0c1c0000, 7, 0x00070000 },
  1021. { 0x1, 0x0a, 0x08, 0, 0x0c1d0000, 8, 0x00080000 },
  1022. { 0x1, 0x0b, 0x00, 0, 0x0c240000, 0, 0x00000000 },
  1023. { 0x1, 0x0c, 0x00, 0, 0x0c250000, 0, 0x00000000 },
  1024. { 0x1, 0x0d, 0x00, 0, 0x0c340000, 0, 0x00000000 },
  1025. { 0x1, 0x0e, 0x00, 0, 0x0c260000, 0, 0x00000000 },
  1026. { 0x1, 0x0f, 0x00, 0, 0x0c0f0000, 0, 0x00000000 },
  1027. { 0x1, 0x0f, 0x01, 0, 0x0c100000, 1, 0x00010000 },
  1028. { 0x1, 0x0f, 0x02, 0, 0x0c110000, 2, 0x00020000 },
  1029. { 0x1, 0x0f, 0x03, 0, 0x0c120000, 3, 0x00030000 },
  1030. { 0x1, 0x0f, 0x04, 0, 0x0c130000, 4, 0x00040000 },
  1031. { 0x1, 0x0f, 0x05, 0, 0x0c140000, 5, 0x00050000 },
  1032. { 0x1, 0x10, 0x00, 0, 0x0c290000, 0, 0x00000000 },
  1033. { 0x1, 0x30, 0x00, 0, 0x20ce0000, 0, 0x00000000 },
  1034. { 0x1, 0x31, 0x00, 0, 0x0c1f0000, 0, 0x00000000 },
  1035. { 0x1, 0x31, 0x01, 0, 0x0c200000, 1, 0x00010000 },
  1036. { 0x1, 0x31, 0x02, 0, 0x0c210000, 2, 0x00020000 },
  1037. { 0x1, 0x31, 0x03, 0, 0x0c220000, 3, 0x00030000 },
  1038. { 0x1, 0x32, 0x00, 0, 0x20cc0000, 3, 0x001c0000 },
  1039. { 0x1, 0x32, 0x01, 0, 0x20c80000, 2, 0x00180000 },
  1040. { 0x1, 0x32, 0x02, 0, 0x20c00000, 1, 0x00100000 },
  1041. { 0x1, 0x32, 0x03, 0, 0x20b00000, 0, 0x00000000 },
  1042. { 0x1, 0x33, 0x00, 0, 0x0c360000, 0, 0x00000000 },
  1043. { 0x1, 0x33, 0x01, 0, 0x0c370000, 1, 0x00010000 },
  1044. { 0x1, 0x33, 0x02, 0, 0x0c3a0000, 3, 0x00040000 },
  1045. { 0x1, 0x33, 0x03, 0, 0x0c380000, 2, 0x00020000 },
  1046. { 0x1, 0x38, 0x00, 0, 0x0c600000, 0, 0x00000000 },
  1047. { 0x1, 0x38, 0x01, 0, 0x00000000, 0, 0x00000000 },
  1048. { 0x1, 0x39, 0x00, 0, 0x0c280000, 0, 0x00000000 },
  1049. { 0x2, 0x34, 0x00, 0, 0x40000000, 0, 0x40000000 },
  1050. { 0x2, 0x34, 0x01, 0, 0x80000000, 1, 0x80000000 },
  1051. { 0x2, 0x36, 0x00, 0, 0x0c400000, 0, 0x0c400000 },
  1052. { 0x2, 0x36, 0x01, 0, 0x00000000, 0, 0x00000000 },
  1053. { 0x3, 0x35, 0x00, 0, 0x00000000, 0, 0x00000000 },
  1054. { 0x3, 0x35, 0x01, 0, 0x00100000, 1, 0x00100000 },
  1055. { 0x3, 0x35, 0x02, 0, 0x05a00000, 11, 0x05a00000 },
  1056. { 0x3, 0x35, 0x03, 0, 0x05b00000, 32, 0x05b00000 },
  1057. { 0x3, 0x35, 0x04, 0, 0x05c00000, 33, 0x05c00000 },
  1058. { 0x3, 0x35, 0x05, 0, 0x05d00000, 12, 0x05d00000 },
  1059. { 0x3, 0x35, 0x06, 0, 0x20000000, 19, 0x20000000 },
  1060. { 0x3, 0x35, 0x07, 0, 0x20100000, 20, 0x20100000 },
  1061. { 0x3, 0x35, 0x08, 0, 0x20a00000, 24, 0x20a00000 },
  1062. { 0x3, 0x35, 0x09, 0, 0x20d00000, 25, 0x20d00000 },
  1063. { 0x3, 0x35, 0x0a, 0, 0x00200000, 2, 0x00200000 },
  1064. { 0x3, 0x35, 0x0b, 0, 0x05800000, 10, 0x05800000 },
  1065. { 0x3, 0x35, 0x0c, 0, 0x05e00000, 13, 0x05e00000 },
  1066. { 0x3, 0x35, 0x0d, 0, 0x20200000, 21, 0x20200000 },
  1067. { 0x3, 0x35, 0x0e, 0, 0x20800000, 23, 0x20800000 },
  1068. { 0x3, 0x35, 0x0f, 0, 0x20e00000, 26, 0x20e00000 },
  1069. { 0x3, 0x35, 0x10, 0, 0x00400000, 3, 0x00400000 },
  1070. { 0x3, 0x35, 0x11, 0, 0x20400000, 22, 0x20400000 },
  1071. { 0x3, 0x35, 0x12, 0, 0x00800000, 4, 0x00800000 },
  1072. { 0x3, 0x35, 0x13, 0, 0x50000000, 9, 0x05000000 },
  1073. { 0x3, 0x35, 0x14, 0, 0xc0800000, 34, 0x0c800000 },
  1074. { 0x3, 0x35, 0x15, 0, 0x10000000, 5, 0x01000000 },
  1075. { 0x3, 0x35, 0x16, 0, 0x30000000, 7, 0x03000000 },
  1076. { 0x3, 0x35, 0x17, 0, 0x04000000, 8, 0x04000000 },
  1077. { 0x3, 0x35, 0x18, 0, 0x0d000000, 16, 0x0d000000 },
  1078. { 0x3, 0x35, 0x19, 0, 0x21000000, 27, 0x21000000 },
  1079. { 0x3, 0x35, 0x1a, 0, 0x02000000, 6, 0x02000000 },
  1080. { 0x3, 0x35, 0x1b, 0, 0x06000000, 14, 0x06000000 },
  1081. { 0x3, 0x35, 0x1c, 0, 0x0e000000, 17, 0x0e000000 },
  1082. { 0x3, 0x35, 0x1d, 0, 0x22000000, 28, 0x22000000 },
  1083. { 0x3, 0x35, 0x1e, 0, 0x08000000, 15, 0x08000000 },
  1084. { 0x3, 0x35, 0x1f, 0, 0x24000000, 29, 0x24000000 },
  1085. { 0x3, 0x35, 0x20, 0, 0x28000000, 30, 0x28000000 },
  1086. { 0x3, 0x35, 0x21, 0, 0x10000000, 18, 0x10000000 },
  1087. { 0x3, 0x35, 0x22, 0, 0x30000000, 31, 0x30000000 },
  1088. { 0x3, 0x37, 0x00, 0, 0x0c640000, 0, 0x00000000 },
  1089. { 0x3, 0x20, 0x00, 0, 0x0c3b0000, 0, 0x00000000 },
  1090. { 0x3, 0x21, 0x00, 0, 0x0c000000, 0, 0x00000000 },
  1091. { 0x3, 0x22, 0x00, 0, 0x0c040000, 0, 0x00000000 },
  1092. { 0x3, 0x23, 0x00, 0, 0x0c050000, 0, 0x00000000 },
  1093. { 0x3, 0x24, 0x00, 0, 0x20cf0000, 0, 0x00000000 },
  1094. { 0x3, 0x25, 0x00, 0, 0x0c2f0000, 0, 0x00000000 },
  1095. { 0x3, 0x26, 0x00, 0, 0x0c230000, 0, 0x00000000 },
  1096. { 0x3, 0x27, 0x00, 0, 0x0c350000, 0, 0x00000000 },
  1097. { 0x3, 0x28, 0x00, 0, 0x0c301000, 0, 0x00000000 },
  1098. { 0x3, 0x29, 0x00, 0, 0x0c302000, 0, 0x00000000 },
  1099. { 0x3, 0x2a, 0x00, 0, 0x0c303000, 0, 0x00000000 },
  1100. { 0x3, 0x2b, 0x00, 0, 0x0c2a0000, 0, 0x00000000 },
  1101. { 0x3, 0x2c, 0x00, 0, 0x0c2b0000, 0, 0x00000000 },
  1102. { 0x3, 0x2c, 0x01, 0, 0x0c2c0000, 1, 0x00010000 },
  1103. { 0x3, 0x2c, 0x02, 0, 0x0c2d0000, 2, 0x00020000 },
  1104. { 0x3, 0x2c, 0x03, 0, 0x0c2e0000, 3, 0x00030000 },
  1105. { 0x3, 0x00, 0x00, 0, 0x0c660000, 0, 0x00000000 },
  1106. { 0x3, 0x01, 0x00, 0, 0x0c020000, 0, 0x00000000 },
  1107. { 0x3, 0x02, 0x00, 0, 0x0c030000, 0, 0x00000000 },
  1108. { 0x3, 0x03, 0x00, 0, 0x0c310000, 0, 0x00000000 },
  1109. { 0x3, 0x04, 0x00, 0, 0x0c320000, 0, 0x00000000 },
  1110. { 0x3, 0x05, 0x00, 0, 0x0c0a0000, 2, 0x00040000 },
  1111. { 0x3, 0x05, 0x01, 0, 0x0c0b0000, 3, 0x00050000 },
  1112. { 0x3, 0x05, 0x02, 0, 0x0c0e0000, 5, 0x00080000 },
  1113. { 0x3, 0x05, 0x03, 0, 0x0c060000, 0, 0x00000000 },
  1114. { 0x3, 0x05, 0x04, 0, 0x0c080000, 1, 0x00020000 },
  1115. { 0x3, 0x05, 0x05, 0, 0x0c0c0000, 4, 0x00060000 },
  1116. { 0x3, 0x06, 0x00, 0, 0x0c330000, 0, 0x00000000 },
  1117. { 0x3, 0x07, 0x00, 0, 0x0c650000, 0, 0x00000000 },
  1118. { 0x3, 0x08, 0x00, 0, 0x0c3e0000, 0, 0x00000000 },
  1119. { 0x3, 0x09, 0x00, 0, 0x0c1e0000, 0, 0x00000000 },
  1120. { 0x3, 0x0a, 0x00, 0, 0x0c150000, 0, 0x00000000 },
  1121. { 0x3, 0x0a, 0x01, 0, 0x0c160000, 1, 0x00010000 },
  1122. { 0x3, 0x0a, 0x02, 0, 0x0c170000, 2, 0x00020000 },
  1123. { 0x3, 0x0a, 0x03, 0, 0x0c180000, 3, 0x00030000 },
  1124. { 0x3, 0x0a, 0x04, 0, 0x0c190000, 4, 0x00040000 },
  1125. { 0x3, 0x0a, 0x05, 0, 0x0c1a0000, 5, 0x00050000 },
  1126. { 0x3, 0x0a, 0x06, 0, 0x0c1b0000, 6, 0x00060000 },
  1127. { 0x3, 0x0a, 0x07, 0, 0x0c1c0000, 7, 0x00070000 },
  1128. { 0x3, 0x0a, 0x08, 0, 0x0c1d0000, 8, 0x00080000 },
  1129. { 0x3, 0x0b, 0x00, 0, 0x0c240000, 0, 0x00000000 },
  1130. { 0x3, 0x0c, 0x00, 0, 0x0c250000, 0, 0x00000000 },
  1131. { 0x3, 0x0d, 0x00, 0, 0x0c340000, 0, 0x00000000 },
  1132. { 0x3, 0x0e, 0x00, 0, 0x0c260000, 0, 0x00000000 },
  1133. { 0x3, 0x0f, 0x00, 0, 0x0c0f0000, 0, 0x00000000 },
  1134. { 0x3, 0x0f, 0x01, 0, 0x0c100000, 1, 0x00010000 },
  1135. { 0x3, 0x0f, 0x02, 0, 0x0c110000, 2, 0x00020000 },
  1136. { 0x3, 0x0f, 0x03, 0, 0x0c120000, 3, 0x00030000 },
  1137. { 0x3, 0x0f, 0x04, 0, 0x0c130000, 4, 0x00040000 },
  1138. { 0x3, 0x0f, 0x05, 0, 0x0c140000, 5, 0x00050000 },
  1139. { 0x3, 0x10, 0x00, 0, 0x0c290000, 0, 0x00000000 },
  1140. { 0x3, 0x30, 0x00, 0, 0x20ce0000, 0, 0x00000000 },
  1141. { 0x3, 0x31, 0x00, 0, 0x0c1f0000, 0, 0x00000000 },
  1142. { 0x3, 0x31, 0x01, 0, 0x0c200000, 1, 0x00010000 },
  1143. { 0x3, 0x31, 0x02, 0, 0x0c210000, 2, 0x00020000 },
  1144. { 0x3, 0x31, 0x03, 0, 0x0c220000, 3, 0x00030000 },
  1145. { 0x3, 0x32, 0x00, 0, 0x20cc0000, 3, 0x001c0000 },
  1146. { 0x3, 0x32, 0x01, 0, 0x20c80000, 2, 0x00180000 },
  1147. { 0x3, 0x32, 0x02, 0, 0x20c00000, 1, 0x00100000 },
  1148. { 0x3, 0x32, 0x03, 0, 0x20b00000, 0, 0x00000000 },
  1149. { 0x3, 0x33, 0x00, 0, 0x0c360000, 0, 0x00000000 },
  1150. { 0x3, 0x33, 0x01, 0, 0x0c370000, 1, 0x00010000 },
  1151. { 0x3, 0x33, 0x02, 0, 0x0c3a0000, 3, 0x00040000 },
  1152. { 0x3, 0x33, 0x03, 0, 0x0c380000, 2, 0x00020000 },
  1153. { 0x3, 0x38, 0x00, 0, 0x0c600000, 0, 0x00000000 },
  1154. { 0x3, 0x38, 0x01, 0, 0x00000000, 0, 0x00000000 },
  1155. { 0x3, 0x39, 0x00, 0, 0x0c280000, 0, 0x00000000 }
  1156. };
  1157. /*
  1158. * SCE/RCE NOC aperture lookup table as per file "AON_NOC_Structure.info".
  1159. */
  1160. static const char * const tegra194_scenoc_routeid_initflow[] = {
  1161. [0x0] = "cbb_i/I/0",
  1162. [0x1] = "cpu_m_i/I/0",
  1163. [0x2] = "cpu_p_i/I/0",
  1164. [0x3] = "dma_m_i/I/0",
  1165. [0x4] = "dma_p_i/I/0",
  1166. [0x5] = "RESERVED",
  1167. [0x6] = "RESERVED",
  1168. [0x7] = "RESERVED"
  1169. };
  1170. static const char * const tegra194_scenoc_routeid_targflow[] = {
  1171. [0x00] = "multiport0_t/T/atcm_cfg",
  1172. [0x01] = "multiport0_t/T/car",
  1173. [0x02] = "multiport0_t/T/cast",
  1174. [0x03] = "multiport0_t/T/cfg",
  1175. [0x04] = "multiport0_t/T/dast",
  1176. [0x05] = "multiport0_t/T/dma",
  1177. [0x06] = "multiport0_t/T/err_collator",
  1178. [0x07] = "multiport0_t/T/err_collator_car",
  1179. [0x08] = "multiport0_t/T/fpga_misc",
  1180. [0x09] = "multiport0_t/T/fpga_uart",
  1181. [0x0a] = "multiport0_t/T/gte",
  1182. [0x0b] = "multiport0_t/T/hsp",
  1183. [0x0c] = "multiport0_t/T/misc",
  1184. [0x0d] = "multiport0_t/T/pm",
  1185. [0x0e] = "multiport0_t/T/tke",
  1186. [0x0f] = "RESERVED",
  1187. [0x10] = "multiport1_t/T/hsm",
  1188. [0x11] = "multiport1_t/T/vic0",
  1189. [0x12] = "multiport1_t/T/vic1",
  1190. [0x13] = "ast0_t/T/0",
  1191. [0x14] = "ast1_t/T/0",
  1192. [0x15] = "cbb_t/T/0",
  1193. [0x16] = "cpu_t/T/0",
  1194. [0x17] = "sce_noc_firewall/T/0",
  1195. [0x18] = "svc_t/T/0",
  1196. [0x19] = "RESERVED",
  1197. [0x1a] = "RESERVED",
  1198. [0x1b] = "RESERVED",
  1199. [0x1c] = "RESERVED",
  1200. [0x1d] = "RESERVED",
  1201. [0x1e] = "RESERVED",
  1202. [0x1f] = "RESERVED"
  1203. };
  1204. /*
  1205. * Fields of SCE/RCE NOC lookup table:
  1206. * Init flow, Targ flow, Targ subrange, Init mapping, Init localAddress,
  1207. * Targ mapping, Targ localAddress
  1208. * ----------------------------------------------------------------------------
  1209. */
  1210. static const struct tegra194_cbb_aperture tegra194_scenoc_apert_lookup[] = {
  1211. { 0x0, 0x16, 0x0, 0, 0x0b400000, 0, 0x0b400000 },
  1212. { 0x0, 0x16, 0x1, 0, 0x0bc00000, 1, 0x0bc00000 },
  1213. { 0x0, 0x0, 0x0, 0, 0x0b000000, 0, 0x00000000 },
  1214. { 0x0, 0x0, 0x1, 0, 0x0b800000, 1, 0x00000000 },
  1215. { 0x0, 0x1, 0x0, 0, 0x20de0000, 3, 0x000e0000 },
  1216. { 0x0, 0x1, 0x1, 0, 0x210e0000, 7, 0x000e0000 },
  1217. { 0x0, 0x1, 0x2, 0, 0x20dc0000, 2, 0x000c0000 },
  1218. { 0x0, 0x1, 0x3, 0, 0x210c0000, 6, 0x000c0000 },
  1219. { 0x0, 0x1, 0x4, 0, 0x20d80000, 1, 0x00080000 },
  1220. { 0x0, 0x1, 0x5, 0, 0x21080000, 5, 0x00080000 },
  1221. { 0x0, 0x1, 0x6, 0, 0x20d00000, 0, 0x00000000 },
  1222. { 0x0, 0x1, 0x7, 0, 0x21000000, 4, 0x00000000 },
  1223. { 0x0, 0x2, 0x0, 0, 0x0b040000, 0, 0x00000000 },
  1224. { 0x0, 0x2, 0x1, 0, 0x0b840000, 1, 0x00000000 },
  1225. { 0x0, 0x3, 0x0, 0, 0x0b230000, 0, 0x00000000 },
  1226. { 0x0, 0x3, 0x1, 0, 0x0ba30000, 1, 0x00000000 },
  1227. { 0x0, 0x4, 0x0, 0, 0x0b050000, 0, 0x00000000 },
  1228. { 0x0, 0x4, 0x1, 0, 0x0b850000, 1, 0x00000000 },
  1229. { 0x0, 0x5, 0x0, 0, 0x0b060000, 0, 0x00000000 },
  1230. { 0x0, 0x5, 0x1, 0, 0x0b070000, 1, 0x00010000 },
  1231. { 0x0, 0x5, 0x2, 0, 0x0b080000, 2, 0x00020000 },
  1232. { 0x0, 0x5, 0x3, 0, 0x0b090000, 3, 0x00030000 },
  1233. { 0x0, 0x5, 0x4, 0, 0x0b0a0000, 4, 0x00040000 },
  1234. { 0x0, 0x5, 0x5, 0, 0x0b0b0000, 5, 0x00050000 },
  1235. { 0x0, 0x5, 0x6, 0, 0x0b0c0000, 6, 0x00060000 },
  1236. { 0x0, 0x5, 0x7, 0, 0x0b0d0000, 7, 0x00070000 },
  1237. { 0x0, 0x5, 0x8, 0, 0x0b0e0000, 8, 0x00080000 },
  1238. { 0x0, 0x5, 0x9, 0, 0x0b860000, 9, 0x00000000 },
  1239. { 0x0, 0x5, 0xa, 0, 0x0b870000, 10, 0x00010000 },
  1240. { 0x0, 0x5, 0xb, 0, 0x0b880000, 11, 0x00020000 },
  1241. { 0x0, 0x5, 0xc, 0, 0x0b890000, 12, 0x00030000 },
  1242. { 0x0, 0x5, 0xd, 0, 0x0b8a0000, 13, 0x00040000 },
  1243. { 0x0, 0x5, 0xe, 0, 0x0b8b0000, 14, 0x00050000 },
  1244. { 0x0, 0x5, 0xf, 0, 0x0b8c0000, 15, 0x00060000 },
  1245. { 0x0, 0x5, 0x10, 0, 0x0b8d0000, 16, 0x00070000 },
  1246. { 0x0, 0x5, 0x11, 0, 0x0b8e0000, 17, 0x00080000 },
  1247. { 0x0, 0x6, 0x0, 0, 0x0b650000, 0, 0x00000000 },
  1248. { 0x0, 0x6, 0x1, 0, 0x0be50000, 1, 0x00000000 },
  1249. { 0x0, 0x7, 0x0, 0, 0x20df0000, 0, 0x00000000 },
  1250. { 0x0, 0x7, 0x1, 0, 0x210f0000, 1, 0x00000000 },
  1251. { 0x0, 0x8, 0x0, 0, 0x0b3e0000, 0, 0x00000000 },
  1252. { 0x0, 0x8, 0x1, 0, 0x0bbe0000, 1, 0x00000000 },
  1253. { 0x0, 0x9, 0x0, 0, 0x0b3d0000, 0, 0x00000000 },
  1254. { 0x0, 0x9, 0x1, 0, 0x0bbd0000, 1, 0x00000000 },
  1255. { 0x0, 0xa, 0x0, 0, 0x0b1e0000, 0, 0x00000000 },
  1256. { 0x0, 0xa, 0x1, 0, 0x0b9e0000, 1, 0x00000000 },
  1257. { 0x0, 0xb, 0x0, 0, 0x0b150000, 0, 0x00000000 },
  1258. { 0x0, 0xb, 0x1, 0, 0x0b160000, 1, 0x00010000 },
  1259. { 0x0, 0xb, 0x2, 0, 0x0b170000, 2, 0x00020000 },
  1260. { 0x0, 0xb, 0x3, 0, 0x0b180000, 3, 0x00030000 },
  1261. { 0x0, 0xb, 0x4, 0, 0x0b190000, 4, 0x00040000 },
  1262. { 0x0, 0xb, 0x5, 0, 0x0b1a0000, 5, 0x00050000 },
  1263. { 0x0, 0xb, 0x6, 0, 0x0b1b0000, 6, 0x00060000 },
  1264. { 0x0, 0xb, 0x7, 0, 0x0b1c0000, 7, 0x00070000 },
  1265. { 0x0, 0xb, 0x8, 0, 0x0b1d0000, 8, 0x00080000 },
  1266. { 0x0, 0xb, 0x9, 0, 0x0b950000, 9, 0x00000000 },
  1267. { 0x0, 0xb, 0xa, 0, 0x0b960000, 10, 0x00010000 },
  1268. { 0x0, 0xb, 0xb, 0, 0x0b970000, 11, 0x00020000 },
  1269. { 0x0, 0xb, 0xc, 0, 0x0b980000, 12, 0x00030000 },
  1270. { 0x0, 0xb, 0xd, 0, 0x0b990000, 13, 0x00040000 },
  1271. { 0x0, 0xb, 0xe, 0, 0x0b9a0000, 14, 0x00050000 },
  1272. { 0x0, 0xb, 0xf, 0, 0x0b9b0000, 15, 0x00060000 },
  1273. { 0x0, 0xb, 0x10, 0, 0x0b9c0000, 16, 0x00070000 },
  1274. { 0x0, 0xb, 0x11, 0, 0x0b9d0000, 17, 0x00080000 },
  1275. { 0x0, 0xc, 0x0, 0, 0x0b660000, 0, 0x00000000 },
  1276. { 0x0, 0xc, 0x1, 0, 0x0be60000, 1, 0x00000000 },
  1277. { 0x0, 0xd, 0x0, 0, 0x0b1f0000, 0, 0x00000000 },
  1278. { 0x0, 0xd, 0x1, 0, 0x0b200000, 1, 0x00010000 },
  1279. { 0x0, 0xd, 0x2, 0, 0x0b210000, 2, 0x00020000 },
  1280. { 0x0, 0xd, 0x3, 0, 0x0b220000, 3, 0x00030000 },
  1281. { 0x0, 0xd, 0x4, 0, 0x0b9f0000, 4, 0x00000000 },
  1282. { 0x0, 0xd, 0x5, 0, 0x0ba00000, 5, 0x00010000 },
  1283. { 0x0, 0xd, 0x6, 0, 0x0ba10000, 6, 0x00020000 },
  1284. { 0x0, 0xd, 0x7, 0, 0x0ba20000, 7, 0x00030000 },
  1285. { 0x0, 0xe, 0x0, 0, 0x0b0f0000, 0, 0x00000000 },
  1286. { 0x0, 0xe, 0x1, 0, 0x0b100000, 1, 0x00010000 },
  1287. { 0x0, 0xe, 0x2, 0, 0x0b110000, 2, 0x00020000 },
  1288. { 0x0, 0xe, 0x3, 0, 0x0b120000, 3, 0x00030000 },
  1289. { 0x0, 0xe, 0x4, 0, 0x0b130000, 4, 0x00040000 },
  1290. { 0x0, 0xe, 0x5, 0, 0x0b140000, 5, 0x00050000 },
  1291. { 0x0, 0xe, 0x6, 0, 0x0b8f0000, 6, 0x00000000 },
  1292. { 0x0, 0xe, 0x7, 0, 0x0b900000, 7, 0x00010000 },
  1293. { 0x0, 0xe, 0x8, 0, 0x0b910000, 8, 0x00020000 },
  1294. { 0x0, 0xe, 0x9, 0, 0x0b920000, 9, 0x00030000 },
  1295. { 0x0, 0xe, 0xa, 0, 0x0b930000, 10, 0x00040000 },
  1296. { 0x0, 0xe, 0xb, 0, 0x0b940000, 11, 0x00050000 },
  1297. { 0x0, 0x10, 0x0, 0, 0x0b240000, 0, 0x00000000 },
  1298. { 0x0, 0x10, 0x1, 0, 0x0ba40000, 1, 0x00000000 },
  1299. { 0x0, 0x11, 0x0, 0, 0x0b020000, 0, 0x00000000 },
  1300. { 0x0, 0x11, 0x1, 0, 0x0b820000, 1, 0x00000000 },
  1301. { 0x0, 0x12, 0x0, 0, 0x0b030000, 0, 0x00000000 },
  1302. { 0x0, 0x12, 0x1, 0, 0x0b830000, 1, 0x00000000 },
  1303. { 0x0, 0x17, 0x0, 0, 0x0b640000, 0, 0x00000000 },
  1304. { 0x0, 0x17, 0x1, 0, 0x0be40000, 1, 0x00000000 },
  1305. { 0x0, 0x18, 0x0, 0, 0x0b600000, 0, 0x00000000 },
  1306. { 0x0, 0x18, 0x1, 0, 0x0be00000, 1, 0x00000000 },
  1307. { 0x0, 0x18, 0x2, 0, 0x00000000, 0, 0x00000000 },
  1308. { 0x0, 0x18, 0x3, 0, 0x00000000, 0, 0x00000000 },
  1309. { 0x1, 0x13, 0x0, 0, 0x40000000, 0, 0x40000000 },
  1310. { 0x1, 0x13, 0x1, 1, 0x80000000, 1, 0x80000000 },
  1311. { 0x1, 0x13, 0x2, 0, 0x00000000, 0, 0x00000000 },
  1312. { 0x2, 0x15, 0x0, 0, 0x20c00000, 8, 0x20c00000 },
  1313. { 0x2, 0x15, 0x1, 0, 0x21100000, 22, 0x21100000 },
  1314. { 0x2, 0x15, 0x2, 0, 0x20e00000, 9, 0x20e00000 },
  1315. { 0x2, 0x15, 0x3, 0, 0x21200000, 23, 0x21200000 },
  1316. { 0x2, 0x15, 0x4, 0, 0x20800000, 7, 0x20800000 },
  1317. { 0x2, 0x15, 0x5, 0, 0x21400000, 24, 0x21400000 },
  1318. { 0x2, 0x15, 0x6, 0, 0x0b000000, 18, 0x0b000000 },
  1319. { 0x2, 0x15, 0x7, 0, 0x0b800000, 3, 0x0b800000 },
  1320. { 0x2, 0x15, 0x8, 0, 0x20000000, 6, 0x20000000 },
  1321. { 0x2, 0x15, 0x9, 0, 0x21800000, 25, 0x21800000 },
  1322. { 0x2, 0x15, 0xa, 0, 0x0a000000, 2, 0x0a000000 },
  1323. { 0x2, 0x15, 0xb, 0, 0x0a000000, 17, 0x0a000000 },
  1324. { 0x2, 0x15, 0xc, 0, 0x20000000, 21, 0x20000000 },
  1325. { 0x2, 0x15, 0xd, 0, 0x21000000, 10, 0x21000000 },
  1326. { 0x2, 0x15, 0xe, 0, 0x08000000, 1, 0x08000000 },
  1327. { 0x2, 0x15, 0xf, 0, 0x08000000, 16, 0x08000000 },
  1328. { 0x2, 0x15, 0x10, 0, 0x22000000, 11, 0x22000000 },
  1329. { 0x2, 0x15, 0x11, 0, 0x22000000, 26, 0x22000000 },
  1330. { 0x2, 0x15, 0x12, 0, 0x0c000000, 4, 0x0c000000 },
  1331. { 0x2, 0x15, 0x13, 0, 0x0c000000, 19, 0x0c000000 },
  1332. { 0x2, 0x15, 0x14, 0, 0x24000000, 12, 0x24000000 },
  1333. { 0x2, 0x15, 0x15, 0, 0x24000000, 27, 0x24000000 },
  1334. { 0x2, 0x15, 0x16, 0, 0x00000000, 0, 0x00000000 },
  1335. { 0x2, 0x15, 0x17, 0, 0x00000000, 15, 0x00000000 },
  1336. { 0x2, 0x15, 0x18, 0, 0x28000000, 13, 0x28000000 },
  1337. { 0x2, 0x15, 0x19, 0, 0x28000000, 28, 0x28000000 },
  1338. { 0x2, 0x15, 0x1a, 0, 0x10000000, 5, 0x10000000 },
  1339. { 0x2, 0x15, 0x1b, 0, 0x10000000, 20, 0x10000000 },
  1340. { 0x2, 0x15, 0x1c, 0, 0x30000000, 14, 0x30000000 },
  1341. { 0x2, 0x15, 0x1d, 0, 0x30000000, 29, 0x30000000 },
  1342. { 0x2, 0x0, 0x0, 0, 0x0b000000, 0, 0x00000000 },
  1343. { 0x2, 0x0, 0x1, 0, 0x0b800000, 1, 0x00000000 },
  1344. { 0x2, 0x1, 0x0, 0, 0x20de0000, 3, 0x000e0000 },
  1345. { 0x2, 0x1, 0x1, 0, 0x210e0000, 7, 0x000e0000 },
  1346. { 0x2, 0x1, 0x2, 0, 0x20dc0000, 2, 0x000c0000 },
  1347. { 0x2, 0x1, 0x3, 0, 0x210c0000, 6, 0x000c0000 },
  1348. { 0x2, 0x1, 0x4, 0, 0x20d80000, 1, 0x00080000 },
  1349. { 0x2, 0x1, 0x5, 0, 0x21080000, 5, 0x00080000 },
  1350. { 0x2, 0x1, 0x6, 0, 0x20d00000, 0, 0x00000000 },
  1351. { 0x2, 0x1, 0x7, 0, 0x21000000, 4, 0x00000000 },
  1352. { 0x2, 0x2, 0x0, 0, 0x0b040000, 0, 0x00000000 },
  1353. { 0x2, 0x2, 0x1, 0, 0x0b840000, 1, 0x00000000 },
  1354. { 0x2, 0x3, 0x0, 0, 0x0b230000, 0, 0x00000000 },
  1355. { 0x2, 0x3, 0x1, 0, 0x0ba30000, 1, 0x00000000 },
  1356. { 0x2, 0x4, 0x0, 0, 0x0b050000, 0, 0x00000000 },
  1357. { 0x2, 0x4, 0x1, 0, 0x0b850000, 1, 0x00000000 },
  1358. { 0x2, 0x5, 0x0, 0, 0x0b060000, 0, 0x00000000 },
  1359. { 0x2, 0x5, 0x1, 0, 0x0b070000, 1, 0x00010000 },
  1360. { 0x2, 0x5, 0x2, 0, 0x0b080000, 2, 0x00020000 },
  1361. { 0x2, 0x5, 0x3, 0, 0x0b090000, 3, 0x00030000 },
  1362. { 0x2, 0x5, 0x4, 0, 0x0b0a0000, 4, 0x00040000 },
  1363. { 0x2, 0x5, 0x5, 0, 0x0b0b0000, 5, 0x00050000 },
  1364. { 0x2, 0x5, 0x6, 0, 0x0b0c0000, 6, 0x00060000 },
  1365. { 0x2, 0x5, 0x7, 0, 0x0b0d0000, 7, 0x00070000 },
  1366. { 0x2, 0x5, 0x8, 0, 0x0b0e0000, 8, 0x00080000 },
  1367. { 0x2, 0x5, 0x9, 0, 0x0b860000, 9, 0x00000000 },
  1368. { 0x2, 0x5, 0xa, 0, 0x0b870000, 10, 0x00010000 },
  1369. { 0x2, 0x5, 0xb, 0, 0x0b880000, 11, 0x00020000 },
  1370. { 0x2, 0x5, 0xc, 0, 0x0b890000, 12, 0x00030000 },
  1371. { 0x2, 0x5, 0xd, 0, 0x0b8a0000, 13, 0x00040000 },
  1372. { 0x2, 0x5, 0xe, 0, 0x0b8b0000, 14, 0x00050000 },
  1373. { 0x2, 0x5, 0xf, 0, 0x0b8c0000, 15, 0x00060000 },
  1374. { 0x2, 0x5, 0x10, 0, 0x0b8d0000, 16, 0x00070000 },
  1375. { 0x2, 0x5, 0x11, 0, 0x0b8e0000, 17, 0x00080000 },
  1376. { 0x2, 0x6, 0x0, 0, 0x0b650000, 0, 0x00000000 },
  1377. { 0x2, 0x6, 0x1, 0, 0x0be50000, 1, 0x00000000 },
  1378. { 0x2, 0x7, 0x0, 0, 0x20df0000, 0, 0x00000000 },
  1379. { 0x2, 0x7, 0x1, 0, 0x210f0000, 1, 0x00000000 },
  1380. { 0x2, 0x8, 0x0, 0, 0x0b3e0000, 0, 0x00000000 },
  1381. { 0x2, 0x8, 0x1, 0, 0x0bbe0000, 1, 0x00000000 },
  1382. { 0x2, 0x9, 0x0, 0, 0x0b3d0000, 0, 0x00000000 },
  1383. { 0x2, 0x9, 0x1, 0, 0x0bbd0000, 1, 0x00000000 },
  1384. { 0x2, 0xa, 0x0, 0, 0x0b1e0000, 0, 0x00000000 },
  1385. { 0x2, 0xa, 0x1, 0, 0x0b9e0000, 1, 0x00000000 },
  1386. { 0x2, 0xb, 0x0, 0, 0x0b150000, 0, 0x00000000 },
  1387. { 0x2, 0xb, 0x1, 0, 0x0b160000, 1, 0x00010000 },
  1388. { 0x2, 0xb, 0x2, 0, 0x0b170000, 2, 0x00020000 },
  1389. { 0x2, 0xb, 0x3, 0, 0x0b180000, 3, 0x00030000 },
  1390. { 0x2, 0xb, 0x4, 0, 0x0b190000, 4, 0x00040000 },
  1391. { 0x2, 0xb, 0x5, 0, 0x0b1a0000, 5, 0x00050000 },
  1392. { 0x2, 0xb, 0x6, 0, 0x0b1b0000, 6, 0x00060000 },
  1393. { 0x2, 0xb, 0x7, 0, 0x0b1c0000, 7, 0x00070000 },
  1394. { 0x2, 0xb, 0x8, 0, 0x0b1d0000, 8, 0x00080000 },
  1395. { 0x2, 0xb, 0x9, 0, 0x0b950000, 9, 0x00000000 },
  1396. { 0x2, 0xb, 0xa, 0, 0x0b960000, 10, 0x00010000 },
  1397. { 0x2, 0xb, 0xb, 0, 0x0b970000, 11, 0x00020000 },
  1398. { 0x2, 0xb, 0xc, 0, 0x0b980000, 12, 0x00030000 },
  1399. { 0x2, 0xb, 0xd, 0, 0x0b990000, 13, 0x00040000 },
  1400. { 0x2, 0xb, 0xe, 0, 0x0b9a0000, 14, 0x00050000 },
  1401. { 0x2, 0xb, 0xf, 0, 0x0b9b0000, 15, 0x00060000 },
  1402. { 0x2, 0xb, 0x10, 0, 0x0b9c0000, 16, 0x00070000 },
  1403. { 0x2, 0xb, 0x11, 0, 0x0b9d0000, 17, 0x00080000 },
  1404. { 0x2, 0xc, 0x0, 0, 0x0b660000, 0, 0x00000000 },
  1405. { 0x2, 0xc, 0x1, 0, 0x0be60000, 1, 0x00000000 },
  1406. { 0x2, 0xd, 0x0, 0, 0x0b1f0000, 0, 0x00000000 },
  1407. { 0x2, 0xd, 0x1, 0, 0x0b200000, 1, 0x00010000 },
  1408. { 0x2, 0xd, 0x2, 0, 0x0b210000, 2, 0x00020000 },
  1409. { 0x2, 0xd, 0x3, 0, 0x0b220000, 3, 0x00030000 },
  1410. { 0x2, 0xd, 0x4, 0, 0x0b9f0000, 4, 0x00000000 },
  1411. { 0x2, 0xd, 0x5, 0, 0x0ba00000, 5, 0x00010000 },
  1412. { 0x2, 0xd, 0x6, 0, 0x0ba10000, 6, 0x00020000 },
  1413. { 0x2, 0xd, 0x7, 0, 0x0ba20000, 7, 0x00030000 },
  1414. { 0x2, 0xe, 0x0, 0, 0x0b0f0000, 0, 0x00000000 },
  1415. { 0x2, 0xe, 0x1, 0, 0x0b100000, 1, 0x00010000 },
  1416. { 0x2, 0xe, 0x2, 0, 0x0b110000, 2, 0x00020000 },
  1417. { 0x2, 0xe, 0x3, 0, 0x0b120000, 3, 0x00030000 },
  1418. { 0x2, 0xe, 0x4, 0, 0x0b130000, 4, 0x00040000 },
  1419. { 0x2, 0xe, 0x5, 0, 0x0b140000, 5, 0x00050000 },
  1420. { 0x2, 0xe, 0x6, 0, 0x0b8f0000, 6, 0x00000000 },
  1421. { 0x2, 0xe, 0x7, 0, 0x0b900000, 7, 0x00010000 },
  1422. { 0x2, 0xe, 0x8, 0, 0x0b910000, 8, 0x00020000 },
  1423. { 0x2, 0xe, 0x9, 0, 0x0b920000, 9, 0x00030000 },
  1424. { 0x2, 0xe, 0xa, 0, 0x0b930000, 10, 0x00040000 },
  1425. { 0x2, 0xe, 0xb, 0, 0x0b940000, 11, 0x00050000 },
  1426. { 0x2, 0x10, 0x0, 0, 0x0b240000, 0, 0x00000000 },
  1427. { 0x2, 0x10, 0x1, 0, 0x0ba40000, 1, 0x00000000 },
  1428. { 0x2, 0x11, 0x0, 0, 0x0b020000, 0, 0x00000000 },
  1429. { 0x2, 0x11, 0x1, 0, 0x0b820000, 1, 0x00000000 },
  1430. { 0x2, 0x12, 0x0, 0, 0x0b030000, 0, 0x00000000 },
  1431. { 0x2, 0x12, 0x1, 0, 0x0b830000, 1, 0x00000000 },
  1432. { 0x2, 0x17, 0x0, 0, 0x0b640000, 0, 0x00000000 },
  1433. { 0x2, 0x17, 0x1, 0, 0x0be40000, 1, 0x00000000 },
  1434. { 0x2, 0x18, 0x0, 0, 0x0b600000, 0, 0x00000000 },
  1435. { 0x2, 0x18, 0x1, 0, 0x0be00000, 1, 0x00000000 },
  1436. { 0x2, 0x18, 0x2, 0, 0x00000000, 0, 0x00000000 },
  1437. { 0x2, 0x18, 0x3, 0, 0x00000000, 0, 0x00000000 },
  1438. { 0x3, 0x14, 0x0, 0, 0x40000000, 0, 0x40000000 },
  1439. { 0x3, 0x14, 0x1, 1, 0x80000000, 1, 0x80000000 },
  1440. { 0x3, 0x16, 0x0, 2, 0x0b400000, 0, 0x0b400000 },
  1441. { 0x3, 0x16, 0x1, 2, 0x0bc00000, 1, 0x0bc00000 },
  1442. { 0x3, 0x16, 0x2, 0, 0x00000000, 0, 0x00000000 },
  1443. { 0x3, 0x16, 0x3, 0, 0x00000000, 0, 0x00000000 },
  1444. { 0x4, 0x15, 0x0, 0, 0x20c00000, 8, 0x20c00000 },
  1445. { 0x4, 0x15, 0x1, 0, 0x21100000, 22, 0x21100000 },
  1446. { 0x4, 0x15, 0x2, 0, 0x20e00000, 9, 0x20e00000 },
  1447. { 0x4, 0x15, 0x3, 0, 0x21200000, 23, 0x21200000 },
  1448. { 0x4, 0x15, 0x4, 0, 0x20800000, 7, 0x20800000 },
  1449. { 0x4, 0x15, 0x5, 0, 0x21400000, 24, 0x21400000 },
  1450. { 0x4, 0x15, 0x6, 0, 0x0b000000, 18, 0x0b000000 },
  1451. { 0x4, 0x15, 0x7, 0, 0x0b800000, 3, 0x0b800000 },
  1452. { 0x4, 0x15, 0x8, 0, 0x20000000, 6, 0x20000000 },
  1453. { 0x4, 0x15, 0x9, 0, 0x21800000, 25, 0x21800000 },
  1454. { 0x4, 0x15, 0xa, 0, 0x0a000000, 2, 0x0a000000 },
  1455. { 0x4, 0x15, 0xb, 0, 0x0a000000, 17, 0x0a000000 },
  1456. { 0x4, 0x15, 0xc, 0, 0x20000000, 21, 0x20000000 },
  1457. { 0x4, 0x15, 0xd, 0, 0x21000000, 10, 0x21000000 },
  1458. { 0x4, 0x15, 0xe, 0, 0x08000000, 1, 0x08000000 },
  1459. { 0x4, 0x15, 0xf, 0, 0x08000000, 16, 0x08000000 },
  1460. { 0x4, 0x15, 0x10, 0, 0x22000000, 11, 0x22000000 },
  1461. { 0x4, 0x15, 0x11, 0, 0x22000000, 26, 0x22000000 },
  1462. { 0x4, 0x15, 0x12, 0, 0x0c000000, 4, 0x0c000000 },
  1463. { 0x4, 0x15, 0x13, 0, 0x0c000000, 19, 0x0c000000 },
  1464. { 0x4, 0x15, 0x14, 0, 0x24000000, 12, 0x24000000 },
  1465. { 0x4, 0x15, 0x15, 0, 0x24000000, 27, 0x24000000 },
  1466. { 0x4, 0x15, 0x16, 0, 0x00000000, 0, 0x00000000 },
  1467. { 0x4, 0x15, 0x17, 0, 0x00000000, 15, 0x00000000 },
  1468. { 0x4, 0x15, 0x18, 0, 0x28000000, 13, 0x28000000 },
  1469. { 0x4, 0x15, 0x19, 0, 0x28000000, 28, 0x28000000 },
  1470. { 0x4, 0x15, 0x1a, 0, 0x10000000, 5, 0x10000000 },
  1471. { 0x4, 0x15, 0x1b, 0, 0x10000000, 20, 0x10000000 },
  1472. { 0x4, 0x15, 0x1c, 0, 0x30000000, 14, 0x30000000 },
  1473. { 0x4, 0x15, 0x1d, 0, 0x30000000, 29, 0x30000000 },
  1474. { 0x4, 0x0, 0x0, 0, 0x0b000000, 0, 0x00000000 },
  1475. { 0x4, 0x0, 0x1, 0, 0x0b800000, 1, 0x00000000 },
  1476. { 0x4, 0x1, 0x0, 0, 0x20de0000, 3, 0x000e0000 },
  1477. { 0x4, 0x1, 0x1, 0, 0x210e0000, 7, 0x000e0000 },
  1478. { 0x4, 0x1, 0x2, 0, 0x20dc0000, 2, 0x000c0000 },
  1479. { 0x4, 0x1, 0x3, 0, 0x210c0000, 6, 0x000c0000 },
  1480. { 0x4, 0x1, 0x4, 0, 0x20d80000, 1, 0x00080000 },
  1481. { 0x4, 0x1, 0x5, 0, 0x21080000, 5, 0x00080000 },
  1482. { 0x4, 0x1, 0x6, 0, 0x20d00000, 0, 0x00000000 },
  1483. { 0x4, 0x1, 0x7, 0, 0x21000000, 4, 0x00000000 },
  1484. { 0x4, 0x2, 0x0, 0, 0x0b040000, 0, 0x00000000 },
  1485. { 0x4, 0x2, 0x1, 0, 0x0b840000, 1, 0x00000000 },
  1486. { 0x4, 0x3, 0x0, 0, 0x0b230000, 0, 0x00000000 },
  1487. { 0x4, 0x3, 0x1, 0, 0x0ba30000, 1, 0x00000000 },
  1488. { 0x4, 0x4, 0x0, 0, 0x0b050000, 0, 0x00000000 },
  1489. { 0x4, 0x4, 0x1, 0, 0x0b850000, 1, 0x00000000 },
  1490. { 0x4, 0x5, 0x0, 0, 0x0b060000, 0, 0x00000000 },
  1491. { 0x4, 0x5, 0x1, 0, 0x0b070000, 1, 0x00010000 },
  1492. { 0x4, 0x5, 0x2, 0, 0x0b080000, 2, 0x00020000 },
  1493. { 0x4, 0x5, 0x3, 0, 0x0b090000, 3, 0x00030000 },
  1494. { 0x4, 0x5, 0x4, 0, 0x0b0a0000, 4, 0x00040000 },
  1495. { 0x4, 0x5, 0x5, 0, 0x0b0b0000, 5, 0x00050000 },
  1496. { 0x4, 0x5, 0x6, 0, 0x0b0c0000, 6, 0x00060000 },
  1497. { 0x4, 0x5, 0x7, 0, 0x0b0d0000, 7, 0x00070000 },
  1498. { 0x4, 0x5, 0x8, 0, 0x0b0e0000, 8, 0x00080000 },
  1499. { 0x4, 0x5, 0x9, 0, 0x0b860000, 9, 0x00000000 },
  1500. { 0x4, 0x5, 0xa, 0, 0x0b870000, 10, 0x00010000 },
  1501. { 0x4, 0x5, 0xb, 0, 0x0b880000, 11, 0x00020000 },
  1502. { 0x4, 0x5, 0xc, 0, 0x0b890000, 12, 0x00030000 },
  1503. { 0x4, 0x5, 0xd, 0, 0x0b8a0000, 13, 0x00040000 },
  1504. { 0x4, 0x5, 0xe, 0, 0x0b8b0000, 14, 0x00050000 },
  1505. { 0x4, 0x5, 0xf, 0, 0x0b8c0000, 15, 0x00060000 },
  1506. { 0x4, 0x5, 0x10, 0, 0x0b8d0000, 16, 0x00070000 },
  1507. { 0x4, 0x5, 0x11, 0, 0x0b8e0000, 17, 0x00080000 },
  1508. { 0x4, 0x6, 0x0, 0, 0x0b650000, 0, 0x00000000 },
  1509. { 0x4, 0x6, 0x1, 0, 0x0be50000, 1, 0x00000000 },
  1510. { 0x4, 0x7, 0x0, 0, 0x20df0000, 0, 0x00000000 },
  1511. { 0x4, 0x7, 0x1, 0, 0x210f0000, 1, 0x00000000 },
  1512. { 0x4, 0x8, 0x0, 0, 0x0b3e0000, 0, 0x00000000 },
  1513. { 0x4, 0x8, 0x1, 0, 0x0bbe0000, 1, 0x00000000 },
  1514. { 0x4, 0x9, 0x0, 0, 0x0b3d0000, 0, 0x00000000 },
  1515. { 0x4, 0x9, 0x1, 0, 0x0bbd0000, 1, 0x00000000 },
  1516. { 0x4, 0xa, 0x0, 0, 0x0b1e0000, 0, 0x00000000 },
  1517. { 0x4, 0xa, 0x1, 0, 0x0b9e0000, 1, 0x00000000 },
  1518. { 0x4, 0xb, 0x0, 0, 0x0b150000, 0, 0x00000000 },
  1519. { 0x4, 0xb, 0x1, 0, 0x0b160000, 1, 0x00010000 },
  1520. { 0x4, 0xb, 0x2, 0, 0x0b170000, 2, 0x00020000 },
  1521. { 0x4, 0xb, 0x3, 0, 0x0b180000, 3, 0x00030000 },
  1522. { 0x4, 0xb, 0x4, 0, 0x0b190000, 4, 0x00040000 },
  1523. { 0x4, 0xb, 0x5, 0, 0x0b1a0000, 5, 0x00050000 },
  1524. { 0x4, 0xb, 0x6, 0, 0x0b1b0000, 6, 0x00060000 },
  1525. { 0x4, 0xb, 0x7, 0, 0x0b1c0000, 7, 0x00070000 },
  1526. { 0x4, 0xb, 0x8, 0, 0x0b1d0000, 8, 0x00080000 },
  1527. { 0x4, 0xb, 0x9, 0, 0x0b950000, 9, 0x00000000 },
  1528. { 0x4, 0xb, 0xa, 0, 0x0b960000, 10, 0x00010000 },
  1529. { 0x4, 0xb, 0xb, 0, 0x0b970000, 11, 0x00020000 },
  1530. { 0x4, 0xb, 0xc, 0, 0x0b980000, 12, 0x00030000 },
  1531. { 0x4, 0xb, 0xd, 0, 0x0b990000, 13, 0x00040000 },
  1532. { 0x4, 0xb, 0xe, 0, 0x0b9a0000, 14, 0x00050000 },
  1533. { 0x4, 0xb, 0xf, 0, 0x0b9b0000, 15, 0x00060000 },
  1534. { 0x4, 0xb, 0x10, 0, 0x0b9c0000, 16, 0x00070000 },
  1535. { 0x4, 0xb, 0x11, 0, 0x0b9d0000, 17, 0x00080000 },
  1536. { 0x4, 0xc, 0x0, 0, 0x0b660000, 0, 0x00000000 },
  1537. { 0x4, 0xc, 0x1, 0, 0x0be60000, 1, 0x00000000 },
  1538. { 0x4, 0xd, 0x0, 0, 0x0b1f0000, 0, 0x00000000 },
  1539. { 0x4, 0xd, 0x1, 0, 0x0b200000, 1, 0x00010000 },
  1540. { 0x4, 0xd, 0x2, 0, 0x0b210000, 2, 0x00020000 },
  1541. { 0x4, 0xd, 0x3, 0, 0x0b220000, 3, 0x00030000 },
  1542. { 0x4, 0xd, 0x4, 0, 0x0b9f0000, 4, 0x00000000 },
  1543. { 0x4, 0xd, 0x5, 0, 0x0ba00000, 5, 0x00010000 },
  1544. { 0x4, 0xd, 0x6, 0, 0x0ba10000, 6, 0x00020000 },
  1545. { 0x4, 0xd, 0x7, 0, 0x0ba20000, 7, 0x00030000 },
  1546. { 0x4, 0xe, 0x0, 0, 0x0b0f0000, 0, 0x00000000 },
  1547. { 0x4, 0xe, 0x1, 0, 0x0b100000, 1, 0x00010000 },
  1548. { 0x4, 0xe, 0x2, 0, 0x0b110000, 2, 0x00020000 },
  1549. { 0x4, 0xe, 0x3, 0, 0x0b120000, 3, 0x00030000 },
  1550. { 0x4, 0xe, 0x4, 0, 0x0b130000, 4, 0x00040000 },
  1551. { 0x4, 0xe, 0x5, 0, 0x0b140000, 5, 0x00050000 },
  1552. { 0x4, 0xe, 0x6, 0, 0x0b8f0000, 6, 0x00000000 },
  1553. { 0x4, 0xe, 0x7, 0, 0x0b900000, 7, 0x00010000 },
  1554. { 0x4, 0xe, 0x8, 0, 0x0b910000, 8, 0x00020000 },
  1555. { 0x4, 0xe, 0x9, 0, 0x0b920000, 9, 0x00030000 },
  1556. { 0x4, 0xe, 0xa, 0, 0x0b930000, 10, 0x00040000 },
  1557. { 0x4, 0xe, 0xb, 0, 0x0b940000, 11, 0x00050000 },
  1558. { 0x4, 0x10, 0x0, 0, 0x0b240000, 0, 0x00000000 },
  1559. { 0x4, 0x10, 0x1, 0, 0x0ba40000, 1, 0x00000000 },
  1560. { 0x4, 0x11, 0x0, 0, 0x0b020000, 0, 0x00000000 },
  1561. { 0x4, 0x11, 0x1, 0, 0x0b820000, 1, 0x00000000 },
  1562. { 0x4, 0x12, 0x0, 0, 0x0b030000, 0, 0x00000000 },
  1563. { 0x4, 0x12, 0x1, 0, 0x0b830000, 1, 0x00000000 },
  1564. { 0x4, 0x17, 0x0, 0, 0x0b640000, 0, 0x00000000 },
  1565. { 0x4, 0x17, 0x1, 0, 0x0be40000, 1, 0x00000000 },
  1566. { 0x4, 0x18, 0x0, 0, 0x0b600000, 0, 0x00000000 },
  1567. { 0x4, 0x18, 0x1, 0, 0x0be00000, 1, 0x00000000 },
  1568. { 0x4, 0x18, 0x2, 0, 0x00000000, 0, 0x00000000 },
  1569. { 0x4, 0x18, 0x3, 0, 0x00000000, 0, 0x00000000 }
  1570. };
  1571. static void cbbcentralnoc_parse_routeid(struct tegra194_cbb_aperture *info, u64 routeid)
  1572. {
  1573. info->initflow = FIELD_GET(CBB_NOC_INITFLOW, routeid);
  1574. info->targflow = FIELD_GET(CBB_NOC_TARGFLOW, routeid);
  1575. info->targ_subrange = FIELD_GET(CBB_NOC_TARG_SUBRANGE, routeid);
  1576. info->seqid = FIELD_GET(CBB_NOC_SEQID, routeid);
  1577. }
  1578. static void bpmpnoc_parse_routeid(struct tegra194_cbb_aperture *info, u64 routeid)
  1579. {
  1580. info->initflow = FIELD_GET(BPMP_NOC_INITFLOW, routeid);
  1581. info->targflow = FIELD_GET(BPMP_NOC_TARGFLOW, routeid);
  1582. info->targ_subrange = FIELD_GET(BPMP_NOC_TARG_SUBRANGE, routeid);
  1583. info->seqid = FIELD_GET(BPMP_NOC_SEQID, routeid);
  1584. }
  1585. static void aonnoc_parse_routeid(struct tegra194_cbb_aperture *info, u64 routeid)
  1586. {
  1587. info->initflow = FIELD_GET(AON_NOC_INITFLOW, routeid);
  1588. info->targflow = FIELD_GET(AON_NOC_TARGFLOW, routeid);
  1589. info->targ_subrange = FIELD_GET(AON_NOC_TARG_SUBRANGE, routeid);
  1590. info->seqid = FIELD_GET(AON_NOC_SEQID, routeid);
  1591. }
  1592. static void scenoc_parse_routeid(struct tegra194_cbb_aperture *info, u64 routeid)
  1593. {
  1594. info->initflow = FIELD_GET(SCE_NOC_INITFLOW, routeid);
  1595. info->targflow = FIELD_GET(SCE_NOC_TARGFLOW, routeid);
  1596. info->targ_subrange = FIELD_GET(SCE_NOC_TARG_SUBRANGE, routeid);
  1597. info->seqid = FIELD_GET(SCE_NOC_SEQID, routeid);
  1598. }
  1599. static void cbbcentralnoc_parse_userbits(struct tegra194_cbb_userbits *usrbits, u32 elog_5)
  1600. {
  1601. usrbits->axcache = FIELD_GET(CBB_NOC_AXCACHE, elog_5);
  1602. usrbits->non_mod = FIELD_GET(CBB_NOC_NON_MOD, elog_5);
  1603. usrbits->axprot = FIELD_GET(CBB_NOC_AXPROT, elog_5);
  1604. usrbits->falconsec = FIELD_GET(CBB_NOC_FALCONSEC, elog_5);
  1605. usrbits->grpsec = FIELD_GET(CBB_NOC_GRPSEC, elog_5);
  1606. usrbits->vqc = FIELD_GET(CBB_NOC_VQC, elog_5);
  1607. usrbits->mstr_id = FIELD_GET(CBB_NOC_MSTR_ID, elog_5) - 1;
  1608. usrbits->axi_id = FIELD_GET(CBB_NOC_AXI_ID, elog_5);
  1609. }
  1610. static void clusternoc_parse_userbits(struct tegra194_cbb_userbits *usrbits, u32 elog_5)
  1611. {
  1612. usrbits->axcache = FIELD_GET(CLUSTER_NOC_AXCACHE, elog_5);
  1613. usrbits->axprot = FIELD_GET(CLUSTER_NOC_AXCACHE, elog_5);
  1614. usrbits->falconsec = FIELD_GET(CLUSTER_NOC_FALCONSEC, elog_5);
  1615. usrbits->grpsec = FIELD_GET(CLUSTER_NOC_GRPSEC, elog_5);
  1616. usrbits->vqc = FIELD_GET(CLUSTER_NOC_VQC, elog_5);
  1617. usrbits->mstr_id = FIELD_GET(CLUSTER_NOC_MSTR_ID, elog_5) - 1;
  1618. }
  1619. static void tegra194_cbb_fault_enable(struct tegra_cbb *cbb)
  1620. {
  1621. struct tegra194_cbb *priv = to_tegra194_cbb(cbb);
  1622. writel(1, priv->regs + ERRLOGGER_0_FAULTEN_0);
  1623. writel(1, priv->regs + ERRLOGGER_1_FAULTEN_0);
  1624. writel(1, priv->regs + ERRLOGGER_2_FAULTEN_0);
  1625. }
  1626. static void tegra194_cbb_stall_enable(struct tegra_cbb *cbb)
  1627. {
  1628. struct tegra194_cbb *priv = to_tegra194_cbb(cbb);
  1629. writel(1, priv->regs + ERRLOGGER_0_STALLEN_0);
  1630. writel(1, priv->regs + ERRLOGGER_1_STALLEN_0);
  1631. writel(1, priv->regs + ERRLOGGER_2_STALLEN_0);
  1632. }
  1633. static void tegra194_cbb_error_clear(struct tegra_cbb *cbb)
  1634. {
  1635. struct tegra194_cbb *priv = to_tegra194_cbb(cbb);
  1636. writel(1, priv->regs + ERRLOGGER_0_ERRCLR_0);
  1637. writel(1, priv->regs + ERRLOGGER_1_ERRCLR_0);
  1638. writel(1, priv->regs + ERRLOGGER_2_ERRCLR_0);
  1639. dsb(sy);
  1640. }
  1641. static u32 tegra194_cbb_get_status(struct tegra_cbb *cbb)
  1642. {
  1643. struct tegra194_cbb *priv = to_tegra194_cbb(cbb);
  1644. u32 value;
  1645. value = readl(priv->regs + ERRLOGGER_0_ERRVLD_0);
  1646. value |= (readl(priv->regs + ERRLOGGER_1_ERRVLD_0) << 1);
  1647. value |= (readl(priv->regs + ERRLOGGER_2_ERRVLD_0) << 2);
  1648. dsb(sy);
  1649. return value;
  1650. }
  1651. static u32 tegra194_axi2apb_status(void __iomem *addr)
  1652. {
  1653. u32 value;
  1654. value = readl(addr + DMAAPB_X_RAW_INTERRUPT_STATUS);
  1655. writel(0xffffffff, addr + DMAAPB_X_RAW_INTERRUPT_STATUS);
  1656. return value;
  1657. }
  1658. static bool tegra194_axi2apb_fatal(struct seq_file *file, unsigned int bridge, u32 status)
  1659. {
  1660. bool is_fatal = true;
  1661. size_t i;
  1662. for (i = 0; i < ARRAY_SIZE(tegra194_axi2apb_error); i++) {
  1663. if (status & BIT(i)) {
  1664. tegra_cbb_print_err(file, "\t AXI2APB_%d bridge error: %s\n",
  1665. bridge + 1, tegra194_axi2apb_error[i]);
  1666. if (strstr(tegra194_axi2apb_error[i], "Firewall"))
  1667. is_fatal = false;
  1668. }
  1669. }
  1670. return is_fatal;
  1671. }
  1672. /*
  1673. * Fetch InitlocalAddress from NOC Aperture lookup table
  1674. * using Targflow, Targsubrange
  1675. */
  1676. static u32 get_init_localaddress(const struct tegra194_cbb_aperture *info,
  1677. const struct tegra194_cbb_aperture *aper, unsigned int max)
  1678. {
  1679. unsigned int t_f = 0, t_sr = 0;
  1680. u32 addr = 0;
  1681. for (t_f = 0; t_f < max; t_f++) {
  1682. if (aper[t_f].targflow == info->targflow) {
  1683. t_sr = t_f;
  1684. do {
  1685. if (aper[t_sr].targ_subrange == info->targ_subrange) {
  1686. addr = aper[t_sr].init_localaddress;
  1687. return addr;
  1688. }
  1689. if (t_sr >= max)
  1690. return 0;
  1691. t_sr++;
  1692. } while (aper[t_sr].targflow == aper[t_sr - 1].targflow);
  1693. t_f = t_sr;
  1694. }
  1695. }
  1696. return addr;
  1697. }
  1698. static void print_errlog5(struct seq_file *file, struct tegra194_cbb *cbb)
  1699. {
  1700. struct tegra194_cbb_userbits userbits;
  1701. cbb->noc->parse_userbits(&userbits, cbb->errlog5);
  1702. if (!strcmp(cbb->noc->name, "cbb-noc")) {
  1703. tegra_cbb_print_err(file, "\t Non-Modify\t\t: %#x\n", userbits.non_mod);
  1704. tegra_cbb_print_err(file, "\t AXI ID\t\t: %#x\n", userbits.axi_id);
  1705. }
  1706. tegra_cbb_print_err(file, "\t Master ID\t\t: %s\n",
  1707. cbb->noc->master_id[userbits.mstr_id]);
  1708. tegra_cbb_print_err(file, "\t Security Group(GRPSEC): %#x\n", userbits.grpsec);
  1709. tegra_cbb_print_cache(file, userbits.axcache);
  1710. tegra_cbb_print_prot(file, userbits.axprot);
  1711. tegra_cbb_print_err(file, "\t FALCONSEC\t\t: %#x\n", userbits.falconsec);
  1712. tegra_cbb_print_err(file, "\t Virtual Queuing Channel(VQC): %#x\n", userbits.vqc);
  1713. }
  1714. /*
  1715. * Fetch Base Address/InitlocalAddress from NOC aperture lookup table using TargFlow &
  1716. * Targ_subRange extracted from RouteId. Perform address reconstruction as below:
  1717. *
  1718. * Address = Base Address + (ErrLog3 + ErrLog4)
  1719. */
  1720. static void
  1721. print_errlog3_4(struct seq_file *file, u32 errlog3, u32 errlog4,
  1722. const struct tegra194_cbb_aperture *info,
  1723. const struct tegra194_cbb_aperture *aperture, unsigned int max)
  1724. {
  1725. u64 addr = (u64)errlog4 << 32 | errlog3;
  1726. /*
  1727. * If errlog4[7] = "1", then it's a joker entry. Joker entries are a rare phenomenon and
  1728. * such addresses are not reliable. Debugging should be done using only the RouteId
  1729. * information.
  1730. */
  1731. if (errlog4 & 0x80)
  1732. tegra_cbb_print_err(file, "\t debug using RouteId alone as below address is a "
  1733. "joker entry and not reliable");
  1734. addr += get_init_localaddress(info, aperture, max);
  1735. tegra_cbb_print_err(file, "\t Address accessed\t: %#llx\n", addr);
  1736. }
  1737. /*
  1738. * Get RouteId from ErrLog1+ErrLog2 registers and fetch values of
  1739. * InitFlow, TargFlow, Targ_subRange and SeqId values from RouteId
  1740. */
  1741. static void
  1742. print_errlog1_2(struct seq_file *file, struct tegra194_cbb *cbb,
  1743. struct tegra194_cbb_aperture *info)
  1744. {
  1745. u64 routeid = (u64)cbb->errlog2 << 32 | cbb->errlog1;
  1746. u32 seqid = 0;
  1747. tegra_cbb_print_err(file, "\t RouteId\t\t: %#llx\n", routeid);
  1748. cbb->noc->parse_routeid(info, routeid);
  1749. tegra_cbb_print_err(file, "\t InitFlow\t\t: %s\n",
  1750. cbb->noc->routeid_initflow[info->initflow]);
  1751. tegra_cbb_print_err(file, "\t Targflow\t\t: %s\n",
  1752. cbb->noc->routeid_targflow[info->targflow]);
  1753. tegra_cbb_print_err(file, "\t TargSubRange\t\t: %d\n", info->targ_subrange);
  1754. tegra_cbb_print_err(file, "\t SeqId\t\t\t: %d\n", seqid);
  1755. }
  1756. /*
  1757. * Print transcation type, error code and description from ErrLog0 for all
  1758. * errors. For NOC slave errors, all relevant error info is printed using
  1759. * ErrLog0 only. But additional information is printed for errors from
  1760. * APB slaves because for them:
  1761. * - All errors are logged as SLV(slave) errors due to APB having only single
  1762. * bit pslverr to report all errors.
  1763. * - Exact cause is printed by reading DMAAPB_X_RAW_INTERRUPT_STATUS register.
  1764. * - The driver prints information showing AXI2APB bridge and exact error
  1765. * only if there is error in any AXI2APB slave.
  1766. * - There is still no way to disambiguate a DEC error from SLV error type.
  1767. */
  1768. static bool print_errlog0(struct seq_file *file, struct tegra194_cbb *cbb)
  1769. {
  1770. struct tegra194_cbb_packet_header hdr;
  1771. bool is_fatal = true;
  1772. hdr.lock = cbb->errlog0 & 0x1;
  1773. hdr.opc = FIELD_GET(CBB_ERR_OPC, cbb->errlog0);
  1774. hdr.errcode = FIELD_GET(CBB_ERR_ERRCODE, cbb->errlog0);
  1775. hdr.len1 = FIELD_GET(CBB_ERR_LEN1, cbb->errlog0);
  1776. hdr.format = (cbb->errlog0 >> 31);
  1777. tegra_cbb_print_err(file, "\t Transaction Type\t: %s\n",
  1778. tegra194_cbb_trantype[hdr.opc]);
  1779. tegra_cbb_print_err(file, "\t Error Code\t\t: %s\n",
  1780. tegra194_cbb_errors[hdr.errcode].code);
  1781. tegra_cbb_print_err(file, "\t Error Source\t\t: %s\n",
  1782. tegra194_cbb_errors[hdr.errcode].source);
  1783. tegra_cbb_print_err(file, "\t Error Description\t: %s\n",
  1784. tegra194_cbb_errors[hdr.errcode].desc);
  1785. /*
  1786. * Do not crash system for errors which are only notifications to indicate a transaction
  1787. * was not allowed to be attempted.
  1788. */
  1789. if (!strcmp(tegra194_cbb_errors[hdr.errcode].code, "SEC") ||
  1790. !strcmp(tegra194_cbb_errors[hdr.errcode].code, "DEC") ||
  1791. !strcmp(tegra194_cbb_errors[hdr.errcode].code, "UNS") ||
  1792. !strcmp(tegra194_cbb_errors[hdr.errcode].code, "DISC")) {
  1793. is_fatal = false;
  1794. } else if (!strcmp(tegra194_cbb_errors[hdr.errcode].code, "SLV") &&
  1795. cbb->num_bridges > 0) {
  1796. unsigned int i;
  1797. u32 status;
  1798. /* For all SLV errors, read DMAAPB_X_RAW_INTERRUPT_STATUS
  1799. * register to get error status for all AXI2APB bridges.
  1800. * Print bridge details if a bit is set in a bridge's
  1801. * status register due to error in a APB slave connected
  1802. * to that bridge. For other NOC slaves, none of the status
  1803. * register will be set.
  1804. */
  1805. for (i = 0; i < cbb->num_bridges; i++) {
  1806. status = tegra194_axi2apb_status(cbb->bridges[i].base);
  1807. if (status)
  1808. is_fatal = tegra194_axi2apb_fatal(file, i, status);
  1809. }
  1810. }
  1811. tegra_cbb_print_err(file, "\t Packet header Lock\t: %d\n", hdr.lock);
  1812. tegra_cbb_print_err(file, "\t Packet header Len1\t: %d\n", hdr.len1);
  1813. if (hdr.format)
  1814. tegra_cbb_print_err(file, "\t NOC protocol version\t: %s\n",
  1815. "version >= 2.7");
  1816. else
  1817. tegra_cbb_print_err(file, "\t NOC protocol version\t: %s\n",
  1818. "version < 2.7");
  1819. return is_fatal;
  1820. }
  1821. /*
  1822. * Print debug information about failed transaction using
  1823. * ErrLog registers of error loggger having ErrVld set
  1824. */
  1825. static bool print_errloggerX_info(struct seq_file *file, struct tegra194_cbb *cbb,
  1826. int errloggerX)
  1827. {
  1828. struct tegra194_cbb_aperture info = { 0, };
  1829. bool is_fatal = true;
  1830. tegra_cbb_print_err(file, "\tError Logger\t\t: %d\n", errloggerX);
  1831. if (errloggerX == 0) {
  1832. cbb->errlog0 = readl(cbb->regs + ERRLOGGER_0_ERRLOG0_0);
  1833. cbb->errlog1 = readl(cbb->regs + ERRLOGGER_0_ERRLOG1_0);
  1834. cbb->errlog2 = readl(cbb->regs + ERRLOGGER_0_RSVD_00_0);
  1835. cbb->errlog3 = readl(cbb->regs + ERRLOGGER_0_ERRLOG3_0);
  1836. cbb->errlog4 = readl(cbb->regs + ERRLOGGER_0_ERRLOG4_0);
  1837. cbb->errlog5 = readl(cbb->regs + ERRLOGGER_0_ERRLOG5_0);
  1838. } else if (errloggerX == 1) {
  1839. cbb->errlog0 = readl(cbb->regs + ERRLOGGER_1_ERRLOG0_0);
  1840. cbb->errlog1 = readl(cbb->regs + ERRLOGGER_1_ERRLOG1_0);
  1841. cbb->errlog2 = readl(cbb->regs + ERRLOGGER_1_RSVD_00_0);
  1842. cbb->errlog3 = readl(cbb->regs + ERRLOGGER_1_ERRLOG3_0);
  1843. cbb->errlog4 = readl(cbb->regs + ERRLOGGER_1_ERRLOG4_0);
  1844. cbb->errlog5 = readl(cbb->regs + ERRLOGGER_1_ERRLOG5_0);
  1845. } else if (errloggerX == 2) {
  1846. cbb->errlog0 = readl(cbb->regs + ERRLOGGER_2_ERRLOG0_0);
  1847. cbb->errlog1 = readl(cbb->regs + ERRLOGGER_2_ERRLOG1_0);
  1848. cbb->errlog2 = readl(cbb->regs + ERRLOGGER_2_RSVD_00_0);
  1849. cbb->errlog3 = readl(cbb->regs + ERRLOGGER_2_ERRLOG3_0);
  1850. cbb->errlog4 = readl(cbb->regs + ERRLOGGER_2_ERRLOG4_0);
  1851. cbb->errlog5 = readl(cbb->regs + ERRLOGGER_2_ERRLOG5_0);
  1852. }
  1853. tegra_cbb_print_err(file, "\tErrLog0\t\t\t: %#x\n", cbb->errlog0);
  1854. is_fatal = print_errlog0(file, cbb);
  1855. tegra_cbb_print_err(file, "\tErrLog1\t\t\t: %#x\n", cbb->errlog1);
  1856. tegra_cbb_print_err(file, "\tErrLog2\t\t\t: %#x\n", cbb->errlog2);
  1857. print_errlog1_2(file, cbb, &info);
  1858. tegra_cbb_print_err(file, "\tErrLog3\t\t\t: %#x\n", cbb->errlog3);
  1859. tegra_cbb_print_err(file, "\tErrLog4\t\t\t: %#x\n", cbb->errlog4);
  1860. print_errlog3_4(file, cbb->errlog3, cbb->errlog4, &info, cbb->noc->noc_aperture,
  1861. cbb->noc->max_aperture);
  1862. tegra_cbb_print_err(file, "\tErrLog5\t\t\t: %#x\n", cbb->errlog5);
  1863. if (cbb->errlog5)
  1864. print_errlog5(file, cbb);
  1865. return is_fatal;
  1866. }
  1867. static bool print_errlog(struct seq_file *file, struct tegra194_cbb *cbb, u32 errvld)
  1868. {
  1869. bool is_fatal = true;
  1870. pr_crit("**************************************\n");
  1871. pr_crit("CPU:%d, Error:%s\n", smp_processor_id(), cbb->noc->name);
  1872. if (errvld & 0x1)
  1873. is_fatal = print_errloggerX_info(file, cbb, 0);
  1874. else if (errvld & 0x2)
  1875. is_fatal = print_errloggerX_info(file, cbb, 1);
  1876. else if (errvld & 0x4)
  1877. is_fatal = print_errloggerX_info(file, cbb, 2);
  1878. tegra_cbb_error_clear(&cbb->base);
  1879. tegra_cbb_print_err(file, "\t**************************************\n");
  1880. return is_fatal;
  1881. }
  1882. #ifdef CONFIG_DEBUG_FS
  1883. static DEFINE_MUTEX(cbb_err_mutex);
  1884. static int tegra194_cbb_debugfs_show(struct tegra_cbb *cbb, struct seq_file *file, void *data)
  1885. {
  1886. struct tegra_cbb *noc;
  1887. mutex_lock(&cbb_err_mutex);
  1888. list_for_each_entry(noc, &cbb_list, node) {
  1889. struct tegra194_cbb *priv = to_tegra194_cbb(noc);
  1890. u32 status;
  1891. status = tegra_cbb_get_status(noc);
  1892. if (status)
  1893. print_errlog(file, priv, status);
  1894. }
  1895. mutex_unlock(&cbb_err_mutex);
  1896. return 0;
  1897. }
  1898. #endif
  1899. /*
  1900. * Handler for CBB errors from different initiators
  1901. */
  1902. static irqreturn_t tegra194_cbb_err_isr(int irq, void *data)
  1903. {
  1904. bool is_inband_err = false, is_fatal = false;
  1905. //struct tegra194_cbb *cbb = data;
  1906. struct tegra_cbb *noc;
  1907. unsigned long flags;
  1908. u8 mstr_id = 0;
  1909. spin_lock_irqsave(&cbb_lock, flags);
  1910. /* XXX only process interrupts for "cbb" instead of iterating over all NOCs? */
  1911. list_for_each_entry(noc, &cbb_list, node) {
  1912. struct tegra194_cbb *priv = to_tegra194_cbb(noc);
  1913. u32 status = 0;
  1914. status = tegra_cbb_get_status(noc);
  1915. if (status && ((irq == priv->sec_irq) || (irq == priv->nonsec_irq))) {
  1916. tegra_cbb_print_err(NULL, "CPU:%d, Error: %s@%llx, irq=%d\n",
  1917. smp_processor_id(), priv->noc->name, priv->res->start,
  1918. irq);
  1919. is_fatal = print_errlog(NULL, priv, status);
  1920. /*
  1921. * If illegal request is from CCPLEX(0x1) initiator
  1922. * and error is fatal then call BUG() to crash system.
  1923. */
  1924. if (priv->noc->erd_mask_inband_err) {
  1925. mstr_id = FIELD_GET(CBB_NOC_MSTR_ID, priv->errlog5);
  1926. if (mstr_id == 0x1)
  1927. is_inband_err = 1;
  1928. }
  1929. }
  1930. }
  1931. spin_unlock_irqrestore(&cbb_lock, flags);
  1932. if (is_inband_err) {
  1933. if (is_fatal)
  1934. BUG();
  1935. else
  1936. WARN(true, "Warning due to CBB Error\n");
  1937. }
  1938. return IRQ_HANDLED;
  1939. }
  1940. /*
  1941. * Register handler for CBB_NONSECURE & CBB_SECURE interrupts
  1942. * for reporting CBB errors
  1943. */
  1944. static int tegra194_cbb_interrupt_enable(struct tegra_cbb *cbb)
  1945. {
  1946. struct tegra194_cbb *priv = to_tegra194_cbb(cbb);
  1947. struct device *dev = cbb->dev;
  1948. int err;
  1949. if (priv->sec_irq) {
  1950. err = devm_request_irq(dev, priv->sec_irq, tegra194_cbb_err_isr, 0, dev_name(dev),
  1951. priv);
  1952. if (err) {
  1953. dev_err(dev, "failed to register interrupt %u: %d\n", priv->sec_irq, err);
  1954. return err;
  1955. }
  1956. }
  1957. if (priv->nonsec_irq) {
  1958. err = devm_request_irq(dev, priv->nonsec_irq, tegra194_cbb_err_isr, 0,
  1959. dev_name(dev), priv);
  1960. if (err) {
  1961. dev_err(dev, "failed to register interrupt %u: %d\n", priv->nonsec_irq,
  1962. err);
  1963. return err;
  1964. }
  1965. }
  1966. return 0;
  1967. }
  1968. static void tegra194_cbb_error_enable(struct tegra_cbb *cbb)
  1969. {
  1970. /*
  1971. * Set “StallEn=1” to enable queuing of error packets till
  1972. * first is served & cleared
  1973. */
  1974. tegra_cbb_stall_enable(cbb);
  1975. /* set “FaultEn=1” to enable error reporting signal “Fault” */
  1976. tegra_cbb_fault_enable(cbb);
  1977. }
  1978. static const struct tegra_cbb_ops tegra194_cbb_ops = {
  1979. .get_status = tegra194_cbb_get_status,
  1980. .error_clear = tegra194_cbb_error_clear,
  1981. .fault_enable = tegra194_cbb_fault_enable,
  1982. .stall_enable = tegra194_cbb_stall_enable,
  1983. .error_enable = tegra194_cbb_error_enable,
  1984. .interrupt_enable = tegra194_cbb_interrupt_enable,
  1985. #ifdef CONFIG_DEBUG_FS
  1986. .debugfs_show = tegra194_cbb_debugfs_show,
  1987. #endif
  1988. };
  1989. static struct tegra194_cbb_noc_data tegra194_cbb_central_noc_data = {
  1990. .name = "cbb-noc",
  1991. .erd_mask_inband_err = true,
  1992. .master_id = tegra194_master_id,
  1993. .noc_aperture = tegra194_cbbcentralnoc_apert_lookup,
  1994. .max_aperture = ARRAY_SIZE(tegra194_cbbcentralnoc_apert_lookup),
  1995. .routeid_initflow = tegra194_cbbcentralnoc_routeid_initflow,
  1996. .routeid_targflow = tegra194_cbbcentralnoc_routeid_targflow,
  1997. .parse_routeid = cbbcentralnoc_parse_routeid,
  1998. .parse_userbits = cbbcentralnoc_parse_userbits
  1999. };
  2000. static struct tegra194_cbb_noc_data tegra194_aon_noc_data = {
  2001. .name = "aon-noc",
  2002. .erd_mask_inband_err = false,
  2003. .master_id = tegra194_master_id,
  2004. .noc_aperture = tegra194_aonnoc_aperture_lookup,
  2005. .max_aperture = ARRAY_SIZE(tegra194_aonnoc_aperture_lookup),
  2006. .routeid_initflow = tegra194_aonnoc_routeid_initflow,
  2007. .routeid_targflow = tegra194_aonnoc_routeid_targflow,
  2008. .parse_routeid = aonnoc_parse_routeid,
  2009. .parse_userbits = clusternoc_parse_userbits
  2010. };
  2011. static struct tegra194_cbb_noc_data tegra194_bpmp_noc_data = {
  2012. .name = "bpmp-noc",
  2013. .erd_mask_inband_err = false,
  2014. .master_id = tegra194_master_id,
  2015. .noc_aperture = tegra194_bpmpnoc_apert_lookup,
  2016. .max_aperture = ARRAY_SIZE(tegra194_bpmpnoc_apert_lookup),
  2017. .routeid_initflow = tegra194_bpmpnoc_routeid_initflow,
  2018. .routeid_targflow = tegra194_bpmpnoc_routeid_targflow,
  2019. .parse_routeid = bpmpnoc_parse_routeid,
  2020. .parse_userbits = clusternoc_parse_userbits
  2021. };
  2022. static struct tegra194_cbb_noc_data tegra194_rce_noc_data = {
  2023. .name = "rce-noc",
  2024. .erd_mask_inband_err = false,
  2025. .master_id = tegra194_master_id,
  2026. .noc_aperture = tegra194_scenoc_apert_lookup,
  2027. .max_aperture = ARRAY_SIZE(tegra194_scenoc_apert_lookup),
  2028. .routeid_initflow = tegra194_scenoc_routeid_initflow,
  2029. .routeid_targflow = tegra194_scenoc_routeid_targflow,
  2030. .parse_routeid = scenoc_parse_routeid,
  2031. .parse_userbits = clusternoc_parse_userbits
  2032. };
  2033. static struct tegra194_cbb_noc_data tegra194_sce_noc_data = {
  2034. .name = "sce-noc",
  2035. .erd_mask_inband_err = false,
  2036. .master_id = tegra194_master_id,
  2037. .noc_aperture = tegra194_scenoc_apert_lookup,
  2038. .max_aperture = ARRAY_SIZE(tegra194_scenoc_apert_lookup),
  2039. .routeid_initflow = tegra194_scenoc_routeid_initflow,
  2040. .routeid_targflow = tegra194_scenoc_routeid_targflow,
  2041. .parse_routeid = scenoc_parse_routeid,
  2042. .parse_userbits = clusternoc_parse_userbits
  2043. };
  2044. static const struct of_device_id tegra194_cbb_match[] = {
  2045. { .compatible = "nvidia,tegra194-cbb-noc", .data = &tegra194_cbb_central_noc_data },
  2046. { .compatible = "nvidia,tegra194-aon-noc", .data = &tegra194_aon_noc_data },
  2047. { .compatible = "nvidia,tegra194-bpmp-noc", .data = &tegra194_bpmp_noc_data },
  2048. { .compatible = "nvidia,tegra194-rce-noc", .data = &tegra194_rce_noc_data },
  2049. { .compatible = "nvidia,tegra194-sce-noc", .data = &tegra194_sce_noc_data },
  2050. { /* sentinel */ }
  2051. };
  2052. MODULE_DEVICE_TABLE(of, tegra194_cbb_match);
  2053. static int tegra194_cbb_get_bridges(struct tegra194_cbb *cbb, struct device_node *np)
  2054. {
  2055. struct tegra_cbb *entry;
  2056. unsigned long flags;
  2057. unsigned int i;
  2058. int err;
  2059. spin_lock_irqsave(&cbb_lock, flags);
  2060. list_for_each_entry(entry, &cbb_list, node) {
  2061. struct tegra194_cbb *priv = to_tegra194_cbb(entry);
  2062. if (priv->bridges) {
  2063. cbb->num_bridges = priv->num_bridges;
  2064. cbb->bridges = priv->bridges;
  2065. break;
  2066. }
  2067. }
  2068. spin_unlock_irqrestore(&cbb_lock, flags);
  2069. if (!cbb->bridges) {
  2070. cbb->num_bridges = of_address_count(np);
  2071. cbb->bridges = devm_kcalloc(cbb->base.dev, cbb->num_bridges,
  2072. sizeof(*cbb->bridges), GFP_KERNEL);
  2073. if (!cbb->bridges)
  2074. return -ENOMEM;
  2075. for (i = 0; i < cbb->num_bridges; i++) {
  2076. err = of_address_to_resource(np, i, &cbb->bridges[i].res);
  2077. if (err < 0)
  2078. return err;
  2079. cbb->bridges[i].base = devm_ioremap_resource(cbb->base.dev,
  2080. &cbb->bridges[i].res);
  2081. if (IS_ERR(cbb->bridges[i].base))
  2082. return PTR_ERR(cbb->bridges[i].base);
  2083. }
  2084. }
  2085. if (cbb->num_bridges > 0) {
  2086. dev_dbg(cbb->base.dev, "AXI2APB bridge info present:\n");
  2087. for (i = 0; i < cbb->num_bridges; i++)
  2088. dev_dbg(cbb->base.dev, " %u: %pR\n", i, &cbb->bridges[i].res);
  2089. }
  2090. return 0;
  2091. }
  2092. static int tegra194_cbb_probe(struct platform_device *pdev)
  2093. {
  2094. const struct tegra194_cbb_noc_data *noc;
  2095. struct tegra194_cbb *cbb;
  2096. struct device_node *np;
  2097. unsigned long flags;
  2098. int err;
  2099. noc = of_device_get_match_data(&pdev->dev);
  2100. if (noc->erd_mask_inband_err) {
  2101. /*
  2102. * Set Error Response Disable(ERD) bit to mask SError/inband
  2103. * error and only trigger interrupts for illegal access from
  2104. * CCPLEX initiator.
  2105. */
  2106. err = tegra194_miscreg_mask_serror();
  2107. if (err) {
  2108. dev_err(&pdev->dev, "couldn't mask inband errors\n");
  2109. return err;
  2110. }
  2111. }
  2112. cbb = devm_kzalloc(&pdev->dev, sizeof(*cbb), GFP_KERNEL);
  2113. if (!cbb)
  2114. return -ENOMEM;
  2115. INIT_LIST_HEAD(&cbb->base.node);
  2116. cbb->base.ops = &tegra194_cbb_ops;
  2117. cbb->base.dev = &pdev->dev;
  2118. cbb->noc = noc;
  2119. cbb->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &cbb->res);
  2120. if (IS_ERR(cbb->regs))
  2121. return PTR_ERR(cbb->regs);
  2122. err = tegra_cbb_get_irq(pdev, &cbb->nonsec_irq, &cbb->sec_irq);
  2123. if (err)
  2124. return err;
  2125. np = of_parse_phandle(pdev->dev.of_node, "nvidia,axi2apb", 0);
  2126. if (np) {
  2127. err = tegra194_cbb_get_bridges(cbb, np);
  2128. of_node_put(np);
  2129. if (err < 0)
  2130. return err;
  2131. }
  2132. platform_set_drvdata(pdev, cbb);
  2133. spin_lock_irqsave(&cbb_lock, flags);
  2134. list_add(&cbb->base.node, &cbb_list);
  2135. spin_unlock_irqrestore(&cbb_lock, flags);
  2136. return tegra_cbb_register(&cbb->base);
  2137. }
  2138. static void tegra194_cbb_remove(struct platform_device *pdev)
  2139. {
  2140. struct tegra194_cbb *cbb = platform_get_drvdata(pdev);
  2141. struct tegra_cbb *noc, *tmp;
  2142. unsigned long flags;
  2143. spin_lock_irqsave(&cbb_lock, flags);
  2144. list_for_each_entry_safe(noc, tmp, &cbb_list, node) {
  2145. struct tegra194_cbb *priv = to_tegra194_cbb(noc);
  2146. if (cbb->res->start == priv->res->start) {
  2147. list_del(&noc->node);
  2148. break;
  2149. }
  2150. }
  2151. spin_unlock_irqrestore(&cbb_lock, flags);
  2152. }
  2153. static int __maybe_unused tegra194_cbb_resume_noirq(struct device *dev)
  2154. {
  2155. struct tegra194_cbb *cbb = dev_get_drvdata(dev);
  2156. tegra194_cbb_error_enable(&cbb->base);
  2157. dsb(sy);
  2158. dev_dbg(dev, "%s resumed\n", cbb->noc->name);
  2159. return 0;
  2160. }
  2161. static const struct dev_pm_ops tegra194_cbb_pm = {
  2162. SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(NULL, tegra194_cbb_resume_noirq)
  2163. };
  2164. static struct platform_driver tegra194_cbb_driver = {
  2165. .probe = tegra194_cbb_probe,
  2166. .remove_new = tegra194_cbb_remove,
  2167. .driver = {
  2168. .name = "tegra194-cbb",
  2169. .of_match_table = of_match_ptr(tegra194_cbb_match),
  2170. .pm = &tegra194_cbb_pm,
  2171. },
  2172. };
  2173. static int __init tegra194_cbb_init(void)
  2174. {
  2175. return platform_driver_register(&tegra194_cbb_driver);
  2176. }
  2177. pure_initcall(tegra194_cbb_init);
  2178. static void __exit tegra194_cbb_exit(void)
  2179. {
  2180. platform_driver_unregister(&tegra194_cbb_driver);
  2181. }
  2182. module_exit(tegra194_cbb_exit);
  2183. MODULE_AUTHOR("Sumit Gupta <sumitg@nvidia.com>");
  2184. MODULE_DESCRIPTION("Control Backbone error handling driver for Tegra194");