blob: 64869fe656e5465e0ef65c170f263c7050296a91 [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
32#define L3_TARG_STDERRLOG_SLVOFSLSB 0x5c
sricharan551a9fa2011-09-07 17:25:16 +053033#define L3_TARG_STDERRLOG_MSTADDR 0x68
sricharaned0e3522011-08-24 20:07:45 +053034#define L3_FLAGMUX_REGERR0 0xc
Rajendra Nayak3340d732014-04-10 11:31:33 -050035#define L3_FLAGMUX_MASK0 0x8
36
37#define L3_TARGET_NOT_SUPPORTED NULL
38
Nishanth Menonf0a6e652014-04-11 10:11:59 -050039/**
40 * struct l3_masters_data - L3 Master information
41 * @id: ID of the L3 Master
42 * @name: master name
43 */
44struct l3_masters_data {
45 u32 id;
46 char *name;
47};
48
Nishanth Menon3ae9af72014-04-11 11:38:10 -050049/**
50 * struct l3_target_data - L3 Target information
51 * @offset: Offset from base for L3 Target
52 * @name: Target name
53 *
54 * Target information is organized indexed by bit field definitions.
55 */
56struct l3_target_data {
57 u32 offset;
58 char *name;
59};
60
Nishanth Menon97708c02014-04-14 09:57:50 -050061/**
62 * struct l3_flagmux_data - Flag Mux information
63 * @offset: offset from base for flagmux register
64 * @l3_targ: array indexed by flagmux index (bit offset) pointing to the
65 * target data. unsupported ones are marked with
66 * L3_TARGET_NOT_SUPPORTED
67 * @num_targ_data: number of entries in target data
68 */
69struct l3_flagmux_data {
70 u32 offset;
71 struct l3_target_data *l3_targ;
72 u8 num_targ_data;
73};
74
Sricharan R06594522013-11-26 07:38:23 -060075
76/**
77 * struct omap_l3 - Description of data relevant for L3 bus.
78 * @dev: device representing the bus (populated runtime)
79 * @l3_base: base addresses of modules (populated runtime)
Nishanth Menon97708c02014-04-14 09:57:50 -050080 * @l3_flag_mux: array containing flag mux data per module
Sricharan R06594522013-11-26 07:38:23 -060081 * offset from corresponding module base indexed per
82 * module.
83 * @num_modules: number of clock domains / modules.
84 * @l3_masters: array pointing to master data containing name and register
85 * offset for the master.
86 * @num_master: number of masters
Sricharan R06594522013-11-26 07:38:23 -060087 * @debug_irq: irq number of the debug interrupt (populated runtime)
88 * @app_irq: irq number of the application interrupt (populated runtime)
89 */
90struct omap_l3 {
91 struct device *dev;
92
93 void __iomem *l3_base[MAX_L3_MODULES];
Nishanth Menon97708c02014-04-14 09:57:50 -050094 struct l3_flagmux_data **l3_flagmux;
Sricharan R06594522013-11-26 07:38:23 -060095 int num_modules;
96
97 struct l3_masters_data *l3_masters;
98 int num_masters;
99
Sricharan R06594522013-11-26 07:38:23 -0600100 int debug_irq;
101 int app_irq;
102};
103
Nishanth Menon97708c02014-04-14 09:57:50 -0500104static struct l3_target_data omap_l3_target_data_clk1[] = {
Nishanth Menon3ae9af72014-04-11 11:38:10 -0500105 {0x100, "DMM1",},
106 {0x200, "DMM2",},
107 {0x300, "ABE",},
108 {0x400, "L4CFG",},
109 {0x600, "CLK2PWRDISC",},
110 {0x0, "HOSTCLK1",},
111 {0x900, "L4WAKEUP",},
Santosh Shilimkar2722e562011-03-07 20:53:10 +0530112};
113
Nishanth Menon97708c02014-04-14 09:57:50 -0500114static struct l3_flagmux_data omap_l3_flagmux_clk1 = {
115 .offset = 0x500,
116 .l3_targ = omap_l3_target_data_clk1,
117 .num_targ_data = ARRAY_SIZE(omap_l3_target_data_clk1),
118};
119
120
121static struct l3_target_data omap_l3_target_data_clk2[] = {
Nishanth Menon3ae9af72014-04-11 11:38:10 -0500122 {0x500, "CORTEXM3",},
123 {0x300, "DSS",},
124 {0x100, "GPMC",},
125 {0x400, "ISS",},
126 {0x700, "IVAHD",},
127 {0xD00, "AES1",},
128 {0x900, "L4PER0",},
129 {0x200, "OCMRAM",},
130 {0x100, "GPMCsERROR",},
131 {0x600, "SGX",},
132 {0x800, "SL2",},
133 {0x1600, "C2C",},
134 {0x1100, "PWRDISCCLK1",},
135 {0xF00, "SHA1",},
136 {0xE00, "AES2",},
137 {0xC00, "L4PER3",},
138 {0xA00, "L4PER1",},
139 {0xB00, "L4PER2",},
140 {0x0, "HOSTCLK2",},
141 {0x1800, "CAL",},
142 {0x1700, "LLI",},
Santosh Shilimkar2722e562011-03-07 20:53:10 +0530143};
144
Nishanth Menon97708c02014-04-14 09:57:50 -0500145static struct l3_flagmux_data omap_l3_flagmux_clk2 = {
146 .offset = 0x1000,
147 .l3_targ = omap_l3_target_data_clk2,
148 .num_targ_data = ARRAY_SIZE(omap_l3_target_data_clk2),
149};
150
151
152static struct l3_target_data omap_l3_target_data_clk3[] = {
Nishanth Menon3ae9af72014-04-11 11:38:10 -0500153 {0x0100, "EMUSS",},
154 {0x0300, "DEBUG SOURCE",},
155 {0x0, "HOST CLK3",},
Santosh Shilimkar2722e562011-03-07 20:53:10 +0530156};
157
Nishanth Menon97708c02014-04-14 09:57:50 -0500158static struct l3_flagmux_data omap_l3_flagmux_clk3 = {
159 .offset = 0x0200,
160 .l3_targ = omap_l3_target_data_clk3,
161 .num_targ_data = ARRAY_SIZE(omap_l3_target_data_clk3),
162};
163
Sricharan R06594522013-11-26 07:38:23 -0600164static struct l3_masters_data omap_l3_masters[] = {
sricharan551a9fa2011-09-07 17:25:16 +0530165 { 0x0 , "MPU"},
166 { 0x10, "CS_ADP"},
167 { 0x14, "xxx"},
168 { 0x20, "DSP"},
169 { 0x30, "IVAHD"},
170 { 0x40, "ISS"},
171 { 0x44, "DucatiM3"},
172 { 0x48, "FaceDetect"},
173 { 0x50, "SDMA_Rd"},
174 { 0x54, "SDMA_Wr"},
175 { 0x58, "xxx"},
176 { 0x5C, "xxx"},
177 { 0x60, "SGX"},
178 { 0x70, "DSS"},
179 { 0x80, "C2C"},
180 { 0x88, "xxx"},
181 { 0x8C, "xxx"},
182 { 0x90, "HSI"},
183 { 0xA0, "MMC1"},
184 { 0xA4, "MMC2"},
185 { 0xA8, "MMC6"},
186 { 0xB0, "UNIPRO1"},
187 { 0xC0, "USBHOSTHS"},
188 { 0xC4, "USBOTGHS"},
189 { 0xC8, "USBHOSTFS"}
190};
191
Nishanth Menon97708c02014-04-14 09:57:50 -0500192static struct l3_flagmux_data *omap_l3_flagmux[] = {
193 &omap_l3_flagmux_clk1,
194 &omap_l3_flagmux_clk2,
195 &omap_l3_flagmux_clk3,
Santosh Shilimkar2722e562011-03-07 20:53:10 +0530196};
197
Sricharan R06594522013-11-26 07:38:23 -0600198static const struct omap_l3 omap_l3_data = {
199 .l3_flagmux = omap_l3_flagmux,
Nishanth Menon97708c02014-04-14 09:57:50 -0500200 .num_modules = ARRAY_SIZE(omap_l3_flagmux),
Sricharan R06594522013-11-26 07:38:23 -0600201 .l3_masters = omap_l3_masters,
202 .num_masters = ARRAY_SIZE(omap_l3_masters),
Santosh Shilimkar2722e562011-03-07 20:53:10 +0530203};
Sricharan Rc10d5c92014-04-11 13:09:36 -0500204
205#endif /* __OMAP_L3_NOC_H */