1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2014 NVIDIA CORPORATION. All rights reserved.
9 #include <dt-bindings/memory/tegra30-mc.h>
13 static const struct tegra_mc_client tegra30_mc_clients[] = {
17 .swgroup = TEGRA_SWGROUP_PTC,
21 .swgroup = TEGRA_SWGROUP_DC,
35 .swgroup = TEGRA_SWGROUP_DCB,
49 .swgroup = TEGRA_SWGROUP_DC,
63 .swgroup = TEGRA_SWGROUP_DCB,
77 .swgroup = TEGRA_SWGROUP_DC,
91 .swgroup = TEGRA_SWGROUP_DCB,
105 .swgroup = TEGRA_SWGROUP_DC,
118 .name = "display1bb",
119 .swgroup = TEGRA_SWGROUP_DCB,
133 .swgroup = TEGRA_SWGROUP_EPP,
147 .swgroup = TEGRA_SWGROUP_G2,
161 .swgroup = TEGRA_SWGROUP_G2,
175 .swgroup = TEGRA_SWGROUP_MPE,
189 .swgroup = TEGRA_SWGROUP_VI,
203 .swgroup = TEGRA_SWGROUP_AFI,
217 .swgroup = TEGRA_SWGROUP_AVPC,
231 .swgroup = TEGRA_SWGROUP_DC,
244 .name = "displayhcb",
245 .swgroup = TEGRA_SWGROUP_DCB,
259 .swgroup = TEGRA_SWGROUP_NV,
273 .swgroup = TEGRA_SWGROUP_NV2,
287 .swgroup = TEGRA_SWGROUP_G2,
301 .swgroup = TEGRA_SWGROUP_HDA,
314 .name = "host1xdmar",
315 .swgroup = TEGRA_SWGROUP_HC,
329 .swgroup = TEGRA_SWGROUP_HC,
343 .swgroup = TEGRA_SWGROUP_NV,
357 .swgroup = TEGRA_SWGROUP_NV2,
371 .swgroup = TEGRA_SWGROUP_MPE,
385 .swgroup = TEGRA_SWGROUP_MPE,
399 .swgroup = TEGRA_SWGROUP_MPE,
412 .name = "ppcsahbdmar",
413 .swgroup = TEGRA_SWGROUP_PPCS,
426 .name = "ppcsahbslvr",
427 .swgroup = TEGRA_SWGROUP_PPCS,
441 .swgroup = TEGRA_SWGROUP_SATA,
455 .swgroup = TEGRA_SWGROUP_NV,
469 .swgroup = TEGRA_SWGROUP_NV2,
483 .swgroup = TEGRA_SWGROUP_VDE,
497 .swgroup = TEGRA_SWGROUP_VDE,
511 .swgroup = TEGRA_SWGROUP_VDE,
525 .swgroup = TEGRA_SWGROUP_VDE,
539 .swgroup = TEGRA_SWGROUP_MPCORELP,
549 .swgroup = TEGRA_SWGROUP_MPCORE,
559 .swgroup = TEGRA_SWGROUP_EPP,
573 .swgroup = TEGRA_SWGROUP_EPP,
587 .swgroup = TEGRA_SWGROUP_EPP,
601 .swgroup = TEGRA_SWGROUP_MPE,
615 .swgroup = TEGRA_SWGROUP_VI,
629 .swgroup = TEGRA_SWGROUP_VI,
643 .swgroup = TEGRA_SWGROUP_VI,
657 .swgroup = TEGRA_SWGROUP_VI,
671 .swgroup = TEGRA_SWGROUP_G2,
685 .swgroup = TEGRA_SWGROUP_AFI,
699 .swgroup = TEGRA_SWGROUP_AVPC,
713 .swgroup = TEGRA_SWGROUP_NV,
727 .swgroup = TEGRA_SWGROUP_NV2,
741 .swgroup = TEGRA_SWGROUP_HDA,
755 .swgroup = TEGRA_SWGROUP_HC,
769 .swgroup = TEGRA_SWGROUP_ISP,
783 .swgroup = TEGRA_SWGROUP_MPCORELP,
793 .swgroup = TEGRA_SWGROUP_MPCORE,
803 .swgroup = TEGRA_SWGROUP_MPE,
816 .name = "ppcsahbdmaw",
817 .swgroup = TEGRA_SWGROUP_PPCS,
830 .name = "ppcsahbslvw",
831 .swgroup = TEGRA_SWGROUP_PPCS,
845 .swgroup = TEGRA_SWGROUP_SATA,
859 .swgroup = TEGRA_SWGROUP_VDE,
873 .swgroup = TEGRA_SWGROUP_VDE,
887 .swgroup = TEGRA_SWGROUP_VDE,
901 .swgroup = TEGRA_SWGROUP_VDE,
915 static 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 },
934 static const unsigned int tegra30_group_drm[] = {
942 static const struct tegra_smmu_group_soc tegra30_groups[] = {
945 .swgroups = tegra30_group_drm,
946 .num_swgroups = ARRAY_SIZE(tegra30_group_drm),
950 static const struct tegra_smmu_soc tegra30_smmu_soc = {
951 .clients = tegra30_mc_clients,
952 .num_clients = ARRAY_SIZE(tegra30_mc_clients),
953 .swgroups = tegra30_swgroups,
954 .num_swgroups = ARRAY_SIZE(tegra30_swgroups),
955 .groups = tegra30_groups,
956 .num_groups = ARRAY_SIZE(tegra30_groups),
957 .supports_round_robin_arbitration = false,
958 .supports_request_limit = false,
963 #define TEGRA30_MC_RESET(_name, _control, _status, _bit) \
966 .id = TEGRA30_MC_RESET_##_name, \
967 .control = _control, \
972 static const struct tegra_mc_reset tegra30_mc_resets[] = {
973 TEGRA30_MC_RESET(AFI, 0x200, 0x204, 0),
974 TEGRA30_MC_RESET(AVPC, 0x200, 0x204, 1),
975 TEGRA30_MC_RESET(DC, 0x200, 0x204, 2),
976 TEGRA30_MC_RESET(DCB, 0x200, 0x204, 3),
977 TEGRA30_MC_RESET(EPP, 0x200, 0x204, 4),
978 TEGRA30_MC_RESET(2D, 0x200, 0x204, 5),
979 TEGRA30_MC_RESET(HC, 0x200, 0x204, 6),
980 TEGRA30_MC_RESET(HDA, 0x200, 0x204, 7),
981 TEGRA30_MC_RESET(ISP, 0x200, 0x204, 8),
982 TEGRA30_MC_RESET(MPCORE, 0x200, 0x204, 9),
983 TEGRA30_MC_RESET(MPCORELP, 0x200, 0x204, 10),
984 TEGRA30_MC_RESET(MPE, 0x200, 0x204, 11),
985 TEGRA30_MC_RESET(3D, 0x200, 0x204, 12),
986 TEGRA30_MC_RESET(3D2, 0x200, 0x204, 13),
987 TEGRA30_MC_RESET(PPCS, 0x200, 0x204, 14),
988 TEGRA30_MC_RESET(SATA, 0x200, 0x204, 15),
989 TEGRA30_MC_RESET(VDE, 0x200, 0x204, 16),
990 TEGRA30_MC_RESET(VI, 0x200, 0x204, 17),
993 const struct tegra_mc_soc tegra30_mc_soc = {
994 .clients = tegra30_mc_clients,
995 .num_clients = ARRAY_SIZE(tegra30_mc_clients),
996 .num_address_bits = 32,
998 .client_id_mask = 0x7f,
999 .smmu = &tegra30_smmu_soc,
1000 .intmask = MC_INT_INVALID_SMMU_PAGE | MC_INT_SECURITY_VIOLATION |
1002 .reset_ops = &tegra_mc_reset_ops_common,
1003 .resets = tegra30_mc_resets,
1004 .num_resets = ARRAY_SIZE(tegra30_mc_resets),