sricharan | ed0e352 | 2011-08-24 20:07:45 +0530 | [diff] [blame] | 1 | /* |
Sricharan R | c10d5c9 | 2014-04-11 13:09:36 -0500 | [diff] [blame] | 2 | * OMAP L3 Interconnect error handling driver header |
sricharan | ed0e352 | 2011-08-24 20:07:45 +0530 | [diff] [blame] | 3 | * |
Nishanth Menon | c5f2aea | 2014-04-11 13:15:43 -0500 | [diff] [blame] | 4 | * Copyright (C) 2011-2014 Texas Instruments Incorporated - http://www.ti.com/ |
sricharan | ed0e352 | 2011-08-24 20:07:45 +0530 | [diff] [blame] | 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 |
Nishanth Menon | c5f2aea | 2014-04-11 13:15:43 -0500 | [diff] [blame] | 9 | * it under the terms of the GNU General Public License version 2 as |
| 10 | * published by the Free Software Foundation. |
sricharan | ed0e352 | 2011-08-24 20:07:45 +0530 | [diff] [blame] | 11 | * |
Nishanth Menon | c5f2aea | 2014-04-11 13:15:43 -0500 | [diff] [blame] | 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 |
sricharan | ed0e352 | 2011-08-24 20:07:45 +0530 | [diff] [blame] | 15 | * GNU General Public License for more details. |
sricharan | ed0e352 | 2011-08-24 20:07:45 +0530 | [diff] [blame] | 16 | */ |
Sricharan R | c10d5c9 | 2014-04-11 13:09:36 -0500 | [diff] [blame] | 17 | #ifndef __OMAP_L3_NOC_H |
| 18 | #define __OMAP_L3_NOC_H |
Santosh Shilimkar | 2722e56 | 2011-03-07 20:53:10 +0530 | [diff] [blame] | 19 | |
Sricharan R | 0659452 | 2013-11-26 07:38:23 -0600 | [diff] [blame] | 20 | #define MAX_L3_MODULES 3 |
Nishanth Menon | 97708c0 | 2014-04-14 09:57:50 -0500 | [diff] [blame] | 21 | #define MAX_CLKDM_TARGETS 31 |
Sricharan R | 0659452 | 2013-11-26 07:38:23 -0600 | [diff] [blame] | 22 | |
Santosh Shilimkar | 2722e56 | 2011-03-07 20:53:10 +0530 | [diff] [blame] | 23 | #define CLEAR_STDERR_LOG (1 << 31) |
| 24 | #define CUSTOM_ERROR 0x2 |
| 25 | #define STANDARD_ERROR 0x0 |
| 26 | #define INBAND_ERROR 0x0 |
Santosh Shilimkar | 2722e56 | 2011-03-07 20:53:10 +0530 | [diff] [blame] | 27 | #define L3_APPLICATION_ERROR 0x0 |
| 28 | #define L3_DEBUG_ERROR 0x1 |
| 29 | |
Todd Poynor | 342fd14 | 2011-08-24 19:11:39 +0530 | [diff] [blame] | 30 | /* L3 TARG register offsets */ |
sricharan | ed0e352 | 2011-08-24 20:07:45 +0530 | [diff] [blame] | 31 | #define L3_TARG_STDERRLOG_MAIN 0x48 |
Nishanth Menon | 7f9de02 | 2014-04-16 15:47:28 -0500 | [diff] [blame^] | 32 | #define L3_TARG_STDERRLOG_HDR 0x4c |
Nishanth Menon | c98aa7a | 2014-04-11 12:24:56 -0500 | [diff] [blame] | 33 | #define L3_TARG_STDERRLOG_MSTADDR 0x50 |
sricharan | ed0e352 | 2011-08-24 20:07:45 +0530 | [diff] [blame] | 34 | #define L3_TARG_STDERRLOG_SLVOFSLSB 0x5c |
Nishanth Menon | c98aa7a | 2014-04-11 12:24:56 -0500 | [diff] [blame] | 35 | #define L3_TARG_STDERRLOG_CINFO_MSTADDR 0x68 |
Nishanth Menon | 7f9de02 | 2014-04-16 15:47:28 -0500 | [diff] [blame^] | 36 | #define L3_TARG_STDERRLOG_CINFO_OPCODE 0x6c |
sricharan | ed0e352 | 2011-08-24 20:07:45 +0530 | [diff] [blame] | 37 | #define L3_FLAGMUX_REGERR0 0xc |
Rajendra Nayak | 3340d73 | 2014-04-10 11:31:33 -0500 | [diff] [blame] | 38 | #define L3_FLAGMUX_MASK0 0x8 |
| 39 | |
| 40 | #define L3_TARGET_NOT_SUPPORTED NULL |
| 41 | |
Nishanth Menon | 7f9de02 | 2014-04-16 15:47:28 -0500 | [diff] [blame^] | 42 | static const char * const l3_transaction_type[] = { |
| 43 | /* 0 0 0 */ "Idle", |
| 44 | /* 0 0 1 */ "Write", |
| 45 | /* 0 1 0 */ "Read", |
| 46 | /* 0 1 1 */ "ReadEx", |
| 47 | /* 1 0 0 */ "Read Link", |
| 48 | /* 1 0 1 */ "Write Non-Posted", |
| 49 | /* 1 1 0 */ "Write Conditional", |
| 50 | /* 1 1 1 */ "Write Broadcast", |
| 51 | }; |
| 52 | |
Nishanth Menon | f0a6e65 | 2014-04-11 10:11:59 -0500 | [diff] [blame] | 53 | /** |
| 54 | * struct l3_masters_data - L3 Master information |
| 55 | * @id: ID of the L3 Master |
| 56 | * @name: master name |
| 57 | */ |
| 58 | struct l3_masters_data { |
| 59 | u32 id; |
| 60 | char *name; |
| 61 | }; |
| 62 | |
Nishanth Menon | 3ae9af7 | 2014-04-11 11:38:10 -0500 | [diff] [blame] | 63 | /** |
| 64 | * struct l3_target_data - L3 Target information |
| 65 | * @offset: Offset from base for L3 Target |
| 66 | * @name: Target name |
| 67 | * |
| 68 | * Target information is organized indexed by bit field definitions. |
| 69 | */ |
| 70 | struct l3_target_data { |
| 71 | u32 offset; |
| 72 | char *name; |
| 73 | }; |
| 74 | |
Nishanth Menon | 97708c0 | 2014-04-14 09:57:50 -0500 | [diff] [blame] | 75 | /** |
| 76 | * struct l3_flagmux_data - Flag Mux information |
| 77 | * @offset: offset from base for flagmux register |
| 78 | * @l3_targ: array indexed by flagmux index (bit offset) pointing to the |
| 79 | * target data. unsupported ones are marked with |
| 80 | * L3_TARGET_NOT_SUPPORTED |
| 81 | * @num_targ_data: number of entries in target data |
Afzal Mohammed | 2100b59 | 2014-04-25 17:38:11 -0500 | [diff] [blame] | 82 | * @mask_app_bits: ignore these from raw application irq status |
| 83 | * @mask_dbg_bits: ignore these from raw debug irq status |
Nishanth Menon | 97708c0 | 2014-04-14 09:57:50 -0500 | [diff] [blame] | 84 | */ |
| 85 | struct l3_flagmux_data { |
| 86 | u32 offset; |
| 87 | struct l3_target_data *l3_targ; |
| 88 | u8 num_targ_data; |
Afzal Mohammed | 2100b59 | 2014-04-25 17:38:11 -0500 | [diff] [blame] | 89 | u32 mask_app_bits; |
| 90 | u32 mask_dbg_bits; |
Nishanth Menon | 97708c0 | 2014-04-14 09:57:50 -0500 | [diff] [blame] | 91 | }; |
| 92 | |
Sricharan R | 0659452 | 2013-11-26 07:38:23 -0600 | [diff] [blame] | 93 | |
| 94 | /** |
| 95 | * struct omap_l3 - Description of data relevant for L3 bus. |
| 96 | * @dev: device representing the bus (populated runtime) |
| 97 | * @l3_base: base addresses of modules (populated runtime) |
Nishanth Menon | 97708c0 | 2014-04-14 09:57:50 -0500 | [diff] [blame] | 98 | * @l3_flag_mux: array containing flag mux data per module |
Sricharan R | 0659452 | 2013-11-26 07:38:23 -0600 | [diff] [blame] | 99 | * offset from corresponding module base indexed per |
| 100 | * module. |
| 101 | * @num_modules: number of clock domains / modules. |
| 102 | * @l3_masters: array pointing to master data containing name and register |
| 103 | * offset for the master. |
| 104 | * @num_master: number of masters |
Nishanth Menon | d4d8819 | 2014-04-16 11:01:02 -0500 | [diff] [blame] | 105 | * @mst_addr_mask: Mask representing MSTADDR information of NTTP packet |
Sricharan R | 0659452 | 2013-11-26 07:38:23 -0600 | [diff] [blame] | 106 | * @debug_irq: irq number of the debug interrupt (populated runtime) |
| 107 | * @app_irq: irq number of the application interrupt (populated runtime) |
| 108 | */ |
| 109 | struct omap_l3 { |
| 110 | struct device *dev; |
| 111 | |
| 112 | void __iomem *l3_base[MAX_L3_MODULES]; |
Nishanth Menon | 97708c0 | 2014-04-14 09:57:50 -0500 | [diff] [blame] | 113 | struct l3_flagmux_data **l3_flagmux; |
Sricharan R | 0659452 | 2013-11-26 07:38:23 -0600 | [diff] [blame] | 114 | int num_modules; |
| 115 | |
| 116 | struct l3_masters_data *l3_masters; |
| 117 | int num_masters; |
Nishanth Menon | d4d8819 | 2014-04-16 11:01:02 -0500 | [diff] [blame] | 118 | u32 mst_addr_mask; |
Sricharan R | 0659452 | 2013-11-26 07:38:23 -0600 | [diff] [blame] | 119 | |
Sricharan R | 0659452 | 2013-11-26 07:38:23 -0600 | [diff] [blame] | 120 | int debug_irq; |
| 121 | int app_irq; |
| 122 | }; |
| 123 | |
Nishanth Menon | 97708c0 | 2014-04-14 09:57:50 -0500 | [diff] [blame] | 124 | static struct l3_target_data omap_l3_target_data_clk1[] = { |
Nishanth Menon | 3ae9af7 | 2014-04-11 11:38:10 -0500 | [diff] [blame] | 125 | {0x100, "DMM1",}, |
| 126 | {0x200, "DMM2",}, |
| 127 | {0x300, "ABE",}, |
| 128 | {0x400, "L4CFG",}, |
| 129 | {0x600, "CLK2PWRDISC",}, |
| 130 | {0x0, "HOSTCLK1",}, |
| 131 | {0x900, "L4WAKEUP",}, |
Santosh Shilimkar | 2722e56 | 2011-03-07 20:53:10 +0530 | [diff] [blame] | 132 | }; |
| 133 | |
Nishanth Menon | 97708c0 | 2014-04-14 09:57:50 -0500 | [diff] [blame] | 134 | static struct l3_flagmux_data omap_l3_flagmux_clk1 = { |
| 135 | .offset = 0x500, |
| 136 | .l3_targ = omap_l3_target_data_clk1, |
| 137 | .num_targ_data = ARRAY_SIZE(omap_l3_target_data_clk1), |
| 138 | }; |
| 139 | |
| 140 | |
| 141 | static struct l3_target_data omap_l3_target_data_clk2[] = { |
Nishanth Menon | 3ae9af7 | 2014-04-11 11:38:10 -0500 | [diff] [blame] | 142 | {0x500, "CORTEXM3",}, |
| 143 | {0x300, "DSS",}, |
| 144 | {0x100, "GPMC",}, |
| 145 | {0x400, "ISS",}, |
| 146 | {0x700, "IVAHD",}, |
| 147 | {0xD00, "AES1",}, |
| 148 | {0x900, "L4PER0",}, |
| 149 | {0x200, "OCMRAM",}, |
| 150 | {0x100, "GPMCsERROR",}, |
| 151 | {0x600, "SGX",}, |
| 152 | {0x800, "SL2",}, |
| 153 | {0x1600, "C2C",}, |
| 154 | {0x1100, "PWRDISCCLK1",}, |
| 155 | {0xF00, "SHA1",}, |
| 156 | {0xE00, "AES2",}, |
| 157 | {0xC00, "L4PER3",}, |
| 158 | {0xA00, "L4PER1",}, |
| 159 | {0xB00, "L4PER2",}, |
| 160 | {0x0, "HOSTCLK2",}, |
| 161 | {0x1800, "CAL",}, |
| 162 | {0x1700, "LLI",}, |
Santosh Shilimkar | 2722e56 | 2011-03-07 20:53:10 +0530 | [diff] [blame] | 163 | }; |
| 164 | |
Nishanth Menon | 97708c0 | 2014-04-14 09:57:50 -0500 | [diff] [blame] | 165 | static struct l3_flagmux_data omap_l3_flagmux_clk2 = { |
| 166 | .offset = 0x1000, |
| 167 | .l3_targ = omap_l3_target_data_clk2, |
| 168 | .num_targ_data = ARRAY_SIZE(omap_l3_target_data_clk2), |
| 169 | }; |
| 170 | |
| 171 | |
| 172 | static struct l3_target_data omap_l3_target_data_clk3[] = { |
Nishanth Menon | 3ae9af7 | 2014-04-11 11:38:10 -0500 | [diff] [blame] | 173 | {0x0100, "EMUSS",}, |
| 174 | {0x0300, "DEBUG SOURCE",}, |
| 175 | {0x0, "HOST CLK3",}, |
Santosh Shilimkar | 2722e56 | 2011-03-07 20:53:10 +0530 | [diff] [blame] | 176 | }; |
| 177 | |
Nishanth Menon | 97708c0 | 2014-04-14 09:57:50 -0500 | [diff] [blame] | 178 | static struct l3_flagmux_data omap_l3_flagmux_clk3 = { |
| 179 | .offset = 0x0200, |
| 180 | .l3_targ = omap_l3_target_data_clk3, |
| 181 | .num_targ_data = ARRAY_SIZE(omap_l3_target_data_clk3), |
| 182 | }; |
| 183 | |
Sricharan R | 0659452 | 2013-11-26 07:38:23 -0600 | [diff] [blame] | 184 | static struct l3_masters_data omap_l3_masters[] = { |
sricharan | 551a9fa | 2011-09-07 17:25:16 +0530 | [diff] [blame] | 185 | { 0x0 , "MPU"}, |
| 186 | { 0x10, "CS_ADP"}, |
| 187 | { 0x14, "xxx"}, |
| 188 | { 0x20, "DSP"}, |
| 189 | { 0x30, "IVAHD"}, |
| 190 | { 0x40, "ISS"}, |
| 191 | { 0x44, "DucatiM3"}, |
| 192 | { 0x48, "FaceDetect"}, |
| 193 | { 0x50, "SDMA_Rd"}, |
| 194 | { 0x54, "SDMA_Wr"}, |
| 195 | { 0x58, "xxx"}, |
| 196 | { 0x5C, "xxx"}, |
| 197 | { 0x60, "SGX"}, |
| 198 | { 0x70, "DSS"}, |
| 199 | { 0x80, "C2C"}, |
| 200 | { 0x88, "xxx"}, |
| 201 | { 0x8C, "xxx"}, |
| 202 | { 0x90, "HSI"}, |
| 203 | { 0xA0, "MMC1"}, |
| 204 | { 0xA4, "MMC2"}, |
| 205 | { 0xA8, "MMC6"}, |
| 206 | { 0xB0, "UNIPRO1"}, |
| 207 | { 0xC0, "USBHOSTHS"}, |
| 208 | { 0xC4, "USBOTGHS"}, |
| 209 | { 0xC8, "USBHOSTFS"} |
| 210 | }; |
| 211 | |
Nishanth Menon | 97708c0 | 2014-04-14 09:57:50 -0500 | [diff] [blame] | 212 | static struct l3_flagmux_data *omap_l3_flagmux[] = { |
| 213 | &omap_l3_flagmux_clk1, |
| 214 | &omap_l3_flagmux_clk2, |
| 215 | &omap_l3_flagmux_clk3, |
Santosh Shilimkar | 2722e56 | 2011-03-07 20:53:10 +0530 | [diff] [blame] | 216 | }; |
| 217 | |
Sricharan R | 0659452 | 2013-11-26 07:38:23 -0600 | [diff] [blame] | 218 | static const struct omap_l3 omap_l3_data = { |
| 219 | .l3_flagmux = omap_l3_flagmux, |
Nishanth Menon | 97708c0 | 2014-04-14 09:57:50 -0500 | [diff] [blame] | 220 | .num_modules = ARRAY_SIZE(omap_l3_flagmux), |
Sricharan R | 0659452 | 2013-11-26 07:38:23 -0600 | [diff] [blame] | 221 | .l3_masters = omap_l3_masters, |
| 222 | .num_masters = ARRAY_SIZE(omap_l3_masters), |
Nishanth Menon | d4d8819 | 2014-04-16 11:01:02 -0500 | [diff] [blame] | 223 | /* The 6 MSBs of register field used to distinguish initiator */ |
| 224 | .mst_addr_mask = 0xFC, |
Santosh Shilimkar | 2722e56 | 2011-03-07 20:53:10 +0530 | [diff] [blame] | 225 | }; |
Sricharan R | c10d5c9 | 2014-04-11 13:09:36 -0500 | [diff] [blame] | 226 | |
| 227 | #endif /* __OMAP_L3_NOC_H */ |