blob: ea2f51c984f1fb14ec04e77e8c14d4372ebf4898 [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 Menonc98aa7a2014-04-11 12:24:56 -050032#define L3_TARG_STDERRLOG_MSTADDR 0x50
sricharaned0e3522011-08-24 20:07:45 +053033#define L3_TARG_STDERRLOG_SLVOFSLSB 0x5c
Nishanth Menonc98aa7a2014-04-11 12:24:56 -050034#define L3_TARG_STDERRLOG_CINFO_MSTADDR 0x68
sricharaned0e3522011-08-24 20:07:45 +053035#define L3_FLAGMUX_REGERR0 0xc
Rajendra Nayak3340d732014-04-10 11:31:33 -050036#define L3_FLAGMUX_MASK0 0x8
37
38#define L3_TARGET_NOT_SUPPORTED NULL
39
Nishanth Menonf0a6e652014-04-11 10:11:59 -050040/**
41 * struct l3_masters_data - L3 Master information
42 * @id: ID of the L3 Master
43 * @name: master name
44 */
45struct l3_masters_data {
46 u32 id;
47 char *name;
48};
49
Nishanth Menon3ae9af72014-04-11 11:38:10 -050050/**
51 * struct l3_target_data - L3 Target information
52 * @offset: Offset from base for L3 Target
53 * @name: Target name
54 *
55 * Target information is organized indexed by bit field definitions.
56 */
57struct l3_target_data {
58 u32 offset;
59 char *name;
60};
61
Nishanth Menon97708c02014-04-14 09:57:50 -050062/**
63 * struct l3_flagmux_data - Flag Mux information
64 * @offset: offset from base for flagmux register
65 * @l3_targ: array indexed by flagmux index (bit offset) pointing to the
66 * target data. unsupported ones are marked with
67 * L3_TARGET_NOT_SUPPORTED
68 * @num_targ_data: number of entries in target data
69 */
70struct l3_flagmux_data {
71 u32 offset;
72 struct l3_target_data *l3_targ;
73 u8 num_targ_data;
74};
75
Sricharan R06594522013-11-26 07:38:23 -060076
77/**
78 * struct omap_l3 - Description of data relevant for L3 bus.
79 * @dev: device representing the bus (populated runtime)
80 * @l3_base: base addresses of modules (populated runtime)
Nishanth Menon97708c02014-04-14 09:57:50 -050081 * @l3_flag_mux: array containing flag mux data per module
Sricharan R06594522013-11-26 07:38:23 -060082 * offset from corresponding module base indexed per
83 * module.
84 * @num_modules: number of clock domains / modules.
85 * @l3_masters: array pointing to master data containing name and register
86 * offset for the master.
87 * @num_master: number of masters
Nishanth Menond4d88192014-04-16 11:01:02 -050088 * @mst_addr_mask: Mask representing MSTADDR information of NTTP packet
Sricharan R06594522013-11-26 07:38:23 -060089 * @debug_irq: irq number of the debug interrupt (populated runtime)
90 * @app_irq: irq number of the application interrupt (populated runtime)
91 */
92struct omap_l3 {
93 struct device *dev;
94
95 void __iomem *l3_base[MAX_L3_MODULES];
Nishanth Menon97708c02014-04-14 09:57:50 -050096 struct l3_flagmux_data **l3_flagmux;
Sricharan R06594522013-11-26 07:38:23 -060097 int num_modules;
98
99 struct l3_masters_data *l3_masters;
100 int num_masters;
Nishanth Menond4d88192014-04-16 11:01:02 -0500101 u32 mst_addr_mask;
Sricharan R06594522013-11-26 07:38:23 -0600102
Sricharan R06594522013-11-26 07:38:23 -0600103 int debug_irq;
104 int app_irq;
105};
106
Nishanth Menon97708c02014-04-14 09:57:50 -0500107static struct l3_target_data omap_l3_target_data_clk1[] = {
Nishanth Menon3ae9af72014-04-11 11:38:10 -0500108 {0x100, "DMM1",},
109 {0x200, "DMM2",},
110 {0x300, "ABE",},
111 {0x400, "L4CFG",},
112 {0x600, "CLK2PWRDISC",},
113 {0x0, "HOSTCLK1",},
114 {0x900, "L4WAKEUP",},
Santosh Shilimkar2722e562011-03-07 20:53:10 +0530115};
116
Nishanth Menon97708c02014-04-14 09:57:50 -0500117static struct l3_flagmux_data omap_l3_flagmux_clk1 = {
118 .offset = 0x500,
119 .l3_targ = omap_l3_target_data_clk1,
120 .num_targ_data = ARRAY_SIZE(omap_l3_target_data_clk1),
121};
122
123
124static struct l3_target_data omap_l3_target_data_clk2[] = {
Nishanth Menon3ae9af72014-04-11 11:38:10 -0500125 {0x500, "CORTEXM3",},
126 {0x300, "DSS",},
127 {0x100, "GPMC",},
128 {0x400, "ISS",},
129 {0x700, "IVAHD",},
130 {0xD00, "AES1",},
131 {0x900, "L4PER0",},
132 {0x200, "OCMRAM",},
133 {0x100, "GPMCsERROR",},
134 {0x600, "SGX",},
135 {0x800, "SL2",},
136 {0x1600, "C2C",},
137 {0x1100, "PWRDISCCLK1",},
138 {0xF00, "SHA1",},
139 {0xE00, "AES2",},
140 {0xC00, "L4PER3",},
141 {0xA00, "L4PER1",},
142 {0xB00, "L4PER2",},
143 {0x0, "HOSTCLK2",},
144 {0x1800, "CAL",},
145 {0x1700, "LLI",},
Santosh Shilimkar2722e562011-03-07 20:53:10 +0530146};
147
Nishanth Menon97708c02014-04-14 09:57:50 -0500148static struct l3_flagmux_data omap_l3_flagmux_clk2 = {
149 .offset = 0x1000,
150 .l3_targ = omap_l3_target_data_clk2,
151 .num_targ_data = ARRAY_SIZE(omap_l3_target_data_clk2),
152};
153
154
155static struct l3_target_data omap_l3_target_data_clk3[] = {
Nishanth Menon3ae9af72014-04-11 11:38:10 -0500156 {0x0100, "EMUSS",},
157 {0x0300, "DEBUG SOURCE",},
158 {0x0, "HOST CLK3",},
Santosh Shilimkar2722e562011-03-07 20:53:10 +0530159};
160
Nishanth Menon97708c02014-04-14 09:57:50 -0500161static struct l3_flagmux_data omap_l3_flagmux_clk3 = {
162 .offset = 0x0200,
163 .l3_targ = omap_l3_target_data_clk3,
164 .num_targ_data = ARRAY_SIZE(omap_l3_target_data_clk3),
165};
166
Sricharan R06594522013-11-26 07:38:23 -0600167static struct l3_masters_data omap_l3_masters[] = {
sricharan551a9fa2011-09-07 17:25:16 +0530168 { 0x0 , "MPU"},
169 { 0x10, "CS_ADP"},
170 { 0x14, "xxx"},
171 { 0x20, "DSP"},
172 { 0x30, "IVAHD"},
173 { 0x40, "ISS"},
174 { 0x44, "DucatiM3"},
175 { 0x48, "FaceDetect"},
176 { 0x50, "SDMA_Rd"},
177 { 0x54, "SDMA_Wr"},
178 { 0x58, "xxx"},
179 { 0x5C, "xxx"},
180 { 0x60, "SGX"},
181 { 0x70, "DSS"},
182 { 0x80, "C2C"},
183 { 0x88, "xxx"},
184 { 0x8C, "xxx"},
185 { 0x90, "HSI"},
186 { 0xA0, "MMC1"},
187 { 0xA4, "MMC2"},
188 { 0xA8, "MMC6"},
189 { 0xB0, "UNIPRO1"},
190 { 0xC0, "USBHOSTHS"},
191 { 0xC4, "USBOTGHS"},
192 { 0xC8, "USBHOSTFS"}
193};
194
Nishanth Menon97708c02014-04-14 09:57:50 -0500195static struct l3_flagmux_data *omap_l3_flagmux[] = {
196 &omap_l3_flagmux_clk1,
197 &omap_l3_flagmux_clk2,
198 &omap_l3_flagmux_clk3,
Santosh Shilimkar2722e562011-03-07 20:53:10 +0530199};
200
Sricharan R06594522013-11-26 07:38:23 -0600201static const struct omap_l3 omap_l3_data = {
202 .l3_flagmux = omap_l3_flagmux,
Nishanth Menon97708c02014-04-14 09:57:50 -0500203 .num_modules = ARRAY_SIZE(omap_l3_flagmux),
Sricharan R06594522013-11-26 07:38:23 -0600204 .l3_masters = omap_l3_masters,
205 .num_masters = ARRAY_SIZE(omap_l3_masters),
Nishanth Menond4d88192014-04-16 11:01:02 -0500206 /* The 6 MSBs of register field used to distinguish initiator */
207 .mst_addr_mask = 0xFC,
Santosh Shilimkar2722e562011-03-07 20:53:10 +0530208};
Sricharan Rc10d5c92014-04-11 13:09:36 -0500209
210#endif /* __OMAP_L3_NOC_H */