bus: omap_l3_noc: convert target information into a structure
[cascardo/linux.git] / drivers / bus / omap_l3_noc.h
1 /*
2  * OMAP L3 Interconnect  error handling driver header
3  *
4  * Copyright (C) 2011-2014 Texas Instruments Incorporated - http://www.ti.com/
5  *      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
9  * it under the terms of the GNU General Public License version 2 as
10  * published by the Free Software Foundation.
11  *
12  * 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
15  * GNU General Public License for more details.
16  */
17 #ifndef __OMAP_L3_NOC_H
18 #define __OMAP_L3_NOC_H
19
20 #define L3_MODULES                      3
21 #define CLEAR_STDERR_LOG                (1 << 31)
22 #define CUSTOM_ERROR                    0x2
23 #define STANDARD_ERROR                  0x0
24 #define INBAND_ERROR                    0x0
25 #define L3_APPLICATION_ERROR            0x0
26 #define L3_DEBUG_ERROR                  0x1
27
28 /* L3 TARG register offsets */
29 #define L3_TARG_STDERRLOG_MAIN          0x48
30 #define L3_TARG_STDERRLOG_SLVOFSLSB     0x5c
31 #define L3_TARG_STDERRLOG_MSTADDR       0x68
32 #define L3_FLAGMUX_REGERR0              0xc
33
34 #define NUM_OF_L3_MASTERS       (sizeof(l3_masters)/sizeof(l3_masters[0]))
35
36 /**
37  * struct l3_masters_data - L3 Master information
38  * @id:         ID of the L3 Master
39  * @name:       master name
40  */
41 struct l3_masters_data {
42         u32 id;
43         char *name;
44 };
45
46 /**
47  * struct l3_target_data - L3 Target information
48  * @offset:     Offset from base for L3 Target
49  * @name:       Target name
50  *
51  * Target information is organized indexed by bit field definitions.
52  */
53 struct l3_target_data {
54         u32 offset;
55         char *name;
56 };
57
58 static u32 l3_flagmux[L3_MODULES] = {
59         0x500,
60         0x1000,
61         0X0200
62 };
63
64 static struct l3_target_data l3_target_inst_data_clk1[] = {
65         {0x100, "DMM1",},
66         {0x200, "DMM2",},
67         {0x300, "ABE",},
68         {0x400, "L4CFG",},
69         {0x600, "CLK2PWRDISC",},
70         {0x0,   "HOSTCLK1",},
71         {0x900, "L4WAKEUP",},
72 };
73
74 static struct l3_target_data l3_target_inst_data_clk2[] = {
75         {0x500, "CORTEXM3",},
76         {0x300, "DSS",},
77         {0x100, "GPMC",},
78         {0x400, "ISS",},
79         {0x700, "IVAHD",},
80         {0xD00, "AES1",},
81         {0x900, "L4PER0",},
82         {0x200, "OCMRAM",},
83         {0x100, "GPMCsERROR",},
84         {0x600, "SGX",},
85         {0x800, "SL2",},
86         {0x1600, "C2C",},
87         {0x1100, "PWRDISCCLK1",},
88         {0xF00, "SHA1",},
89         {0xE00, "AES2",},
90         {0xC00, "L4PER3",},
91         {0xA00, "L4PER1",},
92         {0xB00, "L4PER2",},
93         {0x0,   "HOSTCLK2",},
94         {0x1800, "CAL",},
95         {0x1700, "LLI",},
96 };
97
98 static struct l3_target_data l3_target_inst_data_clk3[] = {
99         {0x0100, "EMUSS",},
100         {0x0300, "DEBUG SOURCE",},
101         {0x0,   "HOST CLK3",},
102 };
103
104 static struct l3_masters_data l3_masters[] = {
105         { 0x0 , "MPU"},
106         { 0x10, "CS_ADP"},
107         { 0x14, "xxx"},
108         { 0x20, "DSP"},
109         { 0x30, "IVAHD"},
110         { 0x40, "ISS"},
111         { 0x44, "DucatiM3"},
112         { 0x48, "FaceDetect"},
113         { 0x50, "SDMA_Rd"},
114         { 0x54, "SDMA_Wr"},
115         { 0x58, "xxx"},
116         { 0x5C, "xxx"},
117         { 0x60, "SGX"},
118         { 0x70, "DSS"},
119         { 0x80, "C2C"},
120         { 0x88, "xxx"},
121         { 0x8C, "xxx"},
122         { 0x90, "HSI"},
123         { 0xA0, "MMC1"},
124         { 0xA4, "MMC2"},
125         { 0xA8, "MMC6"},
126         { 0xB0, "UNIPRO1"},
127         { 0xC0, "USBHOSTHS"},
128         { 0xC4, "USBOTGHS"},
129         { 0xC8, "USBHOSTFS"}
130 };
131
132 static struct l3_target_data *l3_targ[L3_MODULES] = {
133         l3_target_inst_data_clk1,
134         l3_target_inst_data_clk2,
135         l3_target_inst_data_clk3,
136 };
137
138 struct omap_l3 {
139         struct device *dev;
140
141         /* memory base */
142         void __iomem *l3_base[L3_MODULES];
143
144         int debug_irq;
145         int app_irq;
146 };
147
148 #endif  /* __OMAP_L3_NOC_H */