blob: aced4c546783f22cf8150e026eca5a94ff386e9d [file] [log] [blame]
sricharaned0e3522011-08-24 20:07:45 +05301/*
Sricharan Rc10d5c92014-04-11 13:09:36 -05002 * OMAP L3 Interconnect error handling driver header
sricharaned0e3522011-08-24 20:07:45 +05303 *
Nishanth Menonc5f2aea2014-04-11 13:15:43 -05004 * Copyright (C) 2011-2014 Texas Instruments Incorporated - http://www.ti.com/
sricharaned0e3522011-08-24 20:07:45 +05305 * Santosh Shilimkar <santosh.shilimkar@ti.com>
6 * sricharan <r.sricharan@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
Nishanth Menonc5f2aea2014-04-11 13:15:43 -05009 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
sricharaned0e3522011-08-24 20:07:45 +053011 *
Nishanth Menonc5f2aea2014-04-11 13:15:43 -050012 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
13 * kind, whether express or implied; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
sricharaned0e3522011-08-24 20:07:45 +053015 * GNU General Public License for more details.
sricharaned0e3522011-08-24 20:07:45 +053016 */
Sricharan Rc10d5c92014-04-11 13:09:36 -050017#ifndef __OMAP_L3_NOC_H
18#define __OMAP_L3_NOC_H
Santosh Shilimkar2722e562011-03-07 20:53:10 +053019
Sricharan R06594522013-11-26 07:38:23 -060020#define MAX_L3_MODULES 3
Nishanth Menon97708c02014-04-14 09:57:50 -050021#define MAX_CLKDM_TARGETS 31
Sricharan R06594522013-11-26 07:38:23 -060022
Santosh Shilimkar2722e562011-03-07 20:53:10 +053023#define CLEAR_STDERR_LOG (1 << 31)
24#define CUSTOM_ERROR 0x2
25#define STANDARD_ERROR 0x0
26#define INBAND_ERROR 0x0
Santosh Shilimkar2722e562011-03-07 20:53:10 +053027#define L3_APPLICATION_ERROR 0x0
28#define L3_DEBUG_ERROR 0x1
29
Todd Poynor342fd142011-08-24 19:11:39 +053030/* L3 TARG register offsets */
sricharaned0e3522011-08-24 20:07:45 +053031#define L3_TARG_STDERRLOG_MAIN 0x48
Nishanth Menon7f9de022014-04-16 15:47:28 -050032#define L3_TARG_STDERRLOG_HDR 0x4c
Nishanth Menonc98aa7a2014-04-11 12:24:56 -050033#define L3_TARG_STDERRLOG_MSTADDR 0x50
Nishanth Menoncf52b2e2014-04-16 17:23:33 -050034#define L3_TARG_STDERRLOG_INFO 0x58
sricharaned0e3522011-08-24 20:07:45 +053035#define L3_TARG_STDERRLOG_SLVOFSLSB 0x5c
Nishanth Menoncf52b2e2014-04-16 17:23:33 -050036#define L3_TARG_STDERRLOG_CINFO_INFO 0x64
Nishanth Menonc98aa7a2014-04-11 12:24:56 -050037#define L3_TARG_STDERRLOG_CINFO_MSTADDR 0x68
Nishanth Menon7f9de022014-04-16 15:47:28 -050038#define L3_TARG_STDERRLOG_CINFO_OPCODE 0x6c
sricharaned0e3522011-08-24 20:07:45 +053039#define L3_FLAGMUX_REGERR0 0xc
Rajendra Nayak3340d732014-04-10 11:31:33 -050040#define L3_FLAGMUX_MASK0 0x8
41
42#define L3_TARGET_NOT_SUPPORTED NULL
43
Nishanth Menonf33ddf72014-04-11 14:37:03 -050044#define L3_BASE_IS_SUBMODULE ((void __iomem *)(1 << 0))
45
Nishanth Menon7f9de022014-04-16 15:47:28 -050046static const char * const l3_transaction_type[] = {
47 /* 0 0 0 */ "Idle",
48 /* 0 0 1 */ "Write",
49 /* 0 1 0 */ "Read",
50 /* 0 1 1 */ "ReadEx",
51 /* 1 0 0 */ "Read Link",
52 /* 1 0 1 */ "Write Non-Posted",
53 /* 1 1 0 */ "Write Conditional",
54 /* 1 1 1 */ "Write Broadcast",
55};
56
Nishanth Menonf0a6e652014-04-11 10:11:59 -050057/**
58 * struct l3_masters_data - L3 Master information
59 * @id: ID of the L3 Master
60 * @name: master name
61 */
62struct l3_masters_data {
63 u32 id;
64 char *name;
65};
66
Nishanth Menon3ae9af72014-04-11 11:38:10 -050067/**
68 * struct l3_target_data - L3 Target information
69 * @offset: Offset from base for L3 Target
70 * @name: Target name
71 *
72 * Target information is organized indexed by bit field definitions.
73 */
74struct l3_target_data {
75 u32 offset;
76 char *name;
77};
78
Nishanth Menon97708c02014-04-14 09:57:50 -050079/**
80 * struct l3_flagmux_data - Flag Mux information
81 * @offset: offset from base for flagmux register
82 * @l3_targ: array indexed by flagmux index (bit offset) pointing to the
83 * target data. unsupported ones are marked with
84 * L3_TARGET_NOT_SUPPORTED
85 * @num_targ_data: number of entries in target data
Afzal Mohammed2100b592014-04-25 17:38:11 -050086 * @mask_app_bits: ignore these from raw application irq status
87 * @mask_dbg_bits: ignore these from raw debug irq status
Nishanth Menon97708c02014-04-14 09:57:50 -050088 */
89struct l3_flagmux_data {
90 u32 offset;
91 struct l3_target_data *l3_targ;
92 u8 num_targ_data;
Afzal Mohammed2100b592014-04-25 17:38:11 -050093 u32 mask_app_bits;
94 u32 mask_dbg_bits;
Nishanth Menon97708c02014-04-14 09:57:50 -050095};
96
Sricharan R06594522013-11-26 07:38:23 -060097
98/**
99 * struct omap_l3 - Description of data relevant for L3 bus.
100 * @dev: device representing the bus (populated runtime)
Nishanth Menonf33ddf72014-04-11 14:37:03 -0500101 * @l3_base: base addresses of modules (populated runtime if 0)
102 * if set to L3_BASE_IS_SUBMODULE, then uses previous
103 * module index as the base address
Nishanth Menon97708c02014-04-14 09:57:50 -0500104 * @l3_flag_mux: array containing flag mux data per module
Sricharan R06594522013-11-26 07:38:23 -0600105 * offset from corresponding module base indexed per
106 * module.
107 * @num_modules: number of clock domains / modules.
108 * @l3_masters: array pointing to master data containing name and register
109 * offset for the master.
110 * @num_master: number of masters
Nishanth Menond4d88192014-04-16 11:01:02 -0500111 * @mst_addr_mask: Mask representing MSTADDR information of NTTP packet
Sricharan R06594522013-11-26 07:38:23 -0600112 * @debug_irq: irq number of the debug interrupt (populated runtime)
113 * @app_irq: irq number of the application interrupt (populated runtime)
114 */
115struct omap_l3 {
116 struct device *dev;
117
118 void __iomem *l3_base[MAX_L3_MODULES];
Nishanth Menon97708c02014-04-14 09:57:50 -0500119 struct l3_flagmux_data **l3_flagmux;
Sricharan R06594522013-11-26 07:38:23 -0600120 int num_modules;
121
122 struct l3_masters_data *l3_masters;
123 int num_masters;
Nishanth Menond4d88192014-04-16 11:01:02 -0500124 u32 mst_addr_mask;
Sricharan R06594522013-11-26 07:38:23 -0600125
Sricharan R06594522013-11-26 07:38:23 -0600126 int debug_irq;
127 int app_irq;
128};
129
Nishanth Menon97708c02014-04-14 09:57:50 -0500130static struct l3_target_data omap_l3_target_data_clk1[] = {
Nishanth Menon3ae9af72014-04-11 11:38:10 -0500131 {0x100, "DMM1",},
132 {0x200, "DMM2",},
133 {0x300, "ABE",},
134 {0x400, "L4CFG",},
135 {0x600, "CLK2PWRDISC",},
136 {0x0, "HOSTCLK1",},
137 {0x900, "L4WAKEUP",},
Santosh Shilimkar2722e562011-03-07 20:53:10 +0530138};
139
Nishanth Menon97708c02014-04-14 09:57:50 -0500140static struct l3_flagmux_data omap_l3_flagmux_clk1 = {
141 .offset = 0x500,
142 .l3_targ = omap_l3_target_data_clk1,
143 .num_targ_data = ARRAY_SIZE(omap_l3_target_data_clk1),
144};
145
146
147static struct l3_target_data omap_l3_target_data_clk2[] = {
Nishanth Menon3ae9af72014-04-11 11:38:10 -0500148 {0x500, "CORTEXM3",},
149 {0x300, "DSS",},
150 {0x100, "GPMC",},
151 {0x400, "ISS",},
152 {0x700, "IVAHD",},
153 {0xD00, "AES1",},
154 {0x900, "L4PER0",},
155 {0x200, "OCMRAM",},
156 {0x100, "GPMCsERROR",},
157 {0x600, "SGX",},
158 {0x800, "SL2",},
159 {0x1600, "C2C",},
160 {0x1100, "PWRDISCCLK1",},
161 {0xF00, "SHA1",},
162 {0xE00, "AES2",},
163 {0xC00, "L4PER3",},
164 {0xA00, "L4PER1",},
165 {0xB00, "L4PER2",},
166 {0x0, "HOSTCLK2",},
167 {0x1800, "CAL",},
168 {0x1700, "LLI",},
Santosh Shilimkar2722e562011-03-07 20:53:10 +0530169};
170
Nishanth Menon97708c02014-04-14 09:57:50 -0500171static struct l3_flagmux_data omap_l3_flagmux_clk2 = {
172 .offset = 0x1000,
173 .l3_targ = omap_l3_target_data_clk2,
174 .num_targ_data = ARRAY_SIZE(omap_l3_target_data_clk2),
175};
176
177
178static struct l3_target_data omap_l3_target_data_clk3[] = {
Nishanth Menon3ae9af72014-04-11 11:38:10 -0500179 {0x0100, "EMUSS",},
180 {0x0300, "DEBUG SOURCE",},
181 {0x0, "HOST CLK3",},
Santosh Shilimkar2722e562011-03-07 20:53:10 +0530182};
183
Nishanth Menon97708c02014-04-14 09:57:50 -0500184static struct l3_flagmux_data omap_l3_flagmux_clk3 = {
185 .offset = 0x0200,
186 .l3_targ = omap_l3_target_data_clk3,
187 .num_targ_data = ARRAY_SIZE(omap_l3_target_data_clk3),
188};
189
Sricharan R06594522013-11-26 07:38:23 -0600190static struct l3_masters_data omap_l3_masters[] = {
sricharan551a9fa2011-09-07 17:25:16 +0530191 { 0x0 , "MPU"},
192 { 0x10, "CS_ADP"},
193 { 0x14, "xxx"},
194 { 0x20, "DSP"},
195 { 0x30, "IVAHD"},
196 { 0x40, "ISS"},
197 { 0x44, "DucatiM3"},
198 { 0x48, "FaceDetect"},
199 { 0x50, "SDMA_Rd"},
200 { 0x54, "SDMA_Wr"},
201 { 0x58, "xxx"},
202 { 0x5C, "xxx"},
203 { 0x60, "SGX"},
204 { 0x70, "DSS"},
205 { 0x80, "C2C"},
206 { 0x88, "xxx"},
207 { 0x8C, "xxx"},
208 { 0x90, "HSI"},
209 { 0xA0, "MMC1"},
210 { 0xA4, "MMC2"},
211 { 0xA8, "MMC6"},
212 { 0xB0, "UNIPRO1"},
213 { 0xC0, "USBHOSTHS"},
214 { 0xC4, "USBOTGHS"},
215 { 0xC8, "USBHOSTFS"}
216};
217
Nishanth Menon97708c02014-04-14 09:57:50 -0500218static struct l3_flagmux_data *omap_l3_flagmux[] = {
219 &omap_l3_flagmux_clk1,
220 &omap_l3_flagmux_clk2,
221 &omap_l3_flagmux_clk3,
Santosh Shilimkar2722e562011-03-07 20:53:10 +0530222};
223
Sricharan R06594522013-11-26 07:38:23 -0600224static const struct omap_l3 omap_l3_data = {
225 .l3_flagmux = omap_l3_flagmux,
Nishanth Menon97708c02014-04-14 09:57:50 -0500226 .num_modules = ARRAY_SIZE(omap_l3_flagmux),
Sricharan R06594522013-11-26 07:38:23 -0600227 .l3_masters = omap_l3_masters,
228 .num_masters = ARRAY_SIZE(omap_l3_masters),
Nishanth Menond4d88192014-04-16 11:01:02 -0500229 /* The 6 MSBs of register field used to distinguish initiator */
230 .mst_addr_mask = 0xFC,
Santosh Shilimkar2722e562011-03-07 20:53:10 +0530231};
Sricharan Rc10d5c92014-04-11 13:09:36 -0500232
233#endif /* __OMAP_L3_NOC_H */