omap_l3_noc.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * OMAP L3 Interconnect error handling driver header
  4. *
  5. * Copyright (C) 2011-2015 Texas Instruments Incorporated - http://www.ti.com/
  6. * Santosh Shilimkar <[email protected]>
  7. * sricharan <[email protected]>
  8. */
  9. #ifndef __OMAP_L3_NOC_H
  10. #define __OMAP_L3_NOC_H
  11. #define MAX_L3_MODULES 3
  12. #define MAX_CLKDM_TARGETS 31
  13. #define CLEAR_STDERR_LOG (1 << 31)
  14. #define CUSTOM_ERROR 0x2
  15. #define STANDARD_ERROR 0x0
  16. #define INBAND_ERROR 0x0
  17. #define L3_APPLICATION_ERROR 0x0
  18. #define L3_DEBUG_ERROR 0x1
  19. /* L3 TARG register offsets */
  20. #define L3_TARG_STDERRLOG_MAIN 0x48
  21. #define L3_TARG_STDERRLOG_HDR 0x4c
  22. #define L3_TARG_STDERRLOG_MSTADDR 0x50
  23. #define L3_TARG_STDERRLOG_INFO 0x58
  24. #define L3_TARG_STDERRLOG_SLVOFSLSB 0x5c
  25. #define L3_TARG_STDERRLOG_CINFO_INFO 0x64
  26. #define L3_TARG_STDERRLOG_CINFO_MSTADDR 0x68
  27. #define L3_TARG_STDERRLOG_CINFO_OPCODE 0x6c
  28. #define L3_FLAGMUX_REGERR0 0xc
  29. #define L3_FLAGMUX_MASK0 0x8
  30. #define L3_TARGET_NOT_SUPPORTED NULL
  31. #define L3_BASE_IS_SUBMODULE ((void __iomem *)(1 << 0))
  32. static const char * const l3_transaction_type[] = {
  33. /* 0 0 0 */ "Idle",
  34. /* 0 0 1 */ "Write",
  35. /* 0 1 0 */ "Read",
  36. /* 0 1 1 */ "ReadEx",
  37. /* 1 0 0 */ "Read Link",
  38. /* 1 0 1 */ "Write Non-Posted",
  39. /* 1 1 0 */ "Write Conditional",
  40. /* 1 1 1 */ "Write Broadcast",
  41. };
  42. /**
  43. * struct l3_masters_data - L3 Master information
  44. * @id: ID of the L3 Master
  45. * @name: master name
  46. */
  47. struct l3_masters_data {
  48. u32 id;
  49. char *name;
  50. };
  51. /**
  52. * struct l3_target_data - L3 Target information
  53. * @offset: Offset from base for L3 Target
  54. * @name: Target name
  55. *
  56. * Target information is organized indexed by bit field definitions.
  57. */
  58. struct l3_target_data {
  59. u32 offset;
  60. char *name;
  61. };
  62. /**
  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. * @mask_app_bits: ignore these from raw application irq status
  70. * @mask_dbg_bits: ignore these from raw debug irq status
  71. */
  72. struct l3_flagmux_data {
  73. u32 offset;
  74. struct l3_target_data *l3_targ;
  75. u8 num_targ_data;
  76. u32 mask_app_bits;
  77. u32 mask_dbg_bits;
  78. };
  79. /**
  80. * struct omap_l3 - Description of data relevant for L3 bus.
  81. * @dev: device representing the bus (populated runtime)
  82. * @l3_base: base addresses of modules (populated runtime if 0)
  83. * if set to L3_BASE_IS_SUBMODULE, then uses previous
  84. * module index as the base address
  85. * @l3_flag_mux: array containing flag mux data per module
  86. * offset from corresponding module base indexed per
  87. * module.
  88. * @num_modules: number of clock domains / modules.
  89. * @l3_masters: array pointing to master data containing name and register
  90. * offset for the master.
  91. * @num_master: number of masters
  92. * @mst_addr_mask: Mask representing MSTADDR information of NTTP packet
  93. * @debug_irq: irq number of the debug interrupt (populated runtime)
  94. * @app_irq: irq number of the application interrupt (populated runtime)
  95. */
  96. struct omap_l3 {
  97. struct device *dev;
  98. void __iomem *l3_base[MAX_L3_MODULES];
  99. struct l3_flagmux_data **l3_flagmux;
  100. int num_modules;
  101. struct l3_masters_data *l3_masters;
  102. int num_masters;
  103. u32 mst_addr_mask;
  104. int debug_irq;
  105. int app_irq;
  106. };
  107. static struct l3_target_data omap_l3_target_data_clk1[] = {
  108. {0x100, "DMM1",},
  109. {0x200, "DMM2",},
  110. {0x300, "ABE",},
  111. {0x400, "L4CFG",},
  112. {0x600, "CLK2PWRDISC",},
  113. {0x0, "HOSTCLK1",},
  114. {0x900, "L4WAKEUP",},
  115. };
  116. static struct l3_flagmux_data omap_l3_flagmux_clk1 = {
  117. .offset = 0x500,
  118. .l3_targ = omap_l3_target_data_clk1,
  119. .num_targ_data = ARRAY_SIZE(omap_l3_target_data_clk1),
  120. };
  121. static struct l3_target_data omap_l3_target_data_clk2[] = {
  122. {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",},
  143. };
  144. static struct l3_flagmux_data omap_l3_flagmux_clk2 = {
  145. .offset = 0x1000,
  146. .l3_targ = omap_l3_target_data_clk2,
  147. .num_targ_data = ARRAY_SIZE(omap_l3_target_data_clk2),
  148. };
  149. static struct l3_target_data omap4_l3_target_data_clk3[] = {
  150. {0x0100, "DEBUGSS",},
  151. };
  152. static struct l3_flagmux_data omap4_l3_flagmux_clk3 = {
  153. .offset = 0x0200,
  154. .l3_targ = omap4_l3_target_data_clk3,
  155. .num_targ_data = ARRAY_SIZE(omap4_l3_target_data_clk3),
  156. };
  157. static struct l3_masters_data omap_l3_masters[] = {
  158. { 0x00, "MPU"},
  159. { 0x04, "CS_ADP"},
  160. { 0x05, "xxx"},
  161. { 0x08, "DSP"},
  162. { 0x0C, "IVAHD"},
  163. { 0x10, "ISS"},
  164. { 0x11, "DucatiM3"},
  165. { 0x12, "FaceDetect"},
  166. { 0x14, "SDMA_Rd"},
  167. { 0x15, "SDMA_Wr"},
  168. { 0x16, "xxx"},
  169. { 0x17, "xxx"},
  170. { 0x18, "SGX"},
  171. { 0x1C, "DSS"},
  172. { 0x20, "C2C"},
  173. { 0x22, "xxx"},
  174. { 0x23, "xxx"},
  175. { 0x24, "HSI"},
  176. { 0x28, "MMC1"},
  177. { 0x29, "MMC2"},
  178. { 0x2A, "MMC6"},
  179. { 0x2C, "UNIPRO1"},
  180. { 0x30, "USBHOSTHS"},
  181. { 0x31, "USBOTGHS"},
  182. { 0x32, "USBHOSTFS"}
  183. };
  184. static struct l3_flagmux_data *omap4_l3_flagmux[] = {
  185. &omap_l3_flagmux_clk1,
  186. &omap_l3_flagmux_clk2,
  187. &omap4_l3_flagmux_clk3,
  188. };
  189. static const struct omap_l3 omap4_l3_data = {
  190. .l3_flagmux = omap4_l3_flagmux,
  191. .num_modules = ARRAY_SIZE(omap4_l3_flagmux),
  192. .l3_masters = omap_l3_masters,
  193. .num_masters = ARRAY_SIZE(omap_l3_masters),
  194. /* The 6 MSBs of register field used to distinguish initiator */
  195. .mst_addr_mask = 0xFC,
  196. };
  197. /* OMAP5 data */
  198. static struct l3_target_data omap5_l3_target_data_clk3[] = {
  199. {0x0100, "L3INSTR",},
  200. {0x0300, "DEBUGSS",},
  201. {0x0, "HOSTCLK3",},
  202. };
  203. static struct l3_flagmux_data omap5_l3_flagmux_clk3 = {
  204. .offset = 0x0200,
  205. .l3_targ = omap5_l3_target_data_clk3,
  206. .num_targ_data = ARRAY_SIZE(omap5_l3_target_data_clk3),
  207. };
  208. static struct l3_flagmux_data *omap5_l3_flagmux[] = {
  209. &omap_l3_flagmux_clk1,
  210. &omap_l3_flagmux_clk2,
  211. &omap5_l3_flagmux_clk3,
  212. };
  213. static const struct omap_l3 omap5_l3_data = {
  214. .l3_flagmux = omap5_l3_flagmux,
  215. .num_modules = ARRAY_SIZE(omap5_l3_flagmux),
  216. .l3_masters = omap_l3_masters,
  217. .num_masters = ARRAY_SIZE(omap_l3_masters),
  218. /* The 6 MSBs of register field used to distinguish initiator */
  219. .mst_addr_mask = 0x7E0,
  220. };
  221. /* DRA7 data */
  222. static struct l3_target_data dra_l3_target_data_clk1[] = {
  223. {0x2a00, "AES1",},
  224. {0x0200, "DMM_P1",},
  225. {0x0600, "DSP2_SDMA",},
  226. {0x0b00, "EVE2",},
  227. {0x1300, "DMM_P2",},
  228. {0x2c00, "AES2",},
  229. {0x0300, "DSP1_SDMA",},
  230. {0x0a00, "EVE1",},
  231. {0x0c00, "EVE3",},
  232. {0x0d00, "EVE4",},
  233. {0x2900, "DSS",},
  234. {0x0100, "GPMC",},
  235. {0x3700, "PCIE1",},
  236. {0x1600, "IVA_CONFIG",},
  237. {0x1800, "IVA_SL2IF",},
  238. {0x0500, "L4_CFG",},
  239. {0x1d00, "L4_WKUP",},
  240. {0x3800, "PCIE2",},
  241. {0x3300, "SHA2_1",},
  242. {0x1200, "GPU",},
  243. {0x1000, "IPU1",},
  244. {0x1100, "IPU2",},
  245. {0x2000, "TPCC_EDMA",},
  246. {0x2e00, "TPTC1_EDMA",},
  247. {0x2b00, "TPTC2_EDMA",},
  248. {0x0700, "VCP1",},
  249. {0x2500, "L4_PER2_P3",},
  250. {0x0e00, "L4_PER3_P3",},
  251. {0x2200, "MMU1",},
  252. {0x1400, "PRUSS1",},
  253. {0x1500, "PRUSS2"},
  254. {0x0800, "VCP1",},
  255. };
  256. static struct l3_flagmux_data dra_l3_flagmux_clk1 = {
  257. .offset = 0x803500,
  258. .l3_targ = dra_l3_target_data_clk1,
  259. .num_targ_data = ARRAY_SIZE(dra_l3_target_data_clk1),
  260. };
  261. static struct l3_target_data dra_l3_target_data_clk2[] = {
  262. {0x0, "HOST CLK1",},
  263. {0x800000, "HOST CLK2",},
  264. {0xdead, L3_TARGET_NOT_SUPPORTED,},
  265. {0x3400, "SHA2_2",},
  266. {0x0900, "BB2D",},
  267. {0xdead, L3_TARGET_NOT_SUPPORTED,},
  268. {0x2100, "L4_PER1_P3",},
  269. {0x1c00, "L4_PER1_P1",},
  270. {0x1f00, "L4_PER1_P2",},
  271. {0x2300, "L4_PER2_P1",},
  272. {0x2400, "L4_PER2_P2",},
  273. {0x2600, "L4_PER3_P1",},
  274. {0x2700, "L4_PER3_P2",},
  275. {0x2f00, "MCASP1",},
  276. {0x3000, "MCASP2",},
  277. {0x3100, "MCASP3",},
  278. {0x2800, "MMU2",},
  279. {0x0f00, "OCMC_RAM1",},
  280. {0x1700, "OCMC_RAM2",},
  281. {0x1900, "OCMC_RAM3",},
  282. {0x1e00, "OCMC_ROM",},
  283. {0x3900, "QSPI",},
  284. };
  285. static struct l3_flagmux_data dra_l3_flagmux_clk2 = {
  286. .offset = 0x803600,
  287. .l3_targ = dra_l3_target_data_clk2,
  288. .num_targ_data = ARRAY_SIZE(dra_l3_target_data_clk2),
  289. };
  290. static struct l3_target_data dra_l3_target_data_clk3[] = {
  291. {0x0100, "L3_INSTR"},
  292. {0x0300, "DEBUGSS_CT_TBR"},
  293. {0x0, "HOST CLK3"},
  294. };
  295. static struct l3_flagmux_data dra_l3_flagmux_clk3 = {
  296. .offset = 0x200,
  297. .l3_targ = dra_l3_target_data_clk3,
  298. .num_targ_data = ARRAY_SIZE(dra_l3_target_data_clk3),
  299. };
  300. static struct l3_masters_data dra_l3_masters[] = {
  301. { 0x0, "MPU" },
  302. { 0x4, "CS_DAP" },
  303. { 0x5, "IEEE1500_2_OCP" },
  304. { 0x8, "DSP1_MDMA" },
  305. { 0x9, "DSP1_CFG" },
  306. { 0xA, "DSP1_DMA" },
  307. { 0xB, "DSP2_MDMA" },
  308. { 0xC, "DSP2_CFG" },
  309. { 0xD, "DSP2_DMA" },
  310. { 0xE, "IVA" },
  311. { 0x10, "EVE1_P1" },
  312. { 0x11, "EVE2_P1" },
  313. { 0x12, "EVE3_P1" },
  314. { 0x13, "EVE4_P1" },
  315. { 0x14, "PRUSS1 PRU1" },
  316. { 0x15, "PRUSS1 PRU2" },
  317. { 0x16, "PRUSS2 PRU1" },
  318. { 0x17, "PRUSS2 PRU2" },
  319. { 0x18, "IPU1" },
  320. { 0x19, "IPU2" },
  321. { 0x1A, "SDMA" },
  322. { 0x1B, "CDMA" },
  323. { 0x1C, "TC1_EDMA" },
  324. { 0x1D, "TC2_EDMA" },
  325. { 0x20, "DSS" },
  326. { 0x21, "MMU1" },
  327. { 0x22, "PCIE1" },
  328. { 0x23, "MMU2" },
  329. { 0x24, "VIP1" },
  330. { 0x25, "VIP2" },
  331. { 0x26, "VIP3" },
  332. { 0x27, "VPE" },
  333. { 0x28, "GPU_P1" },
  334. { 0x29, "BB2D" },
  335. { 0x29, "GPU_P2" },
  336. { 0x2B, "GMAC_SW" },
  337. { 0x2C, "USB3" },
  338. { 0x2D, "USB2_SS" },
  339. { 0x2E, "USB2_ULPI_SS1" },
  340. { 0x2F, "USB2_ULPI_SS2" },
  341. { 0x30, "CSI2_1" },
  342. { 0x31, "CSI2_2" },
  343. { 0x33, "SATA" },
  344. { 0x34, "EVE1_P2" },
  345. { 0x35, "EVE2_P2" },
  346. { 0x36, "EVE3_P2" },
  347. { 0x37, "EVE4_P2" }
  348. };
  349. static struct l3_flagmux_data *dra_l3_flagmux[] = {
  350. &dra_l3_flagmux_clk1,
  351. &dra_l3_flagmux_clk2,
  352. &dra_l3_flagmux_clk3,
  353. };
  354. static const struct omap_l3 dra_l3_data = {
  355. .l3_base = { [1] = L3_BASE_IS_SUBMODULE },
  356. .l3_flagmux = dra_l3_flagmux,
  357. .num_modules = ARRAY_SIZE(dra_l3_flagmux),
  358. .l3_masters = dra_l3_masters,
  359. .num_masters = ARRAY_SIZE(dra_l3_masters),
  360. /* The 6 MSBs of register field used to distinguish initiator */
  361. .mst_addr_mask = 0xFC,
  362. };
  363. /* AM4372 data */
  364. static struct l3_target_data am4372_l3_target_data_200f[] = {
  365. {0xf00, "EMIF",},
  366. {0x1200, "DES",},
  367. {0x400, "OCMCRAM",},
  368. {0x700, "TPTC0",},
  369. {0x800, "TPTC1",},
  370. {0x900, "TPTC2"},
  371. {0xb00, "TPCC",},
  372. {0xd00, "DEBUGSS",},
  373. {0xdead, L3_TARGET_NOT_SUPPORTED,},
  374. {0x200, "SHA",},
  375. {0xc00, "SGX530",},
  376. {0x500, "AES0",},
  377. {0xa00, "L4_FAST",},
  378. {0x300, "MPUSS_L2_RAM",},
  379. {0x100, "ICSS",},
  380. };
  381. static struct l3_flagmux_data am4372_l3_flagmux_200f = {
  382. .offset = 0x1000,
  383. .l3_targ = am4372_l3_target_data_200f,
  384. .num_targ_data = ARRAY_SIZE(am4372_l3_target_data_200f),
  385. };
  386. static struct l3_target_data am4372_l3_target_data_100s[] = {
  387. {0x100, "L4_PER_0",},
  388. {0x200, "L4_PER_1",},
  389. {0x300, "L4_PER_2",},
  390. {0x400, "L4_PER_3",},
  391. {0x800, "McASP0",},
  392. {0x900, "McASP1",},
  393. {0xC00, "MMCHS2",},
  394. {0x700, "GPMC",},
  395. {0xD00, "L4_FW",},
  396. {0xdead, L3_TARGET_NOT_SUPPORTED,},
  397. {0x500, "ADCTSC",},
  398. {0xE00, "L4_WKUP",},
  399. {0xA00, "MAG_CARD",},
  400. };
  401. static struct l3_flagmux_data am4372_l3_flagmux_100s = {
  402. .offset = 0x600,
  403. .l3_targ = am4372_l3_target_data_100s,
  404. .num_targ_data = ARRAY_SIZE(am4372_l3_target_data_100s),
  405. };
  406. static struct l3_masters_data am4372_l3_masters[] = {
  407. { 0x0, "M1 (128-bit)"},
  408. { 0x1, "M2 (64-bit)"},
  409. { 0x4, "DAP"},
  410. { 0x5, "P1500"},
  411. { 0xC, "ICSS0"},
  412. { 0xD, "ICSS1"},
  413. { 0x14, "Wakeup Processor"},
  414. { 0x18, "TPTC0 Read"},
  415. { 0x19, "TPTC0 Write"},
  416. { 0x1A, "TPTC1 Read"},
  417. { 0x1B, "TPTC1 Write"},
  418. { 0x1C, "TPTC2 Read"},
  419. { 0x1D, "TPTC2 Write"},
  420. { 0x20, "SGX530"},
  421. { 0x21, "OCP WP Traffic Probe"},
  422. { 0x22, "OCP WP DMA Profiling"},
  423. { 0x23, "OCP WP Event Trace"},
  424. { 0x25, "DSS"},
  425. { 0x28, "Crypto DMA RD"},
  426. { 0x29, "Crypto DMA WR"},
  427. { 0x2C, "VPFE0"},
  428. { 0x2D, "VPFE1"},
  429. { 0x30, "GEMAC"},
  430. { 0x34, "USB0 RD"},
  431. { 0x35, "USB0 WR"},
  432. { 0x36, "USB1 RD"},
  433. { 0x37, "USB1 WR"},
  434. };
  435. static struct l3_flagmux_data *am4372_l3_flagmux[] = {
  436. &am4372_l3_flagmux_200f,
  437. &am4372_l3_flagmux_100s,
  438. };
  439. static const struct omap_l3 am4372_l3_data = {
  440. .l3_flagmux = am4372_l3_flagmux,
  441. .num_modules = ARRAY_SIZE(am4372_l3_flagmux),
  442. .l3_masters = am4372_l3_masters,
  443. .num_masters = ARRAY_SIZE(am4372_l3_masters),
  444. /* All 6 bits of register field used to distinguish initiator */
  445. .mst_addr_mask = 0x3F,
  446. };
  447. #endif /* __OMAP_L3_NOC_H */