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