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