tegra210.c 18 KB

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