Linux Audio

Check our new training course

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