Loading...
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (C) 2014 NVIDIA CORPORATION. All rights reserved.
4 */
5
6#include <linux/of.h>
7#include <linux/mm.h>
8
9#include <dt-bindings/memory/tegra114-mc.h>
10
11#include "mc.h"
12
13static const struct tegra_mc_client tegra114_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 = 0x4e,
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 = 0x4e,
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 = 0x4e,
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 = 0x4e,
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 = 0x4e,
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 = 0x4e,
101 },
102 }, {
103 .id = 0x09,
104 .name = "eppup",
105 .swgroup = TEGRA_SWGROUP_EPP,
106 .smmu = {
107 .reg = 0x228,
108 .bit = 9,
109 },
110 .la = {
111 .reg = 0x300,
112 .shift = 0,
113 .mask = 0xff,
114 .def = 0x33,
115 },
116 }, {
117 .id = 0x0a,
118 .name = "g2pr",
119 .swgroup = TEGRA_SWGROUP_G2,
120 .smmu = {
121 .reg = 0x228,
122 .bit = 10,
123 },
124 .la = {
125 .reg = 0x308,
126 .shift = 0,
127 .mask = 0xff,
128 .def = 0x09,
129 },
130 }, {
131 .id = 0x0b,
132 .name = "g2sr",
133 .swgroup = TEGRA_SWGROUP_G2,
134 .smmu = {
135 .reg = 0x228,
136 .bit = 11,
137 },
138 .la = {
139 .reg = 0x308,
140 .shift = 16,
141 .mask = 0xff,
142 .def = 0x09,
143 },
144 }, {
145 .id = 0x0f,
146 .name = "avpcarm7r",
147 .swgroup = TEGRA_SWGROUP_AVPC,
148 .smmu = {
149 .reg = 0x228,
150 .bit = 15,
151 },
152 .la = {
153 .reg = 0x2e4,
154 .shift = 0,
155 .mask = 0xff,
156 .def = 0x04,
157 },
158 }, {
159 .id = 0x10,
160 .name = "displayhc",
161 .swgroup = TEGRA_SWGROUP_DC,
162 .smmu = {
163 .reg = 0x228,
164 .bit = 16,
165 },
166 .la = {
167 .reg = 0x2f0,
168 .shift = 0,
169 .mask = 0xff,
170 .def = 0x68,
171 },
172 }, {
173 .id = 0x11,
174 .name = "displayhcb",
175 .swgroup = TEGRA_SWGROUP_DCB,
176 .smmu = {
177 .reg = 0x228,
178 .bit = 17,
179 },
180 .la = {
181 .reg = 0x2fc,
182 .shift = 0,
183 .mask = 0xff,
184 .def = 0x68,
185 },
186 }, {
187 .id = 0x12,
188 .name = "fdcdrd",
189 .swgroup = TEGRA_SWGROUP_NV,
190 .smmu = {
191 .reg = 0x228,
192 .bit = 18,
193 },
194 .la = {
195 .reg = 0x334,
196 .shift = 0,
197 .mask = 0xff,
198 .def = 0x0c,
199 },
200 }, {
201 .id = 0x13,
202 .name = "fdcdrd2",
203 .swgroup = TEGRA_SWGROUP_NV,
204 .smmu = {
205 .reg = 0x228,
206 .bit = 19,
207 },
208 .la = {
209 .reg = 0x33c,
210 .shift = 0,
211 .mask = 0xff,
212 .def = 0x0c,
213 },
214 }, {
215 .id = 0x14,
216 .name = "g2dr",
217 .swgroup = TEGRA_SWGROUP_G2,
218 .smmu = {
219 .reg = 0x228,
220 .bit = 20,
221 },
222 .la = {
223 .reg = 0x30c,
224 .shift = 0,
225 .mask = 0xff,
226 .def = 0x0a,
227 },
228 }, {
229 .id = 0x15,
230 .name = "hdar",
231 .swgroup = TEGRA_SWGROUP_HDA,
232 .smmu = {
233 .reg = 0x228,
234 .bit = 21,
235 },
236 .la = {
237 .reg = 0x318,
238 .shift = 0,
239 .mask = 0xff,
240 .def = 0xff,
241 },
242 }, {
243 .id = 0x16,
244 .name = "host1xdmar",
245 .swgroup = TEGRA_SWGROUP_HC,
246 .smmu = {
247 .reg = 0x228,
248 .bit = 22,
249 },
250 .la = {
251 .reg = 0x310,
252 .shift = 0,
253 .mask = 0xff,
254 .def = 0x10,
255 },
256 }, {
257 .id = 0x17,
258 .name = "host1xr",
259 .swgroup = TEGRA_SWGROUP_HC,
260 .smmu = {
261 .reg = 0x228,
262 .bit = 23,
263 },
264 .la = {
265 .reg = 0x310,
266 .shift = 16,
267 .mask = 0xff,
268 .def = 0xa5,
269 },
270 }, {
271 .id = 0x18,
272 .name = "idxsrd",
273 .swgroup = TEGRA_SWGROUP_NV,
274 .smmu = {
275 .reg = 0x228,
276 .bit = 24,
277 },
278 .la = {
279 .reg = 0x334,
280 .shift = 16,
281 .mask = 0xff,
282 .def = 0x0b,
283 },
284 }, {
285 .id = 0x1c,
286 .name = "msencsrd",
287 .swgroup = TEGRA_SWGROUP_MSENC,
288 .smmu = {
289 .reg = 0x228,
290 .bit = 28,
291 },
292 .la = {
293 .reg = 0x328,
294 .shift = 0,
295 .mask = 0xff,
296 .def = 0x80,
297 },
298 }, {
299 .id = 0x1d,
300 .name = "ppcsahbdmar",
301 .swgroup = TEGRA_SWGROUP_PPCS,
302 .smmu = {
303 .reg = 0x228,
304 .bit = 29,
305 },
306 .la = {
307 .reg = 0x344,
308 .shift = 0,
309 .mask = 0xff,
310 .def = 0x50,
311 },
312 }, {
313 .id = 0x1e,
314 .name = "ppcsahbslvr",
315 .swgroup = TEGRA_SWGROUP_PPCS,
316 .smmu = {
317 .reg = 0x228,
318 .bit = 30,
319 },
320 .la = {
321 .reg = 0x344,
322 .shift = 16,
323 .mask = 0xff,
324 .def = 0xe8,
325 },
326 }, {
327 .id = 0x20,
328 .name = "texl2srd",
329 .swgroup = TEGRA_SWGROUP_NV,
330 .smmu = {
331 .reg = 0x22c,
332 .bit = 0,
333 },
334 .la = {
335 .reg = 0x338,
336 .shift = 0,
337 .mask = 0xff,
338 .def = 0x0c,
339 },
340 }, {
341 .id = 0x22,
342 .name = "vdebsevr",
343 .swgroup = TEGRA_SWGROUP_VDE,
344 .smmu = {
345 .reg = 0x22c,
346 .bit = 2,
347 },
348 .la = {
349 .reg = 0x354,
350 .shift = 0,
351 .mask = 0xff,
352 .def = 0xff,
353 },
354 }, {
355 .id = 0x23,
356 .name = "vdember",
357 .swgroup = TEGRA_SWGROUP_VDE,
358 .smmu = {
359 .reg = 0x22c,
360 .bit = 3,
361 },
362 .la = {
363 .reg = 0x354,
364 .shift = 16,
365 .mask = 0xff,
366 .def = 0xff,
367 },
368 }, {
369 .id = 0x24,
370 .name = "vdemcer",
371 .swgroup = TEGRA_SWGROUP_VDE,
372 .smmu = {
373 .reg = 0x22c,
374 .bit = 4,
375 },
376 .la = {
377 .reg = 0x358,
378 .shift = 0,
379 .mask = 0xff,
380 .def = 0xb8,
381 },
382 }, {
383 .id = 0x25,
384 .name = "vdetper",
385 .swgroup = TEGRA_SWGROUP_VDE,
386 .smmu = {
387 .reg = 0x22c,
388 .bit = 5,
389 },
390 .la = {
391 .reg = 0x358,
392 .shift = 16,
393 .mask = 0xff,
394 .def = 0xee,
395 },
396 }, {
397 .id = 0x26,
398 .name = "mpcorelpr",
399 .swgroup = TEGRA_SWGROUP_MPCORELP,
400 .la = {
401 .reg = 0x324,
402 .shift = 0,
403 .mask = 0xff,
404 .def = 0x04,
405 },
406 }, {
407 .id = 0x27,
408 .name = "mpcorer",
409 .swgroup = TEGRA_SWGROUP_MPCORE,
410 .la = {
411 .reg = 0x320,
412 .shift = 0,
413 .mask = 0xff,
414 .def = 0x04,
415 },
416 }, {
417 .id = 0x28,
418 .name = "eppu",
419 .swgroup = TEGRA_SWGROUP_EPP,
420 .smmu = {
421 .reg = 0x22c,
422 .bit = 8,
423 },
424 .la = {
425 .reg = 0x300,
426 .shift = 16,
427 .mask = 0xff,
428 .def = 0x33,
429 },
430 }, {
431 .id = 0x29,
432 .name = "eppv",
433 .swgroup = TEGRA_SWGROUP_EPP,
434 .smmu = {
435 .reg = 0x22c,
436 .bit = 9,
437 },
438 .la = {
439 .reg = 0x304,
440 .shift = 0,
441 .mask = 0xff,
442 .def = 0x6c,
443 },
444 }, {
445 .id = 0x2a,
446 .name = "eppy",
447 .swgroup = TEGRA_SWGROUP_EPP,
448 .smmu = {
449 .reg = 0x22c,
450 .bit = 10,
451 },
452 .la = {
453 .reg = 0x304,
454 .shift = 16,
455 .mask = 0xff,
456 .def = 0x6c,
457 },
458 }, {
459 .id = 0x2b,
460 .name = "msencswr",
461 .swgroup = TEGRA_SWGROUP_MSENC,
462 .smmu = {
463 .reg = 0x22c,
464 .bit = 11,
465 },
466 .la = {
467 .reg = 0x328,
468 .shift = 16,
469 .mask = 0xff,
470 .def = 0x80,
471 },
472 }, {
473 .id = 0x2c,
474 .name = "viwsb",
475 .swgroup = TEGRA_SWGROUP_VI,
476 .smmu = {
477 .reg = 0x22c,
478 .bit = 12,
479 },
480 .la = {
481 .reg = 0x364,
482 .shift = 0,
483 .mask = 0xff,
484 .def = 0x47,
485 },
486 }, {
487 .id = 0x2d,
488 .name = "viwu",
489 .swgroup = TEGRA_SWGROUP_VI,
490 .smmu = {
491 .reg = 0x22c,
492 .bit = 13,
493 },
494 .la = {
495 .reg = 0x368,
496 .shift = 0,
497 .mask = 0xff,
498 .def = 0xff,
499 },
500 }, {
501 .id = 0x2e,
502 .name = "viwv",
503 .swgroup = TEGRA_SWGROUP_VI,
504 .smmu = {
505 .reg = 0x22c,
506 .bit = 14,
507 },
508 .la = {
509 .reg = 0x368,
510 .shift = 16,
511 .mask = 0xff,
512 .def = 0xff,
513 },
514 }, {
515 .id = 0x2f,
516 .name = "viwy",
517 .swgroup = TEGRA_SWGROUP_VI,
518 .smmu = {
519 .reg = 0x22c,
520 .bit = 15,
521 },
522 .la = {
523 .reg = 0x36c,
524 .shift = 0,
525 .mask = 0xff,
526 .def = 0x47,
527 },
528 }, {
529 .id = 0x30,
530 .name = "g2dw",
531 .swgroup = TEGRA_SWGROUP_G2,
532 .smmu = {
533 .reg = 0x22c,
534 .bit = 16,
535 },
536 .la = {
537 .reg = 0x30c,
538 .shift = 16,
539 .mask = 0xff,
540 .def = 0x9,
541 },
542 }, {
543 .id = 0x32,
544 .name = "avpcarm7w",
545 .swgroup = TEGRA_SWGROUP_AVPC,
546 .smmu = {
547 .reg = 0x22c,
548 .bit = 18,
549 },
550 .la = {
551 .reg = 0x2e4,
552 .shift = 16,
553 .mask = 0xff,
554 .def = 0x0e,
555 },
556 }, {
557 .id = 0x33,
558 .name = "fdcdwr",
559 .swgroup = TEGRA_SWGROUP_NV,
560 .smmu = {
561 .reg = 0x22c,
562 .bit = 19,
563 },
564 .la = {
565 .reg = 0x338,
566 .shift = 16,
567 .mask = 0xff,
568 .def = 0x10,
569 },
570 }, {
571 .id = 0x34,
572 .name = "fdcdwr2",
573 .swgroup = TEGRA_SWGROUP_NV,
574 .smmu = {
575 .reg = 0x22c,
576 .bit = 20,
577 },
578 .la = {
579 .reg = 0x340,
580 .shift = 0,
581 .mask = 0xff,
582 .def = 0x10,
583 },
584 }, {
585 .id = 0x35,
586 .name = "hdaw",
587 .swgroup = TEGRA_SWGROUP_HDA,
588 .smmu = {
589 .reg = 0x22c,
590 .bit = 21,
591 },
592 .la = {
593 .reg = 0x318,
594 .shift = 16,
595 .mask = 0xff,
596 .def = 0xff,
597 },
598 }, {
599 .id = 0x36,
600 .name = "host1xw",
601 .swgroup = TEGRA_SWGROUP_HC,
602 .smmu = {
603 .reg = 0x22c,
604 .bit = 22,
605 },
606 .la = {
607 .reg = 0x314,
608 .shift = 0,
609 .mask = 0xff,
610 .def = 0x25,
611 },
612 }, {
613 .id = 0x37,
614 .name = "ispw",
615 .swgroup = TEGRA_SWGROUP_ISP,
616 .smmu = {
617 .reg = 0x22c,
618 .bit = 23,
619 },
620 .la = {
621 .reg = 0x31c,
622 .shift = 0,
623 .mask = 0xff,
624 .def = 0xff,
625 },
626 }, {
627 .id = 0x38,
628 .name = "mpcorelpw",
629 .swgroup = TEGRA_SWGROUP_MPCORELP,
630 .la = {
631 .reg = 0x324,
632 .shift = 16,
633 .mask = 0xff,
634 .def = 0x80,
635 },
636 }, {
637 .id = 0x39,
638 .name = "mpcorew",
639 .swgroup = TEGRA_SWGROUP_MPCORE,
640 .la = {
641 .reg = 0x320,
642 .shift = 16,
643 .mask = 0xff,
644 .def = 0x0e,
645 },
646 }, {
647 .id = 0x3b,
648 .name = "ppcsahbdmaw",
649 .swgroup = TEGRA_SWGROUP_PPCS,
650 .smmu = {
651 .reg = 0x22c,
652 .bit = 27,
653 },
654 .la = {
655 .reg = 0x348,
656 .shift = 0,
657 .mask = 0xff,
658 .def = 0xa5,
659 },
660 }, {
661 .id = 0x3c,
662 .name = "ppcsahbslvw",
663 .swgroup = TEGRA_SWGROUP_PPCS,
664 .smmu = {
665 .reg = 0x22c,
666 .bit = 28,
667 },
668 .la = {
669 .reg = 0x348,
670 .shift = 16,
671 .mask = 0xff,
672 .def = 0xe8,
673 },
674 }, {
675 .id = 0x3e,
676 .name = "vdebsevw",
677 .swgroup = TEGRA_SWGROUP_VDE,
678 .smmu = {
679 .reg = 0x22c,
680 .bit = 30,
681 },
682 .la = {
683 .reg = 0x35c,
684 .shift = 0,
685 .mask = 0xff,
686 .def = 0xff,
687 },
688 }, {
689 .id = 0x3f,
690 .name = "vdedbgw",
691 .swgroup = TEGRA_SWGROUP_VDE,
692 .smmu = {
693 .reg = 0x22c,
694 .bit = 31,
695 },
696 .la = {
697 .reg = 0x35c,
698 .shift = 16,
699 .mask = 0xff,
700 .def = 0xff,
701 },
702 }, {
703 .id = 0x40,
704 .name = "vdembew",
705 .swgroup = TEGRA_SWGROUP_VDE,
706 .smmu = {
707 .reg = 0x230,
708 .bit = 0,
709 },
710 .la = {
711 .reg = 0x360,
712 .shift = 0,
713 .mask = 0xff,
714 .def = 0x89,
715 },
716 }, {
717 .id = 0x41,
718 .name = "vdetpmw",
719 .swgroup = TEGRA_SWGROUP_VDE,
720 .smmu = {
721 .reg = 0x230,
722 .bit = 1,
723 },
724 .la = {
725 .reg = 0x360,
726 .shift = 16,
727 .mask = 0xff,
728 .def = 0x59,
729 },
730 }, {
731 .id = 0x4a,
732 .name = "xusb_hostr",
733 .swgroup = TEGRA_SWGROUP_XUSB_HOST,
734 .smmu = {
735 .reg = 0x230,
736 .bit = 10,
737 },
738 .la = {
739 .reg = 0x37c,
740 .shift = 0,
741 .mask = 0xff,
742 .def = 0xa5,
743 },
744 }, {
745 .id = 0x4b,
746 .name = "xusb_hostw",
747 .swgroup = TEGRA_SWGROUP_XUSB_HOST,
748 .smmu = {
749 .reg = 0x230,
750 .bit = 11,
751 },
752 .la = {
753 .reg = 0x37c,
754 .shift = 16,
755 .mask = 0xff,
756 .def = 0xa5,
757 },
758 }, {
759 .id = 0x4c,
760 .name = "xusb_devr",
761 .swgroup = TEGRA_SWGROUP_XUSB_DEV,
762 .smmu = {
763 .reg = 0x230,
764 .bit = 12,
765 },
766 .la = {
767 .reg = 0x380,
768 .shift = 0,
769 .mask = 0xff,
770 .def = 0xa5,
771 },
772 }, {
773 .id = 0x4d,
774 .name = "xusb_devw",
775 .swgroup = TEGRA_SWGROUP_XUSB_DEV,
776 .smmu = {
777 .reg = 0x230,
778 .bit = 13,
779 },
780 .la = {
781 .reg = 0x380,
782 .shift = 16,
783 .mask = 0xff,
784 .def = 0xa5,
785 },
786 }, {
787 .id = 0x4e,
788 .name = "fdcdwr3",
789 .swgroup = TEGRA_SWGROUP_NV,
790 .smmu = {
791 .reg = 0x230,
792 .bit = 14,
793 },
794 .la = {
795 .reg = 0x388,
796 .shift = 0,
797 .mask = 0xff,
798 .def = 0x10,
799 },
800 }, {
801 .id = 0x4f,
802 .name = "fdcdrd3",
803 .swgroup = TEGRA_SWGROUP_NV,
804 .smmu = {
805 .reg = 0x230,
806 .bit = 15,
807 },
808 .la = {
809 .reg = 0x384,
810 .shift = 0,
811 .mask = 0xff,
812 .def = 0x0c,
813 },
814 }, {
815 .id = 0x50,
816 .name = "fdcwr4",
817 .swgroup = TEGRA_SWGROUP_NV,
818 .smmu = {
819 .reg = 0x230,
820 .bit = 16,
821 },
822 .la = {
823 .reg = 0x388,
824 .shift = 16,
825 .mask = 0xff,
826 .def = 0x10,
827 },
828 }, {
829 .id = 0x51,
830 .name = "fdcrd4",
831 .swgroup = TEGRA_SWGROUP_NV,
832 .smmu = {
833 .reg = 0x230,
834 .bit = 17,
835 },
836 .la = {
837 .reg = 0x384,
838 .shift = 16,
839 .mask = 0xff,
840 .def = 0x0c,
841 },
842 }, {
843 .id = 0x52,
844 .name = "emucifr",
845 .swgroup = TEGRA_SWGROUP_EMUCIF,
846 .la = {
847 .reg = 0x38c,
848 .shift = 0,
849 .mask = 0xff,
850 .def = 0x04,
851 },
852 }, {
853 .id = 0x53,
854 .name = "emucifw",
855 .swgroup = TEGRA_SWGROUP_EMUCIF,
856 .la = {
857 .reg = 0x38c,
858 .shift = 16,
859 .mask = 0xff,
860 .def = 0x0e,
861 },
862 }, {
863 .id = 0x54,
864 .name = "tsecsrd",
865 .swgroup = TEGRA_SWGROUP_TSEC,
866 .smmu = {
867 .reg = 0x230,
868 .bit = 20,
869 },
870 .la = {
871 .reg = 0x390,
872 .shift = 0,
873 .mask = 0xff,
874 .def = 0x50,
875 },
876 }, {
877 .id = 0x55,
878 .name = "tsecswr",
879 .swgroup = TEGRA_SWGROUP_TSEC,
880 .smmu = {
881 .reg = 0x230,
882 .bit = 21,
883 },
884 .la = {
885 .reg = 0x390,
886 .shift = 16,
887 .mask = 0xff,
888 .def = 0x50,
889 },
890 },
891};
892
893static const struct tegra_smmu_swgroup tegra114_swgroups[] = {
894 { .name = "dc", .swgroup = TEGRA_SWGROUP_DC, .reg = 0x240 },
895 { .name = "dcb", .swgroup = TEGRA_SWGROUP_DCB, .reg = 0x244 },
896 { .name = "epp", .swgroup = TEGRA_SWGROUP_EPP, .reg = 0x248 },
897 { .name = "g2", .swgroup = TEGRA_SWGROUP_G2, .reg = 0x24c },
898 { .name = "avpc", .swgroup = TEGRA_SWGROUP_AVPC, .reg = 0x23c },
899 { .name = "nv", .swgroup = TEGRA_SWGROUP_NV, .reg = 0x268 },
900 { .name = "hda", .swgroup = TEGRA_SWGROUP_HDA, .reg = 0x254 },
901 { .name = "hc", .swgroup = TEGRA_SWGROUP_HC, .reg = 0x250 },
902 { .name = "msenc", .swgroup = TEGRA_SWGROUP_MSENC, .reg = 0x264 },
903 { .name = "ppcs", .swgroup = TEGRA_SWGROUP_PPCS, .reg = 0x270 },
904 { .name = "vde", .swgroup = TEGRA_SWGROUP_VDE, .reg = 0x27c },
905 { .name = "vi", .swgroup = TEGRA_SWGROUP_VI, .reg = 0x280 },
906 { .name = "isp", .swgroup = TEGRA_SWGROUP_ISP, .reg = 0x258 },
907 { .name = "xusb_host", .swgroup = TEGRA_SWGROUP_XUSB_HOST, .reg = 0x288 },
908 { .name = "xusb_dev", .swgroup = TEGRA_SWGROUP_XUSB_DEV, .reg = 0x28c },
909 { .name = "tsec", .swgroup = TEGRA_SWGROUP_TSEC, .reg = 0x294 },
910};
911
912static const unsigned int tegra114_group_display[] = {
913 TEGRA_SWGROUP_DC,
914 TEGRA_SWGROUP_DCB,
915};
916
917static const struct tegra_smmu_group_soc tegra114_groups[] = {
918 {
919 .name = "display",
920 .swgroups = tegra114_group_display,
921 .num_swgroups = ARRAY_SIZE(tegra114_group_display),
922 },
923};
924
925static const struct tegra_smmu_soc tegra114_smmu_soc = {
926 .clients = tegra114_mc_clients,
927 .num_clients = ARRAY_SIZE(tegra114_mc_clients),
928 .swgroups = tegra114_swgroups,
929 .num_swgroups = ARRAY_SIZE(tegra114_swgroups),
930 .groups = tegra114_groups,
931 .num_groups = ARRAY_SIZE(tegra114_groups),
932 .supports_round_robin_arbitration = false,
933 .supports_request_limit = false,
934 .num_tlb_lines = 32,
935 .num_asids = 4,
936};
937
938#define TEGRA114_MC_RESET(_name, _control, _status, _bit) \
939 { \
940 .name = #_name, \
941 .id = TEGRA114_MC_RESET_##_name, \
942 .control = _control, \
943 .status = _status, \
944 .bit = _bit, \
945 }
946
947static const struct tegra_mc_reset tegra114_mc_resets[] = {
948 TEGRA114_MC_RESET(AVPC, 0x200, 0x204, 1),
949 TEGRA114_MC_RESET(DC, 0x200, 0x204, 2),
950 TEGRA114_MC_RESET(DCB, 0x200, 0x204, 3),
951 TEGRA114_MC_RESET(EPP, 0x200, 0x204, 4),
952 TEGRA114_MC_RESET(2D, 0x200, 0x204, 5),
953 TEGRA114_MC_RESET(HC, 0x200, 0x204, 6),
954 TEGRA114_MC_RESET(HDA, 0x200, 0x204, 7),
955 TEGRA114_MC_RESET(ISP, 0x200, 0x204, 8),
956 TEGRA114_MC_RESET(MPCORE, 0x200, 0x204, 9),
957 TEGRA114_MC_RESET(MPCORELP, 0x200, 0x204, 10),
958 TEGRA114_MC_RESET(MPE, 0x200, 0x204, 11),
959 TEGRA114_MC_RESET(3D, 0x200, 0x204, 12),
960 TEGRA114_MC_RESET(3D2, 0x200, 0x204, 13),
961 TEGRA114_MC_RESET(PPCS, 0x200, 0x204, 14),
962 TEGRA114_MC_RESET(VDE, 0x200, 0x204, 16),
963 TEGRA114_MC_RESET(VI, 0x200, 0x204, 17),
964};
965
966const struct tegra_mc_soc tegra114_mc_soc = {
967 .clients = tegra114_mc_clients,
968 .num_clients = ARRAY_SIZE(tegra114_mc_clients),
969 .num_address_bits = 32,
970 .atom_size = 32,
971 .client_id_mask = 0x7f,
972 .smmu = &tegra114_smmu_soc,
973 .intmask = MC_INT_INVALID_SMMU_PAGE | MC_INT_SECURITY_VIOLATION |
974 MC_INT_DECERR_EMEM,
975 .reset_ops = &tegra_mc_reset_ops_common,
976 .resets = tegra114_mc_resets,
977 .num_resets = ARRAY_SIZE(tegra114_mc_resets),
978};
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (C) 2014 NVIDIA CORPORATION. All rights reserved.
4 */
5
6#include <linux/of.h>
7#include <linux/mm.h>
8
9#include <dt-bindings/memory/tegra114-mc.h>
10
11#include "mc.h"
12
13static const struct tegra_mc_client tegra114_mc_clients[] = {
14 {
15 .id = 0x00,
16 .name = "ptcr",
17 .swgroup = TEGRA_SWGROUP_PTC,
18 .regs = {
19 .la = {
20 .reg = 0x34c,
21 .shift = 0,
22 .mask = 0xff,
23 .def = 0x0,
24 },
25 },
26 }, {
27 .id = 0x01,
28 .name = "display0a",
29 .swgroup = TEGRA_SWGROUP_DC,
30 .regs = {
31 .smmu = {
32 .reg = 0x228,
33 .bit = 1,
34 },
35 .la = {
36 .reg = 0x2e8,
37 .shift = 0,
38 .mask = 0xff,
39 .def = 0x4e,
40 },
41 },
42 }, {
43 .id = 0x02,
44 .name = "display0ab",
45 .swgroup = TEGRA_SWGROUP_DCB,
46 .regs = {
47 .smmu = {
48 .reg = 0x228,
49 .bit = 2,
50 },
51 .la = {
52 .reg = 0x2f4,
53 .shift = 0,
54 .mask = 0xff,
55 .def = 0x4e,
56 },
57 },
58 }, {
59 .id = 0x03,
60 .name = "display0b",
61 .swgroup = TEGRA_SWGROUP_DC,
62 .regs = {
63 .smmu = {
64 .reg = 0x228,
65 .bit = 3,
66 },
67 .la = {
68 .reg = 0x2e8,
69 .shift = 16,
70 .mask = 0xff,
71 .def = 0x4e,
72 },
73 },
74 }, {
75 .id = 0x04,
76 .name = "display0bb",
77 .swgroup = TEGRA_SWGROUP_DCB,
78 .regs = {
79 .smmu = {
80 .reg = 0x228,
81 .bit = 4,
82 },
83 .la = {
84 .reg = 0x2f4,
85 .shift = 16,
86 .mask = 0xff,
87 .def = 0x4e,
88 },
89 },
90 }, {
91 .id = 0x05,
92 .name = "display0c",
93 .swgroup = TEGRA_SWGROUP_DC,
94 .regs = {
95 .smmu = {
96 .reg = 0x228,
97 .bit = 5,
98 },
99 .la = {
100 .reg = 0x2ec,
101 .shift = 0,
102 .mask = 0xff,
103 .def = 0x4e,
104 },
105 },
106 }, {
107 .id = 0x06,
108 .name = "display0cb",
109 .swgroup = TEGRA_SWGROUP_DCB,
110 .regs = {
111 .smmu = {
112 .reg = 0x228,
113 .bit = 6,
114 },
115 .la = {
116 .reg = 0x2f8,
117 .shift = 0,
118 .mask = 0xff,
119 .def = 0x4e,
120 },
121 },
122 }, {
123 .id = 0x09,
124 .name = "eppup",
125 .swgroup = TEGRA_SWGROUP_EPP,
126 .regs = {
127 .smmu = {
128 .reg = 0x228,
129 .bit = 9,
130 },
131 .la = {
132 .reg = 0x300,
133 .shift = 0,
134 .mask = 0xff,
135 .def = 0x33,
136 },
137 },
138 }, {
139 .id = 0x0a,
140 .name = "g2pr",
141 .swgroup = TEGRA_SWGROUP_G2,
142 .regs = {
143 .smmu = {
144 .reg = 0x228,
145 .bit = 10,
146 },
147 .la = {
148 .reg = 0x308,
149 .shift = 0,
150 .mask = 0xff,
151 .def = 0x09,
152 },
153 },
154 }, {
155 .id = 0x0b,
156 .name = "g2sr",
157 .swgroup = TEGRA_SWGROUP_G2,
158 .regs = {
159 .smmu = {
160 .reg = 0x228,
161 .bit = 11,
162 },
163 .la = {
164 .reg = 0x308,
165 .shift = 16,
166 .mask = 0xff,
167 .def = 0x09,
168 },
169 },
170 }, {
171 .id = 0x0f,
172 .name = "avpcarm7r",
173 .swgroup = TEGRA_SWGROUP_AVPC,
174 .regs = {
175 .smmu = {
176 .reg = 0x228,
177 .bit = 15,
178 },
179 .la = {
180 .reg = 0x2e4,
181 .shift = 0,
182 .mask = 0xff,
183 .def = 0x04,
184 },
185 },
186 }, {
187 .id = 0x10,
188 .name = "displayhc",
189 .swgroup = TEGRA_SWGROUP_DC,
190 .regs = {
191 .smmu = {
192 .reg = 0x228,
193 .bit = 16,
194 },
195 .la = {
196 .reg = 0x2f0,
197 .shift = 0,
198 .mask = 0xff,
199 .def = 0x68,
200 },
201 },
202 }, {
203 .id = 0x11,
204 .name = "displayhcb",
205 .swgroup = TEGRA_SWGROUP_DCB,
206 .regs = {
207 .smmu = {
208 .reg = 0x228,
209 .bit = 17,
210 },
211 .la = {
212 .reg = 0x2fc,
213 .shift = 0,
214 .mask = 0xff,
215 .def = 0x68,
216 },
217 },
218 }, {
219 .id = 0x12,
220 .name = "fdcdrd",
221 .swgroup = TEGRA_SWGROUP_NV,
222 .regs = {
223 .smmu = {
224 .reg = 0x228,
225 .bit = 18,
226 },
227 .la = {
228 .reg = 0x334,
229 .shift = 0,
230 .mask = 0xff,
231 .def = 0x0c,
232 },
233 },
234 }, {
235 .id = 0x13,
236 .name = "fdcdrd2",
237 .swgroup = TEGRA_SWGROUP_NV,
238 .regs = {
239 .smmu = {
240 .reg = 0x228,
241 .bit = 19,
242 },
243 .la = {
244 .reg = 0x33c,
245 .shift = 0,
246 .mask = 0xff,
247 .def = 0x0c,
248 },
249 },
250 }, {
251 .id = 0x14,
252 .name = "g2dr",
253 .swgroup = TEGRA_SWGROUP_G2,
254 .regs = {
255 .smmu = {
256 .reg = 0x228,
257 .bit = 20,
258 },
259 .la = {
260 .reg = 0x30c,
261 .shift = 0,
262 .mask = 0xff,
263 .def = 0x0a,
264 },
265 },
266 }, {
267 .id = 0x15,
268 .name = "hdar",
269 .swgroup = TEGRA_SWGROUP_HDA,
270 .regs = {
271 .smmu = {
272 .reg = 0x228,
273 .bit = 21,
274 },
275 .la = {
276 .reg = 0x318,
277 .shift = 0,
278 .mask = 0xff,
279 .def = 0xff,
280 },
281 },
282 }, {
283 .id = 0x16,
284 .name = "host1xdmar",
285 .swgroup = TEGRA_SWGROUP_HC,
286 .regs = {
287 .smmu = {
288 .reg = 0x228,
289 .bit = 22,
290 },
291 .la = {
292 .reg = 0x310,
293 .shift = 0,
294 .mask = 0xff,
295 .def = 0x10,
296 },
297 },
298 }, {
299 .id = 0x17,
300 .name = "host1xr",
301 .swgroup = TEGRA_SWGROUP_HC,
302 .regs = {
303 .smmu = {
304 .reg = 0x228,
305 .bit = 23,
306 },
307 .la = {
308 .reg = 0x310,
309 .shift = 16,
310 .mask = 0xff,
311 .def = 0xa5,
312 },
313 },
314 }, {
315 .id = 0x18,
316 .name = "idxsrd",
317 .swgroup = TEGRA_SWGROUP_NV,
318 .regs = {
319 .smmu = {
320 .reg = 0x228,
321 .bit = 24,
322 },
323 .la = {
324 .reg = 0x334,
325 .shift = 16,
326 .mask = 0xff,
327 .def = 0x0b,
328 },
329 },
330 }, {
331 .id = 0x1c,
332 .name = "msencsrd",
333 .swgroup = TEGRA_SWGROUP_MSENC,
334 .regs = {
335 .smmu = {
336 .reg = 0x228,
337 .bit = 28,
338 },
339 .la = {
340 .reg = 0x328,
341 .shift = 0,
342 .mask = 0xff,
343 .def = 0x80,
344 },
345 },
346 }, {
347 .id = 0x1d,
348 .name = "ppcsahbdmar",
349 .swgroup = TEGRA_SWGROUP_PPCS,
350 .regs = {
351 .smmu = {
352 .reg = 0x228,
353 .bit = 29,
354 },
355 .la = {
356 .reg = 0x344,
357 .shift = 0,
358 .mask = 0xff,
359 .def = 0x50,
360 },
361 },
362 }, {
363 .id = 0x1e,
364 .name = "ppcsahbslvr",
365 .swgroup = TEGRA_SWGROUP_PPCS,
366 .regs = {
367 .smmu = {
368 .reg = 0x228,
369 .bit = 30,
370 },
371 .la = {
372 .reg = 0x344,
373 .shift = 16,
374 .mask = 0xff,
375 .def = 0xe8,
376 },
377 },
378 }, {
379 .id = 0x20,
380 .name = "texl2srd",
381 .swgroup = TEGRA_SWGROUP_NV,
382 .regs = {
383 .smmu = {
384 .reg = 0x22c,
385 .bit = 0,
386 },
387 .la = {
388 .reg = 0x338,
389 .shift = 0,
390 .mask = 0xff,
391 .def = 0x0c,
392 },
393 },
394 }, {
395 .id = 0x22,
396 .name = "vdebsevr",
397 .swgroup = TEGRA_SWGROUP_VDE,
398 .regs = {
399 .smmu = {
400 .reg = 0x22c,
401 .bit = 2,
402 },
403 .la = {
404 .reg = 0x354,
405 .shift = 0,
406 .mask = 0xff,
407 .def = 0xff,
408 },
409 },
410 }, {
411 .id = 0x23,
412 .name = "vdember",
413 .swgroup = TEGRA_SWGROUP_VDE,
414 .regs = {
415 .smmu = {
416 .reg = 0x22c,
417 .bit = 3,
418 },
419 .la = {
420 .reg = 0x354,
421 .shift = 16,
422 .mask = 0xff,
423 .def = 0xff,
424 },
425 },
426 }, {
427 .id = 0x24,
428 .name = "vdemcer",
429 .swgroup = TEGRA_SWGROUP_VDE,
430 .regs = {
431 .smmu = {
432 .reg = 0x22c,
433 .bit = 4,
434 },
435 .la = {
436 .reg = 0x358,
437 .shift = 0,
438 .mask = 0xff,
439 .def = 0xb8,
440 },
441 },
442 }, {
443 .id = 0x25,
444 .name = "vdetper",
445 .swgroup = TEGRA_SWGROUP_VDE,
446 .regs = {
447 .smmu = {
448 .reg = 0x22c,
449 .bit = 5,
450 },
451 .la = {
452 .reg = 0x358,
453 .shift = 16,
454 .mask = 0xff,
455 .def = 0xee,
456 },
457 },
458 }, {
459 .id = 0x26,
460 .name = "mpcorelpr",
461 .swgroup = TEGRA_SWGROUP_MPCORELP,
462 .regs = {
463 .la = {
464 .reg = 0x324,
465 .shift = 0,
466 .mask = 0xff,
467 .def = 0x04,
468 },
469 },
470 }, {
471 .id = 0x27,
472 .name = "mpcorer",
473 .swgroup = TEGRA_SWGROUP_MPCORE,
474 .regs = {
475 .la = {
476 .reg = 0x320,
477 .shift = 0,
478 .mask = 0xff,
479 .def = 0x04,
480 },
481 },
482 }, {
483 .id = 0x28,
484 .name = "eppu",
485 .swgroup = TEGRA_SWGROUP_EPP,
486 .regs = {
487 .smmu = {
488 .reg = 0x22c,
489 .bit = 8,
490 },
491 .la = {
492 .reg = 0x300,
493 .shift = 16,
494 .mask = 0xff,
495 .def = 0x33,
496 },
497 },
498 }, {
499 .id = 0x29,
500 .name = "eppv",
501 .swgroup = TEGRA_SWGROUP_EPP,
502 .regs = {
503 .smmu = {
504 .reg = 0x22c,
505 .bit = 9,
506 },
507 .la = {
508 .reg = 0x304,
509 .shift = 0,
510 .mask = 0xff,
511 .def = 0x6c,
512 },
513 },
514 }, {
515 .id = 0x2a,
516 .name = "eppy",
517 .swgroup = TEGRA_SWGROUP_EPP,
518 .regs = {
519 .smmu = {
520 .reg = 0x22c,
521 .bit = 10,
522 },
523 .la = {
524 .reg = 0x304,
525 .shift = 16,
526 .mask = 0xff,
527 .def = 0x6c,
528 },
529 },
530 }, {
531 .id = 0x2b,
532 .name = "msencswr",
533 .swgroup = TEGRA_SWGROUP_MSENC,
534 .regs = {
535 .smmu = {
536 .reg = 0x22c,
537 .bit = 11,
538 },
539 .la = {
540 .reg = 0x328,
541 .shift = 16,
542 .mask = 0xff,
543 .def = 0x80,
544 },
545 },
546 }, {
547 .id = 0x2c,
548 .name = "viwsb",
549 .swgroup = TEGRA_SWGROUP_VI,
550 .regs = {
551 .smmu = {
552 .reg = 0x22c,
553 .bit = 12,
554 },
555 .la = {
556 .reg = 0x364,
557 .shift = 0,
558 .mask = 0xff,
559 .def = 0x47,
560 },
561 },
562 }, {
563 .id = 0x2d,
564 .name = "viwu",
565 .swgroup = TEGRA_SWGROUP_VI,
566 .regs = {
567 .smmu = {
568 .reg = 0x22c,
569 .bit = 13,
570 },
571 .la = {
572 .reg = 0x368,
573 .shift = 0,
574 .mask = 0xff,
575 .def = 0xff,
576 },
577 },
578 }, {
579 .id = 0x2e,
580 .name = "viwv",
581 .swgroup = TEGRA_SWGROUP_VI,
582 .regs = {
583 .smmu = {
584 .reg = 0x22c,
585 .bit = 14,
586 },
587 .la = {
588 .reg = 0x368,
589 .shift = 16,
590 .mask = 0xff,
591 .def = 0xff,
592 },
593 },
594 }, {
595 .id = 0x2f,
596 .name = "viwy",
597 .swgroup = TEGRA_SWGROUP_VI,
598 .regs = {
599 .smmu = {
600 .reg = 0x22c,
601 .bit = 15,
602 },
603 .la = {
604 .reg = 0x36c,
605 .shift = 0,
606 .mask = 0xff,
607 .def = 0x47,
608 },
609 },
610 }, {
611 .id = 0x30,
612 .name = "g2dw",
613 .swgroup = TEGRA_SWGROUP_G2,
614 .regs = {
615 .smmu = {
616 .reg = 0x22c,
617 .bit = 16,
618 },
619 .la = {
620 .reg = 0x30c,
621 .shift = 16,
622 .mask = 0xff,
623 .def = 0x9,
624 },
625 },
626 }, {
627 .id = 0x32,
628 .name = "avpcarm7w",
629 .swgroup = TEGRA_SWGROUP_AVPC,
630 .regs = {
631 .smmu = {
632 .reg = 0x22c,
633 .bit = 18,
634 },
635 .la = {
636 .reg = 0x2e4,
637 .shift = 16,
638 .mask = 0xff,
639 .def = 0x0e,
640 },
641 },
642 }, {
643 .id = 0x33,
644 .name = "fdcdwr",
645 .swgroup = TEGRA_SWGROUP_NV,
646 .regs = {
647 .smmu = {
648 .reg = 0x22c,
649 .bit = 19,
650 },
651 .la = {
652 .reg = 0x338,
653 .shift = 16,
654 .mask = 0xff,
655 .def = 0x10,
656 },
657 },
658 }, {
659 .id = 0x34,
660 .name = "fdcdwr2",
661 .swgroup = TEGRA_SWGROUP_NV,
662 .regs = {
663 .smmu = {
664 .reg = 0x22c,
665 .bit = 20,
666 },
667 .la = {
668 .reg = 0x340,
669 .shift = 0,
670 .mask = 0xff,
671 .def = 0x10,
672 },
673 },
674 }, {
675 .id = 0x35,
676 .name = "hdaw",
677 .swgroup = TEGRA_SWGROUP_HDA,
678 .regs = {
679 .smmu = {
680 .reg = 0x22c,
681 .bit = 21,
682 },
683 .la = {
684 .reg = 0x318,
685 .shift = 16,
686 .mask = 0xff,
687 .def = 0xff,
688 },
689 },
690 }, {
691 .id = 0x36,
692 .name = "host1xw",
693 .swgroup = TEGRA_SWGROUP_HC,
694 .regs = {
695 .smmu = {
696 .reg = 0x22c,
697 .bit = 22,
698 },
699 .la = {
700 .reg = 0x314,
701 .shift = 0,
702 .mask = 0xff,
703 .def = 0x25,
704 },
705 },
706 }, {
707 .id = 0x37,
708 .name = "ispw",
709 .swgroup = TEGRA_SWGROUP_ISP,
710 .regs = {
711 .smmu = {
712 .reg = 0x22c,
713 .bit = 23,
714 },
715 .la = {
716 .reg = 0x31c,
717 .shift = 0,
718 .mask = 0xff,
719 .def = 0xff,
720 },
721 },
722 }, {
723 .id = 0x38,
724 .name = "mpcorelpw",
725 .swgroup = TEGRA_SWGROUP_MPCORELP,
726 .regs = {
727 .la = {
728 .reg = 0x324,
729 .shift = 16,
730 .mask = 0xff,
731 .def = 0x80,
732 },
733 },
734 }, {
735 .id = 0x39,
736 .name = "mpcorew",
737 .swgroup = TEGRA_SWGROUP_MPCORE,
738 .regs = {
739 .la = {
740 .reg = 0x320,
741 .shift = 16,
742 .mask = 0xff,
743 .def = 0x0e,
744 },
745 },
746 }, {
747 .id = 0x3b,
748 .name = "ppcsahbdmaw",
749 .swgroup = TEGRA_SWGROUP_PPCS,
750 .regs = {
751 .smmu = {
752 .reg = 0x22c,
753 .bit = 27,
754 },
755 .la = {
756 .reg = 0x348,
757 .shift = 0,
758 .mask = 0xff,
759 .def = 0xa5,
760 },
761 },
762 }, {
763 .id = 0x3c,
764 .name = "ppcsahbslvw",
765 .swgroup = TEGRA_SWGROUP_PPCS,
766 .regs = {
767 .smmu = {
768 .reg = 0x22c,
769 .bit = 28,
770 },
771 .la = {
772 .reg = 0x348,
773 .shift = 16,
774 .mask = 0xff,
775 .def = 0xe8,
776 },
777 },
778 }, {
779 .id = 0x3e,
780 .name = "vdebsevw",
781 .swgroup = TEGRA_SWGROUP_VDE,
782 .regs = {
783 .smmu = {
784 .reg = 0x22c,
785 .bit = 30,
786 },
787 .la = {
788 .reg = 0x35c,
789 .shift = 0,
790 .mask = 0xff,
791 .def = 0xff,
792 },
793 },
794 }, {
795 .id = 0x3f,
796 .name = "vdedbgw",
797 .swgroup = TEGRA_SWGROUP_VDE,
798 .regs = {
799 .smmu = {
800 .reg = 0x22c,
801 .bit = 31,
802 },
803 .la = {
804 .reg = 0x35c,
805 .shift = 16,
806 .mask = 0xff,
807 .def = 0xff,
808 },
809 },
810 }, {
811 .id = 0x40,
812 .name = "vdembew",
813 .swgroup = TEGRA_SWGROUP_VDE,
814 .regs = {
815 .smmu = {
816 .reg = 0x230,
817 .bit = 0,
818 },
819 .la = {
820 .reg = 0x360,
821 .shift = 0,
822 .mask = 0xff,
823 .def = 0x89,
824 },
825 },
826 }, {
827 .id = 0x41,
828 .name = "vdetpmw",
829 .swgroup = TEGRA_SWGROUP_VDE,
830 .regs = {
831 .smmu = {
832 .reg = 0x230,
833 .bit = 1,
834 },
835 .la = {
836 .reg = 0x360,
837 .shift = 16,
838 .mask = 0xff,
839 .def = 0x59,
840 },
841 },
842 }, {
843 .id = 0x4a,
844 .name = "xusb_hostr",
845 .swgroup = TEGRA_SWGROUP_XUSB_HOST,
846 .regs = {
847 .smmu = {
848 .reg = 0x230,
849 .bit = 10,
850 },
851 .la = {
852 .reg = 0x37c,
853 .shift = 0,
854 .mask = 0xff,
855 .def = 0xa5,
856 },
857 },
858 }, {
859 .id = 0x4b,
860 .name = "xusb_hostw",
861 .swgroup = TEGRA_SWGROUP_XUSB_HOST,
862 .regs = {
863 .smmu = {
864 .reg = 0x230,
865 .bit = 11,
866 },
867 .la = {
868 .reg = 0x37c,
869 .shift = 16,
870 .mask = 0xff,
871 .def = 0xa5,
872 },
873 },
874 }, {
875 .id = 0x4c,
876 .name = "xusb_devr",
877 .swgroup = TEGRA_SWGROUP_XUSB_DEV,
878 .regs = {
879 .smmu = {
880 .reg = 0x230,
881 .bit = 12,
882 },
883 .la = {
884 .reg = 0x380,
885 .shift = 0,
886 .mask = 0xff,
887 .def = 0xa5,
888 },
889 },
890 }, {
891 .id = 0x4d,
892 .name = "xusb_devw",
893 .swgroup = TEGRA_SWGROUP_XUSB_DEV,
894 .regs = {
895 .smmu = {
896 .reg = 0x230,
897 .bit = 13,
898 },
899 .la = {
900 .reg = 0x380,
901 .shift = 16,
902 .mask = 0xff,
903 .def = 0xa5,
904 },
905 },
906 }, {
907 .id = 0x4e,
908 .name = "fdcdwr3",
909 .swgroup = TEGRA_SWGROUP_NV,
910 .regs = {
911 .smmu = {
912 .reg = 0x230,
913 .bit = 14,
914 },
915 .la = {
916 .reg = 0x388,
917 .shift = 0,
918 .mask = 0xff,
919 .def = 0x10,
920 },
921 },
922 }, {
923 .id = 0x4f,
924 .name = "fdcdrd3",
925 .swgroup = TEGRA_SWGROUP_NV,
926 .regs = {
927 .smmu = {
928 .reg = 0x230,
929 .bit = 15,
930 },
931 .la = {
932 .reg = 0x384,
933 .shift = 0,
934 .mask = 0xff,
935 .def = 0x0c,
936 },
937 },
938 }, {
939 .id = 0x50,
940 .name = "fdcwr4",
941 .swgroup = TEGRA_SWGROUP_NV,
942 .regs = {
943 .smmu = {
944 .reg = 0x230,
945 .bit = 16,
946 },
947 .la = {
948 .reg = 0x388,
949 .shift = 16,
950 .mask = 0xff,
951 .def = 0x10,
952 },
953 },
954 }, {
955 .id = 0x51,
956 .name = "fdcrd4",
957 .swgroup = TEGRA_SWGROUP_NV,
958 .regs = {
959 .smmu = {
960 .reg = 0x230,
961 .bit = 17,
962 },
963 .la = {
964 .reg = 0x384,
965 .shift = 16,
966 .mask = 0xff,
967 .def = 0x0c,
968 },
969 },
970 }, {
971 .id = 0x52,
972 .name = "emucifr",
973 .swgroup = TEGRA_SWGROUP_EMUCIF,
974 .regs = {
975 .la = {
976 .reg = 0x38c,
977 .shift = 0,
978 .mask = 0xff,
979 .def = 0x04,
980 },
981 },
982 }, {
983 .id = 0x53,
984 .name = "emucifw",
985 .swgroup = TEGRA_SWGROUP_EMUCIF,
986 .regs = {
987 .la = {
988 .reg = 0x38c,
989 .shift = 16,
990 .mask = 0xff,
991 .def = 0x0e,
992 },
993 },
994 }, {
995 .id = 0x54,
996 .name = "tsecsrd",
997 .swgroup = TEGRA_SWGROUP_TSEC,
998 .regs = {
999 .smmu = {
1000 .reg = 0x230,
1001 .bit = 20,
1002 },
1003 .la = {
1004 .reg = 0x390,
1005 .shift = 0,
1006 .mask = 0xff,
1007 .def = 0x50,
1008 },
1009 },
1010 }, {
1011 .id = 0x55,
1012 .name = "tsecswr",
1013 .swgroup = TEGRA_SWGROUP_TSEC,
1014 .regs = {
1015 .smmu = {
1016 .reg = 0x230,
1017 .bit = 21,
1018 },
1019 .la = {
1020 .reg = 0x390,
1021 .shift = 16,
1022 .mask = 0xff,
1023 .def = 0x50,
1024 },
1025 },
1026 },
1027};
1028
1029static const struct tegra_smmu_swgroup tegra114_swgroups[] = {
1030 { .name = "dc", .swgroup = TEGRA_SWGROUP_DC, .reg = 0x240 },
1031 { .name = "dcb", .swgroup = TEGRA_SWGROUP_DCB, .reg = 0x244 },
1032 { .name = "epp", .swgroup = TEGRA_SWGROUP_EPP, .reg = 0x248 },
1033 { .name = "g2", .swgroup = TEGRA_SWGROUP_G2, .reg = 0x24c },
1034 { .name = "avpc", .swgroup = TEGRA_SWGROUP_AVPC, .reg = 0x23c },
1035 { .name = "nv", .swgroup = TEGRA_SWGROUP_NV, .reg = 0x268 },
1036 { .name = "hda", .swgroup = TEGRA_SWGROUP_HDA, .reg = 0x254 },
1037 { .name = "hc", .swgroup = TEGRA_SWGROUP_HC, .reg = 0x250 },
1038 { .name = "msenc", .swgroup = TEGRA_SWGROUP_MSENC, .reg = 0x264 },
1039 { .name = "ppcs", .swgroup = TEGRA_SWGROUP_PPCS, .reg = 0x270 },
1040 { .name = "vde", .swgroup = TEGRA_SWGROUP_VDE, .reg = 0x27c },
1041 { .name = "vi", .swgroup = TEGRA_SWGROUP_VI, .reg = 0x280 },
1042 { .name = "isp", .swgroup = TEGRA_SWGROUP_ISP, .reg = 0x258 },
1043 { .name = "xusb_host", .swgroup = TEGRA_SWGROUP_XUSB_HOST, .reg = 0x288 },
1044 { .name = "xusb_dev", .swgroup = TEGRA_SWGROUP_XUSB_DEV, .reg = 0x28c },
1045 { .name = "tsec", .swgroup = TEGRA_SWGROUP_TSEC, .reg = 0x294 },
1046};
1047
1048static const unsigned int tegra114_group_drm[] = {
1049 TEGRA_SWGROUP_DC,
1050 TEGRA_SWGROUP_DCB,
1051 TEGRA_SWGROUP_G2,
1052 TEGRA_SWGROUP_NV,
1053};
1054
1055static const struct tegra_smmu_group_soc tegra114_groups[] = {
1056 {
1057 .name = "drm",
1058 .swgroups = tegra114_group_drm,
1059 .num_swgroups = ARRAY_SIZE(tegra114_group_drm),
1060 },
1061};
1062
1063static const struct tegra_smmu_soc tegra114_smmu_soc = {
1064 .clients = tegra114_mc_clients,
1065 .num_clients = ARRAY_SIZE(tegra114_mc_clients),
1066 .swgroups = tegra114_swgroups,
1067 .num_swgroups = ARRAY_SIZE(tegra114_swgroups),
1068 .groups = tegra114_groups,
1069 .num_groups = ARRAY_SIZE(tegra114_groups),
1070 .supports_round_robin_arbitration = false,
1071 .supports_request_limit = false,
1072 .num_tlb_lines = 32,
1073 .num_asids = 4,
1074};
1075
1076#define TEGRA114_MC_RESET(_name, _control, _status, _bit) \
1077 { \
1078 .name = #_name, \
1079 .id = TEGRA114_MC_RESET_##_name, \
1080 .control = _control, \
1081 .status = _status, \
1082 .bit = _bit, \
1083 }
1084
1085static const struct tegra_mc_reset tegra114_mc_resets[] = {
1086 TEGRA114_MC_RESET(AVPC, 0x200, 0x204, 1),
1087 TEGRA114_MC_RESET(DC, 0x200, 0x204, 2),
1088 TEGRA114_MC_RESET(DCB, 0x200, 0x204, 3),
1089 TEGRA114_MC_RESET(EPP, 0x200, 0x204, 4),
1090 TEGRA114_MC_RESET(2D, 0x200, 0x204, 5),
1091 TEGRA114_MC_RESET(HC, 0x200, 0x204, 6),
1092 TEGRA114_MC_RESET(HDA, 0x200, 0x204, 7),
1093 TEGRA114_MC_RESET(ISP, 0x200, 0x204, 8),
1094 TEGRA114_MC_RESET(MPCORE, 0x200, 0x204, 9),
1095 TEGRA114_MC_RESET(MPCORELP, 0x200, 0x204, 10),
1096 TEGRA114_MC_RESET(MPE, 0x200, 0x204, 11),
1097 TEGRA114_MC_RESET(3D, 0x200, 0x204, 12),
1098 TEGRA114_MC_RESET(3D2, 0x200, 0x204, 13),
1099 TEGRA114_MC_RESET(PPCS, 0x200, 0x204, 14),
1100 TEGRA114_MC_RESET(VDE, 0x200, 0x204, 16),
1101 TEGRA114_MC_RESET(VI, 0x200, 0x204, 17),
1102};
1103
1104const struct tegra_mc_soc tegra114_mc_soc = {
1105 .clients = tegra114_mc_clients,
1106 .num_clients = ARRAY_SIZE(tegra114_mc_clients),
1107 .num_address_bits = 32,
1108 .atom_size = 32,
1109 .client_id_mask = 0x7f,
1110 .smmu = &tegra114_smmu_soc,
1111 .intmask = MC_INT_INVALID_SMMU_PAGE | MC_INT_SECURITY_VIOLATION |
1112 MC_INT_DECERR_EMEM,
1113 .reset_ops = &tegra_mc_reset_ops_common,
1114 .resets = tegra114_mc_resets,
1115 .num_resets = ARRAY_SIZE(tegra114_mc_resets),
1116 .ops = &tegra30_mc_ops,
1117};