1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * OMAP L3 Interconnect error handling driver header
5 * Copyright (C) 2011-2015 Texas Instruments Incorporated - http://www.ti.com/
6 * Santosh Shilimkar <santosh.shilimkar@ti.com>
7 * sricharan <r.sricharan@ti.com>
9 #ifndef __OMAP_L3_NOC_H
10 #define __OMAP_L3_NOC_H
12 #define MAX_L3_MODULES 3
13 #define MAX_CLKDM_TARGETS 31
15 #define CLEAR_STDERR_LOG (1 << 31)
16 #define CUSTOM_ERROR 0x2
17 #define STANDARD_ERROR 0x0
18 #define INBAND_ERROR 0x0
19 #define L3_APPLICATION_ERROR 0x0
20 #define L3_DEBUG_ERROR 0x1
22 /* L3 TARG register offsets */
23 #define L3_TARG_STDERRLOG_MAIN 0x48
24 #define L3_TARG_STDERRLOG_HDR 0x4c
25 #define L3_TARG_STDERRLOG_MSTADDR 0x50
26 #define L3_TARG_STDERRLOG_INFO 0x58
27 #define L3_TARG_STDERRLOG_SLVOFSLSB 0x5c
28 #define L3_TARG_STDERRLOG_CINFO_INFO 0x64
29 #define L3_TARG_STDERRLOG_CINFO_MSTADDR 0x68
30 #define L3_TARG_STDERRLOG_CINFO_OPCODE 0x6c
31 #define L3_FLAGMUX_REGERR0 0xc
32 #define L3_FLAGMUX_MASK0 0x8
34 #define L3_TARGET_NOT_SUPPORTED NULL
36 #define L3_BASE_IS_SUBMODULE ((void __iomem *)(1 << 0))
38 static const char * const l3_transaction_type[] = {
43 /* 1 0 0 */ "Read Link",
44 /* 1 0 1 */ "Write Non-Posted",
45 /* 1 1 0 */ "Write Conditional",
46 /* 1 1 1 */ "Write Broadcast",
50 * struct l3_masters_data - L3 Master information
51 * @id: ID of the L3 Master
54 struct l3_masters_data {
60 * struct l3_target_data - L3 Target information
61 * @offset: Offset from base for L3 Target
64 * Target information is organized indexed by bit field definitions.
66 struct l3_target_data {
72 * struct l3_flagmux_data - Flag Mux information
73 * @offset: offset from base for flagmux register
74 * @l3_targ: array indexed by flagmux index (bit offset) pointing to the
75 * target data. unsupported ones are marked with
76 * L3_TARGET_NOT_SUPPORTED
77 * @num_targ_data: number of entries in target data
78 * @mask_app_bits: ignore these from raw application irq status
79 * @mask_dbg_bits: ignore these from raw debug irq status
81 struct l3_flagmux_data {
83 struct l3_target_data *l3_targ;
91 * struct omap_l3 - Description of data relevant for L3 bus.
92 * @dev: device representing the bus (populated runtime)
93 * @l3_base: base addresses of modules (populated runtime if 0)
94 * if set to L3_BASE_IS_SUBMODULE, then uses previous
95 * module index as the base address
96 * @l3_flag_mux: array containing flag mux data per module
97 * offset from corresponding module base indexed per
99 * @num_modules: number of clock domains / modules.
100 * @l3_masters: array pointing to master data containing name and register
101 * offset for the master.
102 * @num_master: number of masters
103 * @mst_addr_mask: Mask representing MSTADDR information of NTTP packet
104 * @debug_irq: irq number of the debug interrupt (populated runtime)
105 * @app_irq: irq number of the application interrupt (populated runtime)
110 void __iomem *l3_base[MAX_L3_MODULES];
111 struct l3_flagmux_data **l3_flagmux;
114 struct l3_masters_data *l3_masters;
122 static struct l3_target_data omap_l3_target_data_clk1[] = {
127 {0x600, "CLK2PWRDISC",},
129 {0x900, "L4WAKEUP",},
132 static struct l3_flagmux_data omap_l3_flagmux_clk1 = {
134 .l3_targ = omap_l3_target_data_clk1,
135 .num_targ_data = ARRAY_SIZE(omap_l3_target_data_clk1),
139 static struct l3_target_data omap_l3_target_data_clk2[] = {
140 {0x500, "CORTEXM3",},
148 {0x100, "GPMCsERROR",},
152 {0x1100, "PWRDISCCLK1",},
163 static struct l3_flagmux_data omap_l3_flagmux_clk2 = {
165 .l3_targ = omap_l3_target_data_clk2,
166 .num_targ_data = ARRAY_SIZE(omap_l3_target_data_clk2),
170 static struct l3_target_data omap4_l3_target_data_clk3[] = {
171 {0x0100, "DEBUGSS",},
174 static struct l3_flagmux_data omap4_l3_flagmux_clk3 = {
176 .l3_targ = omap4_l3_target_data_clk3,
177 .num_targ_data = ARRAY_SIZE(omap4_l3_target_data_clk3),
180 static struct l3_masters_data omap_l3_masters[] = {
188 { 0x12, "FaceDetect"},
203 { 0x30, "USBHOSTHS"},
208 static struct l3_flagmux_data *omap4_l3_flagmux[] = {
209 &omap_l3_flagmux_clk1,
210 &omap_l3_flagmux_clk2,
211 &omap4_l3_flagmux_clk3,
214 static const struct omap_l3 omap4_l3_data = {
215 .l3_flagmux = omap4_l3_flagmux,
216 .num_modules = ARRAY_SIZE(omap4_l3_flagmux),
217 .l3_masters = omap_l3_masters,
218 .num_masters = ARRAY_SIZE(omap_l3_masters),
219 /* The 6 MSBs of register field used to distinguish initiator */
220 .mst_addr_mask = 0xFC,
224 static struct l3_target_data omap5_l3_target_data_clk3[] = {
225 {0x0100, "L3INSTR",},
226 {0x0300, "DEBUGSS",},
230 static struct l3_flagmux_data omap5_l3_flagmux_clk3 = {
232 .l3_targ = omap5_l3_target_data_clk3,
233 .num_targ_data = ARRAY_SIZE(omap5_l3_target_data_clk3),
236 static struct l3_flagmux_data *omap5_l3_flagmux[] = {
237 &omap_l3_flagmux_clk1,
238 &omap_l3_flagmux_clk2,
239 &omap5_l3_flagmux_clk3,
242 static const struct omap_l3 omap5_l3_data = {
243 .l3_flagmux = omap5_l3_flagmux,
244 .num_modules = ARRAY_SIZE(omap5_l3_flagmux),
245 .l3_masters = omap_l3_masters,
246 .num_masters = ARRAY_SIZE(omap_l3_masters),
247 /* The 6 MSBs of register field used to distinguish initiator */
248 .mst_addr_mask = 0x7E0,
252 static struct l3_target_data dra_l3_target_data_clk1[] = {
255 {0x0600, "DSP2_SDMA",},
259 {0x0300, "DSP1_SDMA",},
266 {0x1600, "IVA_CONFIG",},
267 {0x1800, "IVA_SL2IF",},
269 {0x1d00, "L4_WKUP",},
275 {0x2000, "TPCC_EDMA",},
276 {0x2e00, "TPTC1_EDMA",},
277 {0x2b00, "TPTC2_EDMA",},
279 {0x2500, "L4_PER2_P3",},
280 {0x0e00, "L4_PER3_P3",},
287 static struct l3_flagmux_data dra_l3_flagmux_clk1 = {
289 .l3_targ = dra_l3_target_data_clk1,
290 .num_targ_data = ARRAY_SIZE(dra_l3_target_data_clk1),
293 static struct l3_target_data dra_l3_target_data_clk2[] = {
295 {0x800000, "HOST CLK2",},
296 {0xdead, L3_TARGET_NOT_SUPPORTED,},
299 {0xdead, L3_TARGET_NOT_SUPPORTED,},
300 {0x2100, "L4_PER1_P3",},
301 {0x1c00, "L4_PER1_P1",},
302 {0x1f00, "L4_PER1_P2",},
303 {0x2300, "L4_PER2_P1",},
304 {0x2400, "L4_PER2_P2",},
305 {0x2600, "L4_PER3_P1",},
306 {0x2700, "L4_PER3_P2",},
311 {0x0f00, "OCMC_RAM1",},
312 {0x1700, "OCMC_RAM2",},
313 {0x1900, "OCMC_RAM3",},
314 {0x1e00, "OCMC_ROM",},
318 static struct l3_flagmux_data dra_l3_flagmux_clk2 = {
320 .l3_targ = dra_l3_target_data_clk2,
321 .num_targ_data = ARRAY_SIZE(dra_l3_target_data_clk2),
324 static struct l3_target_data dra_l3_target_data_clk3[] = {
325 {0x0100, "L3_INSTR"},
326 {0x0300, "DEBUGSS_CT_TBR"},
330 static struct l3_flagmux_data dra_l3_flagmux_clk3 = {
332 .l3_targ = dra_l3_target_data_clk3,
333 .num_targ_data = ARRAY_SIZE(dra_l3_target_data_clk3),
336 static struct l3_masters_data dra_l3_masters[] = {
339 { 0x5, "IEEE1500_2_OCP" },
340 { 0x8, "DSP1_MDMA" },
343 { 0xB, "DSP2_MDMA" },
351 { 0x14, "PRUSS1 PRU1" },
352 { 0x15, "PRUSS1 PRU2" },
353 { 0x16, "PRUSS2 PRU1" },
354 { 0x17, "PRUSS2 PRU2" },
359 { 0x1C, "TC1_EDMA" },
360 { 0x1D, "TC2_EDMA" },
375 { 0x2E, "USB2_ULPI_SS1" },
376 { 0x2F, "USB2_ULPI_SS2" },
386 static struct l3_flagmux_data *dra_l3_flagmux[] = {
387 &dra_l3_flagmux_clk1,
388 &dra_l3_flagmux_clk2,
389 &dra_l3_flagmux_clk3,
392 static const struct omap_l3 dra_l3_data = {
393 .l3_base = { [1] = L3_BASE_IS_SUBMODULE },
394 .l3_flagmux = dra_l3_flagmux,
395 .num_modules = ARRAY_SIZE(dra_l3_flagmux),
396 .l3_masters = dra_l3_masters,
397 .num_masters = ARRAY_SIZE(dra_l3_masters),
398 /* The 6 MSBs of register field used to distinguish initiator */
399 .mst_addr_mask = 0xFC,
403 static struct l3_target_data am4372_l3_target_data_200f[] = {
412 {0xdead, L3_TARGET_NOT_SUPPORTED,},
417 {0x300, "MPUSS_L2_RAM",},
421 static struct l3_flagmux_data am4372_l3_flagmux_200f = {
423 .l3_targ = am4372_l3_target_data_200f,
424 .num_targ_data = ARRAY_SIZE(am4372_l3_target_data_200f),
427 static struct l3_target_data am4372_l3_target_data_100s[] = {
428 {0x100, "L4_PER_0",},
429 {0x200, "L4_PER_1",},
430 {0x300, "L4_PER_2",},
431 {0x400, "L4_PER_3",},
437 {0xdead, L3_TARGET_NOT_SUPPORTED,},
440 {0xA00, "MAG_CARD",},
443 static struct l3_flagmux_data am4372_l3_flagmux_100s = {
445 .l3_targ = am4372_l3_target_data_100s,
446 .num_targ_data = ARRAY_SIZE(am4372_l3_target_data_100s),
449 static struct l3_masters_data am4372_l3_masters[] = {
450 { 0x0, "M1 (128-bit)"},
451 { 0x1, "M2 (64-bit)"},
456 { 0x14, "Wakeup Processor"},
457 { 0x18, "TPTC0 Read"},
458 { 0x19, "TPTC0 Write"},
459 { 0x1A, "TPTC1 Read"},
460 { 0x1B, "TPTC1 Write"},
461 { 0x1C, "TPTC2 Read"},
462 { 0x1D, "TPTC2 Write"},
464 { 0x21, "OCP WP Traffic Probe"},
465 { 0x22, "OCP WP DMA Profiling"},
466 { 0x23, "OCP WP Event Trace"},
468 { 0x28, "Crypto DMA RD"},
469 { 0x29, "Crypto DMA WR"},
479 static struct l3_flagmux_data *am4372_l3_flagmux[] = {
480 &am4372_l3_flagmux_200f,
481 &am4372_l3_flagmux_100s,
484 static const struct omap_l3 am4372_l3_data = {
485 .l3_flagmux = am4372_l3_flagmux,
486 .num_modules = ARRAY_SIZE(am4372_l3_flagmux),
487 .l3_masters = am4372_l3_masters,
488 .num_masters = ARRAY_SIZE(am4372_l3_masters),
489 /* All 6 bits of register field used to distinguish initiator */
490 .mst_addr_mask = 0x3F,
493 #endif /* __OMAP_L3_NOC_H */