Linux Audio

Check our new training course

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