tegra124.c 18 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051
  1. /*
  2. * Copyright (C) 2014 NVIDIA CORPORATION. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #include <linux/of.h>
  9. #include <linux/mm.h>
  10. #include <dt-bindings/memory/tegra124-mc.h>
  11. #include "mc.h"
  12. #define MC_EMEM_ARB_CFG 0x90
  13. #define MC_EMEM_ARB_OUTSTANDING_REQ 0x94
  14. #define MC_EMEM_ARB_TIMING_RCD 0x98
  15. #define MC_EMEM_ARB_TIMING_RP 0x9c
  16. #define MC_EMEM_ARB_TIMING_RC 0xa0
  17. #define MC_EMEM_ARB_TIMING_RAS 0xa4
  18. #define MC_EMEM_ARB_TIMING_FAW 0xa8
  19. #define MC_EMEM_ARB_TIMING_RRD 0xac
  20. #define MC_EMEM_ARB_TIMING_RAP2PRE 0xb0
  21. #define MC_EMEM_ARB_TIMING_WAP2PRE 0xb4
  22. #define MC_EMEM_ARB_TIMING_R2R 0xb8
  23. #define MC_EMEM_ARB_TIMING_W2W 0xbc
  24. #define MC_EMEM_ARB_TIMING_R2W 0xc0
  25. #define MC_EMEM_ARB_TIMING_W2R 0xc4
  26. #define MC_EMEM_ARB_DA_TURNS 0xd0
  27. #define MC_EMEM_ARB_DA_COVERS 0xd4
  28. #define MC_EMEM_ARB_MISC0 0xd8
  29. #define MC_EMEM_ARB_MISC1 0xdc
  30. #define MC_EMEM_ARB_RING1_THROTTLE 0xe0
  31. static const unsigned long tegra124_mc_emem_regs[] = {
  32. MC_EMEM_ARB_CFG,
  33. MC_EMEM_ARB_OUTSTANDING_REQ,
  34. MC_EMEM_ARB_TIMING_RCD,
  35. MC_EMEM_ARB_TIMING_RP,
  36. MC_EMEM_ARB_TIMING_RC,
  37. MC_EMEM_ARB_TIMING_RAS,
  38. MC_EMEM_ARB_TIMING_FAW,
  39. MC_EMEM_ARB_TIMING_RRD,
  40. MC_EMEM_ARB_TIMING_RAP2PRE,
  41. MC_EMEM_ARB_TIMING_WAP2PRE,
  42. MC_EMEM_ARB_TIMING_R2R,
  43. MC_EMEM_ARB_TIMING_W2W,
  44. MC_EMEM_ARB_TIMING_R2W,
  45. MC_EMEM_ARB_TIMING_W2R,
  46. MC_EMEM_ARB_DA_TURNS,
  47. MC_EMEM_ARB_DA_COVERS,
  48. MC_EMEM_ARB_MISC0,
  49. MC_EMEM_ARB_MISC1,
  50. MC_EMEM_ARB_RING1_THROTTLE
  51. };
  52. static const struct tegra_mc_client tegra124_mc_clients[] = {
  53. {
  54. .id = 0x00,
  55. .name = "ptcr",
  56. .swgroup = TEGRA_SWGROUP_PTC,
  57. }, {
  58. .id = 0x01,
  59. .name = "display0a",
  60. .swgroup = TEGRA_SWGROUP_DC,
  61. .smmu = {
  62. .reg = 0x228,
  63. .bit = 1,
  64. },
  65. .la = {
  66. .reg = 0x2e8,
  67. .shift = 0,
  68. .mask = 0xff,
  69. .def = 0xc2,
  70. },
  71. }, {
  72. .id = 0x02,
  73. .name = "display0ab",
  74. .swgroup = TEGRA_SWGROUP_DCB,
  75. .smmu = {
  76. .reg = 0x228,
  77. .bit = 2,
  78. },
  79. .la = {
  80. .reg = 0x2f4,
  81. .shift = 0,
  82. .mask = 0xff,
  83. .def = 0xc6,
  84. },
  85. }, {
  86. .id = 0x03,
  87. .name = "display0b",
  88. .swgroup = TEGRA_SWGROUP_DC,
  89. .smmu = {
  90. .reg = 0x228,
  91. .bit = 3,
  92. },
  93. .la = {
  94. .reg = 0x2e8,
  95. .shift = 16,
  96. .mask = 0xff,
  97. .def = 0x50,
  98. },
  99. }, {
  100. .id = 0x04,
  101. .name = "display0bb",
  102. .swgroup = TEGRA_SWGROUP_DCB,
  103. .smmu = {
  104. .reg = 0x228,
  105. .bit = 4,
  106. },
  107. .la = {
  108. .reg = 0x2f4,
  109. .shift = 16,
  110. .mask = 0xff,
  111. .def = 0x50,
  112. },
  113. }, {
  114. .id = 0x05,
  115. .name = "display0c",
  116. .swgroup = TEGRA_SWGROUP_DC,
  117. .smmu = {
  118. .reg = 0x228,
  119. .bit = 5,
  120. },
  121. .la = {
  122. .reg = 0x2ec,
  123. .shift = 0,
  124. .mask = 0xff,
  125. .def = 0x50,
  126. },
  127. }, {
  128. .id = 0x06,
  129. .name = "display0cb",
  130. .swgroup = TEGRA_SWGROUP_DCB,
  131. .smmu = {
  132. .reg = 0x228,
  133. .bit = 6,
  134. },
  135. .la = {
  136. .reg = 0x2f8,
  137. .shift = 0,
  138. .mask = 0xff,
  139. .def = 0x50,
  140. },
  141. }, {
  142. .id = 0x0e,
  143. .name = "afir",
  144. .swgroup = TEGRA_SWGROUP_AFI,
  145. .smmu = {
  146. .reg = 0x228,
  147. .bit = 14,
  148. },
  149. .la = {
  150. .reg = 0x2e0,
  151. .shift = 0,
  152. .mask = 0xff,
  153. .def = 0x13,
  154. },
  155. }, {
  156. .id = 0x0f,
  157. .name = "avpcarm7r",
  158. .swgroup = TEGRA_SWGROUP_AVPC,
  159. .smmu = {
  160. .reg = 0x228,
  161. .bit = 15,
  162. },
  163. .la = {
  164. .reg = 0x2e4,
  165. .shift = 0,
  166. .mask = 0xff,
  167. .def = 0x04,
  168. },
  169. }, {
  170. .id = 0x10,
  171. .name = "displayhc",
  172. .swgroup = TEGRA_SWGROUP_DC,
  173. .smmu = {
  174. .reg = 0x228,
  175. .bit = 16,
  176. },
  177. .la = {
  178. .reg = 0x2f0,
  179. .shift = 0,
  180. .mask = 0xff,
  181. .def = 0x50,
  182. },
  183. }, {
  184. .id = 0x11,
  185. .name = "displayhcb",
  186. .swgroup = TEGRA_SWGROUP_DCB,
  187. .smmu = {
  188. .reg = 0x228,
  189. .bit = 17,
  190. },
  191. .la = {
  192. .reg = 0x2fc,
  193. .shift = 0,
  194. .mask = 0xff,
  195. .def = 0x50,
  196. },
  197. }, {
  198. .id = 0x15,
  199. .name = "hdar",
  200. .swgroup = TEGRA_SWGROUP_HDA,
  201. .smmu = {
  202. .reg = 0x228,
  203. .bit = 21,
  204. },
  205. .la = {
  206. .reg = 0x318,
  207. .shift = 0,
  208. .mask = 0xff,
  209. .def = 0x24,
  210. },
  211. }, {
  212. .id = 0x16,
  213. .name = "host1xdmar",
  214. .swgroup = TEGRA_SWGROUP_HC,
  215. .smmu = {
  216. .reg = 0x228,
  217. .bit = 22,
  218. },
  219. .la = {
  220. .reg = 0x310,
  221. .shift = 0,
  222. .mask = 0xff,
  223. .def = 0x1e,
  224. },
  225. }, {
  226. .id = 0x17,
  227. .name = "host1xr",
  228. .swgroup = TEGRA_SWGROUP_HC,
  229. .smmu = {
  230. .reg = 0x228,
  231. .bit = 23,
  232. },
  233. .la = {
  234. .reg = 0x310,
  235. .shift = 16,
  236. .mask = 0xff,
  237. .def = 0x50,
  238. },
  239. }, {
  240. .id = 0x1c,
  241. .name = "msencsrd",
  242. .swgroup = TEGRA_SWGROUP_MSENC,
  243. .smmu = {
  244. .reg = 0x228,
  245. .bit = 28,
  246. },
  247. .la = {
  248. .reg = 0x328,
  249. .shift = 0,
  250. .mask = 0xff,
  251. .def = 0x23,
  252. },
  253. }, {
  254. .id = 0x1d,
  255. .name = "ppcsahbdmar",
  256. .swgroup = TEGRA_SWGROUP_PPCS,
  257. .smmu = {
  258. .reg = 0x228,
  259. .bit = 29,
  260. },
  261. .la = {
  262. .reg = 0x344,
  263. .shift = 0,
  264. .mask = 0xff,
  265. .def = 0x49,
  266. },
  267. }, {
  268. .id = 0x1e,
  269. .name = "ppcsahbslvr",
  270. .swgroup = TEGRA_SWGROUP_PPCS,
  271. .smmu = {
  272. .reg = 0x228,
  273. .bit = 30,
  274. },
  275. .la = {
  276. .reg = 0x344,
  277. .shift = 16,
  278. .mask = 0xff,
  279. .def = 0x1a,
  280. },
  281. }, {
  282. .id = 0x1f,
  283. .name = "satar",
  284. .swgroup = TEGRA_SWGROUP_SATA,
  285. .smmu = {
  286. .reg = 0x228,
  287. .bit = 31,
  288. },
  289. .la = {
  290. .reg = 0x350,
  291. .shift = 0,
  292. .mask = 0xff,
  293. .def = 0x65,
  294. },
  295. }, {
  296. .id = 0x22,
  297. .name = "vdebsevr",
  298. .swgroup = TEGRA_SWGROUP_VDE,
  299. .smmu = {
  300. .reg = 0x22c,
  301. .bit = 2,
  302. },
  303. .la = {
  304. .reg = 0x354,
  305. .shift = 0,
  306. .mask = 0xff,
  307. .def = 0x4f,
  308. },
  309. }, {
  310. .id = 0x23,
  311. .name = "vdember",
  312. .swgroup = TEGRA_SWGROUP_VDE,
  313. .smmu = {
  314. .reg = 0x22c,
  315. .bit = 3,
  316. },
  317. .la = {
  318. .reg = 0x354,
  319. .shift = 16,
  320. .mask = 0xff,
  321. .def = 0x3d,
  322. },
  323. }, {
  324. .id = 0x24,
  325. .name = "vdemcer",
  326. .swgroup = TEGRA_SWGROUP_VDE,
  327. .smmu = {
  328. .reg = 0x22c,
  329. .bit = 4,
  330. },
  331. .la = {
  332. .reg = 0x358,
  333. .shift = 0,
  334. .mask = 0xff,
  335. .def = 0x66,
  336. },
  337. }, {
  338. .id = 0x25,
  339. .name = "vdetper",
  340. .swgroup = TEGRA_SWGROUP_VDE,
  341. .smmu = {
  342. .reg = 0x22c,
  343. .bit = 5,
  344. },
  345. .la = {
  346. .reg = 0x358,
  347. .shift = 16,
  348. .mask = 0xff,
  349. .def = 0xa5,
  350. },
  351. }, {
  352. .id = 0x26,
  353. .name = "mpcorelpr",
  354. .swgroup = TEGRA_SWGROUP_MPCORELP,
  355. .la = {
  356. .reg = 0x324,
  357. .shift = 0,
  358. .mask = 0xff,
  359. .def = 0x04,
  360. },
  361. }, {
  362. .id = 0x27,
  363. .name = "mpcorer",
  364. .swgroup = TEGRA_SWGROUP_MPCORE,
  365. .la = {
  366. .reg = 0x320,
  367. .shift = 0,
  368. .mask = 0xff,
  369. .def = 0x04,
  370. },
  371. }, {
  372. .id = 0x2b,
  373. .name = "msencswr",
  374. .swgroup = TEGRA_SWGROUP_MSENC,
  375. .smmu = {
  376. .reg = 0x22c,
  377. .bit = 11,
  378. },
  379. .la = {
  380. .reg = 0x328,
  381. .shift = 16,
  382. .mask = 0xff,
  383. .def = 0x80,
  384. },
  385. }, {
  386. .id = 0x31,
  387. .name = "afiw",
  388. .swgroup = TEGRA_SWGROUP_AFI,
  389. .smmu = {
  390. .reg = 0x22c,
  391. .bit = 17,
  392. },
  393. .la = {
  394. .reg = 0x2e0,
  395. .shift = 16,
  396. .mask = 0xff,
  397. .def = 0x80,
  398. },
  399. }, {
  400. .id = 0x32,
  401. .name = "avpcarm7w",
  402. .swgroup = TEGRA_SWGROUP_AVPC,
  403. .smmu = {
  404. .reg = 0x22c,
  405. .bit = 18,
  406. },
  407. .la = {
  408. .reg = 0x2e4,
  409. .shift = 16,
  410. .mask = 0xff,
  411. .def = 0x80,
  412. },
  413. }, {
  414. .id = 0x35,
  415. .name = "hdaw",
  416. .swgroup = TEGRA_SWGROUP_HDA,
  417. .smmu = {
  418. .reg = 0x22c,
  419. .bit = 21,
  420. },
  421. .la = {
  422. .reg = 0x318,
  423. .shift = 16,
  424. .mask = 0xff,
  425. .def = 0x80,
  426. },
  427. }, {
  428. .id = 0x36,
  429. .name = "host1xw",
  430. .swgroup = TEGRA_SWGROUP_HC,
  431. .smmu = {
  432. .reg = 0x22c,
  433. .bit = 22,
  434. },
  435. .la = {
  436. .reg = 0x314,
  437. .shift = 0,
  438. .mask = 0xff,
  439. .def = 0x80,
  440. },
  441. }, {
  442. .id = 0x38,
  443. .name = "mpcorelpw",
  444. .swgroup = TEGRA_SWGROUP_MPCORELP,
  445. .la = {
  446. .reg = 0x324,
  447. .shift = 16,
  448. .mask = 0xff,
  449. .def = 0x80,
  450. },
  451. }, {
  452. .id = 0x39,
  453. .name = "mpcorew",
  454. .swgroup = TEGRA_SWGROUP_MPCORE,
  455. .la = {
  456. .reg = 0x320,
  457. .shift = 16,
  458. .mask = 0xff,
  459. .def = 0x80,
  460. },
  461. }, {
  462. .id = 0x3b,
  463. .name = "ppcsahbdmaw",
  464. .swgroup = TEGRA_SWGROUP_PPCS,
  465. .smmu = {
  466. .reg = 0x22c,
  467. .bit = 27,
  468. },
  469. .la = {
  470. .reg = 0x348,
  471. .shift = 0,
  472. .mask = 0xff,
  473. .def = 0x80,
  474. },
  475. }, {
  476. .id = 0x3c,
  477. .name = "ppcsahbslvw",
  478. .swgroup = TEGRA_SWGROUP_PPCS,
  479. .smmu = {
  480. .reg = 0x22c,
  481. .bit = 28,
  482. },
  483. .la = {
  484. .reg = 0x348,
  485. .shift = 16,
  486. .mask = 0xff,
  487. .def = 0x80,
  488. },
  489. }, {
  490. .id = 0x3d,
  491. .name = "sataw",
  492. .swgroup = TEGRA_SWGROUP_SATA,
  493. .smmu = {
  494. .reg = 0x22c,
  495. .bit = 29,
  496. },
  497. .la = {
  498. .reg = 0x350,
  499. .shift = 16,
  500. .mask = 0xff,
  501. .def = 0x65,
  502. },
  503. }, {
  504. .id = 0x3e,
  505. .name = "vdebsevw",
  506. .swgroup = TEGRA_SWGROUP_VDE,
  507. .smmu = {
  508. .reg = 0x22c,
  509. .bit = 30,
  510. },
  511. .la = {
  512. .reg = 0x35c,
  513. .shift = 0,
  514. .mask = 0xff,
  515. .def = 0x80,
  516. },
  517. }, {
  518. .id = 0x3f,
  519. .name = "vdedbgw",
  520. .swgroup = TEGRA_SWGROUP_VDE,
  521. .smmu = {
  522. .reg = 0x22c,
  523. .bit = 31,
  524. },
  525. .la = {
  526. .reg = 0x35c,
  527. .shift = 16,
  528. .mask = 0xff,
  529. .def = 0x80,
  530. },
  531. }, {
  532. .id = 0x40,
  533. .name = "vdembew",
  534. .swgroup = TEGRA_SWGROUP_VDE,
  535. .smmu = {
  536. .reg = 0x230,
  537. .bit = 0,
  538. },
  539. .la = {
  540. .reg = 0x360,
  541. .shift = 0,
  542. .mask = 0xff,
  543. .def = 0x80,
  544. },
  545. }, {
  546. .id = 0x41,
  547. .name = "vdetpmw",
  548. .swgroup = TEGRA_SWGROUP_VDE,
  549. .smmu = {
  550. .reg = 0x230,
  551. .bit = 1,
  552. },
  553. .la = {
  554. .reg = 0x360,
  555. .shift = 16,
  556. .mask = 0xff,
  557. .def = 0x80,
  558. },
  559. }, {
  560. .id = 0x44,
  561. .name = "ispra",
  562. .swgroup = TEGRA_SWGROUP_ISP2,
  563. .smmu = {
  564. .reg = 0x230,
  565. .bit = 4,
  566. },
  567. .la = {
  568. .reg = 0x370,
  569. .shift = 0,
  570. .mask = 0xff,
  571. .def = 0x18,
  572. },
  573. }, {
  574. .id = 0x46,
  575. .name = "ispwa",
  576. .swgroup = TEGRA_SWGROUP_ISP2,
  577. .smmu = {
  578. .reg = 0x230,
  579. .bit = 6,
  580. },
  581. .la = {
  582. .reg = 0x374,
  583. .shift = 0,
  584. .mask = 0xff,
  585. .def = 0x80,
  586. },
  587. }, {
  588. .id = 0x47,
  589. .name = "ispwb",
  590. .swgroup = TEGRA_SWGROUP_ISP2,
  591. .smmu = {
  592. .reg = 0x230,
  593. .bit = 7,
  594. },
  595. .la = {
  596. .reg = 0x374,
  597. .shift = 16,
  598. .mask = 0xff,
  599. .def = 0x80,
  600. },
  601. }, {
  602. .id = 0x4a,
  603. .name = "xusb_hostr",
  604. .swgroup = TEGRA_SWGROUP_XUSB_HOST,
  605. .smmu = {
  606. .reg = 0x230,
  607. .bit = 10,
  608. },
  609. .la = {
  610. .reg = 0x37c,
  611. .shift = 0,
  612. .mask = 0xff,
  613. .def = 0x39,
  614. },
  615. }, {
  616. .id = 0x4b,
  617. .name = "xusb_hostw",
  618. .swgroup = TEGRA_SWGROUP_XUSB_HOST,
  619. .smmu = {
  620. .reg = 0x230,
  621. .bit = 11,
  622. },
  623. .la = {
  624. .reg = 0x37c,
  625. .shift = 16,
  626. .mask = 0xff,
  627. .def = 0x80,
  628. },
  629. }, {
  630. .id = 0x4c,
  631. .name = "xusb_devr",
  632. .swgroup = TEGRA_SWGROUP_XUSB_DEV,
  633. .smmu = {
  634. .reg = 0x230,
  635. .bit = 12,
  636. },
  637. .la = {
  638. .reg = 0x380,
  639. .shift = 0,
  640. .mask = 0xff,
  641. .def = 0x39,
  642. },
  643. }, {
  644. .id = 0x4d,
  645. .name = "xusb_devw",
  646. .swgroup = TEGRA_SWGROUP_XUSB_DEV,
  647. .smmu = {
  648. .reg = 0x230,
  649. .bit = 13,
  650. },
  651. .la = {
  652. .reg = 0x380,
  653. .shift = 16,
  654. .mask = 0xff,
  655. .def = 0x80,
  656. },
  657. }, {
  658. .id = 0x4e,
  659. .name = "isprab",
  660. .swgroup = TEGRA_SWGROUP_ISP2B,
  661. .smmu = {
  662. .reg = 0x230,
  663. .bit = 14,
  664. },
  665. .la = {
  666. .reg = 0x384,
  667. .shift = 0,
  668. .mask = 0xff,
  669. .def = 0x18,
  670. },
  671. }, {
  672. .id = 0x50,
  673. .name = "ispwab",
  674. .swgroup = TEGRA_SWGROUP_ISP2B,
  675. .smmu = {
  676. .reg = 0x230,
  677. .bit = 16,
  678. },
  679. .la = {
  680. .reg = 0x388,
  681. .shift = 0,
  682. .mask = 0xff,
  683. .def = 0x80,
  684. },
  685. }, {
  686. .id = 0x51,
  687. .name = "ispwbb",
  688. .swgroup = TEGRA_SWGROUP_ISP2B,
  689. .smmu = {
  690. .reg = 0x230,
  691. .bit = 17,
  692. },
  693. .la = {
  694. .reg = 0x388,
  695. .shift = 16,
  696. .mask = 0xff,
  697. .def = 0x80,
  698. },
  699. }, {
  700. .id = 0x54,
  701. .name = "tsecsrd",
  702. .swgroup = TEGRA_SWGROUP_TSEC,
  703. .smmu = {
  704. .reg = 0x230,
  705. .bit = 20,
  706. },
  707. .la = {
  708. .reg = 0x390,
  709. .shift = 0,
  710. .mask = 0xff,
  711. .def = 0x9b,
  712. },
  713. }, {
  714. .id = 0x55,
  715. .name = "tsecswr",
  716. .swgroup = TEGRA_SWGROUP_TSEC,
  717. .smmu = {
  718. .reg = 0x230,
  719. .bit = 21,
  720. },
  721. .la = {
  722. .reg = 0x390,
  723. .shift = 16,
  724. .mask = 0xff,
  725. .def = 0x80,
  726. },
  727. }, {
  728. .id = 0x56,
  729. .name = "a9avpscr",
  730. .swgroup = TEGRA_SWGROUP_A9AVP,
  731. .smmu = {
  732. .reg = 0x230,
  733. .bit = 22,
  734. },
  735. .la = {
  736. .reg = 0x3a4,
  737. .shift = 0,
  738. .mask = 0xff,
  739. .def = 0x04,
  740. },
  741. }, {
  742. .id = 0x57,
  743. .name = "a9avpscw",
  744. .swgroup = TEGRA_SWGROUP_A9AVP,
  745. .smmu = {
  746. .reg = 0x230,
  747. .bit = 23,
  748. },
  749. .la = {
  750. .reg = 0x3a4,
  751. .shift = 16,
  752. .mask = 0xff,
  753. .def = 0x80,
  754. },
  755. }, {
  756. .id = 0x58,
  757. .name = "gpusrd",
  758. .swgroup = TEGRA_SWGROUP_GPU,
  759. .smmu = {
  760. /* read-only */
  761. .reg = 0x230,
  762. .bit = 24,
  763. },
  764. .la = {
  765. .reg = 0x3c8,
  766. .shift = 0,
  767. .mask = 0xff,
  768. .def = 0x1a,
  769. },
  770. }, {
  771. .id = 0x59,
  772. .name = "gpuswr",
  773. .swgroup = TEGRA_SWGROUP_GPU,
  774. .smmu = {
  775. /* read-only */
  776. .reg = 0x230,
  777. .bit = 25,
  778. },
  779. .la = {
  780. .reg = 0x3c8,
  781. .shift = 16,
  782. .mask = 0xff,
  783. .def = 0x80,
  784. },
  785. }, {
  786. .id = 0x5a,
  787. .name = "displayt",
  788. .swgroup = TEGRA_SWGROUP_DC,
  789. .smmu = {
  790. .reg = 0x230,
  791. .bit = 26,
  792. },
  793. .la = {
  794. .reg = 0x2f0,
  795. .shift = 16,
  796. .mask = 0xff,
  797. .def = 0x50,
  798. },
  799. }, {
  800. .id = 0x60,
  801. .name = "sdmmcra",
  802. .swgroup = TEGRA_SWGROUP_SDMMC1A,
  803. .smmu = {
  804. .reg = 0x234,
  805. .bit = 0,
  806. },
  807. .la = {
  808. .reg = 0x3b8,
  809. .shift = 0,
  810. .mask = 0xff,
  811. .def = 0x49,
  812. },
  813. }, {
  814. .id = 0x61,
  815. .name = "sdmmcraa",
  816. .swgroup = TEGRA_SWGROUP_SDMMC2A,
  817. .smmu = {
  818. .reg = 0x234,
  819. .bit = 1,
  820. },
  821. .la = {
  822. .reg = 0x3bc,
  823. .shift = 0,
  824. .mask = 0xff,
  825. .def = 0x49,
  826. },
  827. }, {
  828. .id = 0x62,
  829. .name = "sdmmcr",
  830. .swgroup = TEGRA_SWGROUP_SDMMC3A,
  831. .smmu = {
  832. .reg = 0x234,
  833. .bit = 2,
  834. },
  835. .la = {
  836. .reg = 0x3c0,
  837. .shift = 0,
  838. .mask = 0xff,
  839. .def = 0x49,
  840. },
  841. }, {
  842. .id = 0x63,
  843. .swgroup = TEGRA_SWGROUP_SDMMC4A,
  844. .name = "sdmmcrab",
  845. .smmu = {
  846. .reg = 0x234,
  847. .bit = 3,
  848. },
  849. .la = {
  850. .reg = 0x3c4,
  851. .shift = 0,
  852. .mask = 0xff,
  853. .def = 0x49,
  854. },
  855. }, {
  856. .id = 0x64,
  857. .name = "sdmmcwa",
  858. .swgroup = TEGRA_SWGROUP_SDMMC1A,
  859. .smmu = {
  860. .reg = 0x234,
  861. .bit = 4,
  862. },
  863. .la = {
  864. .reg = 0x3b8,
  865. .shift = 16,
  866. .mask = 0xff,
  867. .def = 0x80,
  868. },
  869. }, {
  870. .id = 0x65,
  871. .name = "sdmmcwaa",
  872. .swgroup = TEGRA_SWGROUP_SDMMC2A,
  873. .smmu = {
  874. .reg = 0x234,
  875. .bit = 5,
  876. },
  877. .la = {
  878. .reg = 0x3bc,
  879. .shift = 16,
  880. .mask = 0xff,
  881. .def = 0x80,
  882. },
  883. }, {
  884. .id = 0x66,
  885. .name = "sdmmcw",
  886. .swgroup = TEGRA_SWGROUP_SDMMC3A,
  887. .smmu = {
  888. .reg = 0x234,
  889. .bit = 6,
  890. },
  891. .la = {
  892. .reg = 0x3c0,
  893. .shift = 16,
  894. .mask = 0xff,
  895. .def = 0x80,
  896. },
  897. }, {
  898. .id = 0x67,
  899. .name = "sdmmcwab",
  900. .swgroup = TEGRA_SWGROUP_SDMMC4A,
  901. .smmu = {
  902. .reg = 0x234,
  903. .bit = 7,
  904. },
  905. .la = {
  906. .reg = 0x3c4,
  907. .shift = 16,
  908. .mask = 0xff,
  909. .def = 0x80,
  910. },
  911. }, {
  912. .id = 0x6c,
  913. .name = "vicsrd",
  914. .swgroup = TEGRA_SWGROUP_VIC,
  915. .smmu = {
  916. .reg = 0x234,
  917. .bit = 12,
  918. },
  919. .la = {
  920. .reg = 0x394,
  921. .shift = 0,
  922. .mask = 0xff,
  923. .def = 0x1a,
  924. },
  925. }, {
  926. .id = 0x6d,
  927. .name = "vicswr",
  928. .swgroup = TEGRA_SWGROUP_VIC,
  929. .smmu = {
  930. .reg = 0x234,
  931. .bit = 13,
  932. },
  933. .la = {
  934. .reg = 0x394,
  935. .shift = 16,
  936. .mask = 0xff,
  937. .def = 0x80,
  938. },
  939. }, {
  940. .id = 0x72,
  941. .name = "viw",
  942. .swgroup = TEGRA_SWGROUP_VI,
  943. .smmu = {
  944. .reg = 0x234,
  945. .bit = 18,
  946. },
  947. .la = {
  948. .reg = 0x398,
  949. .shift = 0,
  950. .mask = 0xff,
  951. .def = 0x80,
  952. },
  953. }, {
  954. .id = 0x73,
  955. .name = "displayd",
  956. .swgroup = TEGRA_SWGROUP_DC,
  957. .smmu = {
  958. .reg = 0x234,
  959. .bit = 19,
  960. },
  961. .la = {
  962. .reg = 0x3c8,
  963. .shift = 0,
  964. .mask = 0xff,
  965. .def = 0x50,
  966. },
  967. },
  968. };
  969. static const struct tegra_smmu_swgroup tegra124_swgroups[] = {
  970. { .name = "dc", .swgroup = TEGRA_SWGROUP_DC, .reg = 0x240 },
  971. { .name = "dcb", .swgroup = TEGRA_SWGROUP_DCB, .reg = 0x244 },
  972. { .name = "afi", .swgroup = TEGRA_SWGROUP_AFI, .reg = 0x238 },
  973. { .name = "avpc", .swgroup = TEGRA_SWGROUP_AVPC, .reg = 0x23c },
  974. { .name = "hda", .swgroup = TEGRA_SWGROUP_HDA, .reg = 0x254 },
  975. { .name = "hc", .swgroup = TEGRA_SWGROUP_HC, .reg = 0x250 },
  976. { .name = "msenc", .swgroup = TEGRA_SWGROUP_MSENC, .reg = 0x264 },
  977. { .name = "ppcs", .swgroup = TEGRA_SWGROUP_PPCS, .reg = 0x270 },
  978. { .name = "sata", .swgroup = TEGRA_SWGROUP_SATA, .reg = 0x274 },
  979. { .name = "vde", .swgroup = TEGRA_SWGROUP_VDE, .reg = 0x27c },
  980. { .name = "isp2", .swgroup = TEGRA_SWGROUP_ISP2, .reg = 0x258 },
  981. { .name = "xusb_host", .swgroup = TEGRA_SWGROUP_XUSB_HOST, .reg = 0x288 },
  982. { .name = "xusb_dev", .swgroup = TEGRA_SWGROUP_XUSB_DEV, .reg = 0x28c },
  983. { .name = "isp2b", .swgroup = TEGRA_SWGROUP_ISP2B, .reg = 0xaa4 },
  984. { .name = "tsec", .swgroup = TEGRA_SWGROUP_TSEC, .reg = 0x294 },
  985. { .name = "a9avp", .swgroup = TEGRA_SWGROUP_A9AVP, .reg = 0x290 },
  986. { .name = "gpu", .swgroup = TEGRA_SWGROUP_GPU, .reg = 0xaac },
  987. { .name = "sdmmc1a", .swgroup = TEGRA_SWGROUP_SDMMC1A, .reg = 0xa94 },
  988. { .name = "sdmmc2a", .swgroup = TEGRA_SWGROUP_SDMMC2A, .reg = 0xa98 },
  989. { .name = "sdmmc3a", .swgroup = TEGRA_SWGROUP_SDMMC3A, .reg = 0xa9c },
  990. { .name = "sdmmc4a", .swgroup = TEGRA_SWGROUP_SDMMC4A, .reg = 0xaa0 },
  991. { .name = "vic", .swgroup = TEGRA_SWGROUP_VIC, .reg = 0x284 },
  992. { .name = "vi", .swgroup = TEGRA_SWGROUP_VI, .reg = 0x280 },
  993. };
  994. #ifdef CONFIG_ARCH_TEGRA_124_SOC
  995. static const struct tegra_smmu_soc tegra124_smmu_soc = {
  996. .clients = tegra124_mc_clients,
  997. .num_clients = ARRAY_SIZE(tegra124_mc_clients),
  998. .swgroups = tegra124_swgroups,
  999. .num_swgroups = ARRAY_SIZE(tegra124_swgroups),
  1000. .supports_round_robin_arbitration = true,
  1001. .supports_request_limit = true,
  1002. .num_asids = 128,
  1003. };
  1004. const struct tegra_mc_soc tegra124_mc_soc = {
  1005. .clients = tegra124_mc_clients,
  1006. .num_clients = ARRAY_SIZE(tegra124_mc_clients),
  1007. .num_address_bits = 34,
  1008. .atom_size = 32,
  1009. .client_id_mask = 0x7f,
  1010. .smmu = &tegra124_smmu_soc,
  1011. .emem_regs = tegra124_mc_emem_regs,
  1012. .num_emem_regs = ARRAY_SIZE(tegra124_mc_emem_regs),
  1013. .intmask = MC_INT_DECERR_MTS | MC_INT_SECERR_SEC | MC_INT_DECERR_VPR |
  1014. MC_INT_INVALID_APB_ASID_UPDATE | MC_INT_INVALID_SMMU_PAGE |
  1015. MC_INT_SECURITY_VIOLATION | MC_INT_DECERR_EMEM,
  1016. };
  1017. #endif /* CONFIG_ARCH_TEGRA_124_SOC */
  1018. #ifdef CONFIG_ARCH_TEGRA_132_SOC
  1019. static const struct tegra_smmu_soc tegra132_smmu_soc = {
  1020. .clients = tegra124_mc_clients,
  1021. .num_clients = ARRAY_SIZE(tegra124_mc_clients),
  1022. .swgroups = tegra124_swgroups,
  1023. .num_swgroups = ARRAY_SIZE(tegra124_swgroups),
  1024. .supports_round_robin_arbitration = true,
  1025. .supports_request_limit = true,
  1026. .num_tlb_lines = 32,
  1027. .num_asids = 128,
  1028. };
  1029. const struct tegra_mc_soc tegra132_mc_soc = {
  1030. .clients = tegra124_mc_clients,
  1031. .num_clients = ARRAY_SIZE(tegra124_mc_clients),
  1032. .num_address_bits = 34,
  1033. .atom_size = 32,
  1034. .client_id_mask = 0x7f,
  1035. .smmu = &tegra132_smmu_soc,
  1036. .intmask = MC_INT_DECERR_MTS | MC_INT_SECERR_SEC | MC_INT_DECERR_VPR |
  1037. MC_INT_INVALID_APB_ASID_UPDATE | MC_INT_INVALID_SMMU_PAGE |
  1038. MC_INT_SECURITY_VIOLATION | MC_INT_DECERR_EMEM,
  1039. };
  1040. #endif /* CONFIG_ARCH_TEGRA_132_SOC */