1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2014 NVIDIA CORPORATION. All rights reserved.
9 #include <dt-bindings/memory/tegra114-mc.h>
13 static const struct tegra_mc_client tegra114_mc_clients[] = {
17 .swgroup = TEGRA_SWGROUP_PTC,
27 .swgroup = TEGRA_SWGROUP_DC,
41 .swgroup = TEGRA_SWGROUP_DCB,
55 .swgroup = TEGRA_SWGROUP_DC,
69 .swgroup = TEGRA_SWGROUP_DCB,
83 .swgroup = TEGRA_SWGROUP_DC,
97 .swgroup = TEGRA_SWGROUP_DCB,
111 .swgroup = TEGRA_SWGROUP_EPP,
125 .swgroup = TEGRA_SWGROUP_G2,
139 .swgroup = TEGRA_SWGROUP_G2,
153 .swgroup = TEGRA_SWGROUP_AVPC,
167 .swgroup = TEGRA_SWGROUP_DC,
180 .name = "displayhcb",
181 .swgroup = TEGRA_SWGROUP_DCB,
195 .swgroup = TEGRA_SWGROUP_NV,
209 .swgroup = TEGRA_SWGROUP_NV,
223 .swgroup = TEGRA_SWGROUP_G2,
237 .swgroup = TEGRA_SWGROUP_HDA,
250 .name = "host1xdmar",
251 .swgroup = TEGRA_SWGROUP_HC,
265 .swgroup = TEGRA_SWGROUP_HC,
279 .swgroup = TEGRA_SWGROUP_NV,
293 .swgroup = TEGRA_SWGROUP_MSENC,
306 .name = "ppcsahbdmar",
307 .swgroup = TEGRA_SWGROUP_PPCS,
320 .name = "ppcsahbslvr",
321 .swgroup = TEGRA_SWGROUP_PPCS,
335 .swgroup = TEGRA_SWGROUP_NV,
349 .swgroup = TEGRA_SWGROUP_VDE,
363 .swgroup = TEGRA_SWGROUP_VDE,
377 .swgroup = TEGRA_SWGROUP_VDE,
391 .swgroup = TEGRA_SWGROUP_VDE,
405 .swgroup = TEGRA_SWGROUP_MPCORELP,
415 .swgroup = TEGRA_SWGROUP_MPCORE,
425 .swgroup = TEGRA_SWGROUP_EPP,
439 .swgroup = TEGRA_SWGROUP_EPP,
453 .swgroup = TEGRA_SWGROUP_EPP,
467 .swgroup = TEGRA_SWGROUP_MSENC,
481 .swgroup = TEGRA_SWGROUP_VI,
495 .swgroup = TEGRA_SWGROUP_VI,
509 .swgroup = TEGRA_SWGROUP_VI,
523 .swgroup = TEGRA_SWGROUP_VI,
537 .swgroup = TEGRA_SWGROUP_G2,
551 .swgroup = TEGRA_SWGROUP_AVPC,
565 .swgroup = TEGRA_SWGROUP_NV,
579 .swgroup = TEGRA_SWGROUP_NV,
593 .swgroup = TEGRA_SWGROUP_HDA,
607 .swgroup = TEGRA_SWGROUP_HC,
621 .swgroup = TEGRA_SWGROUP_ISP,
635 .swgroup = TEGRA_SWGROUP_MPCORELP,
645 .swgroup = TEGRA_SWGROUP_MPCORE,
654 .name = "ppcsahbdmaw",
655 .swgroup = TEGRA_SWGROUP_PPCS,
668 .name = "ppcsahbslvw",
669 .swgroup = TEGRA_SWGROUP_PPCS,
683 .swgroup = TEGRA_SWGROUP_VDE,
697 .swgroup = TEGRA_SWGROUP_VDE,
711 .swgroup = TEGRA_SWGROUP_VDE,
725 .swgroup = TEGRA_SWGROUP_VDE,
738 .name = "xusb_hostr",
739 .swgroup = TEGRA_SWGROUP_XUSB_HOST,
752 .name = "xusb_hostw",
753 .swgroup = TEGRA_SWGROUP_XUSB_HOST,
767 .swgroup = TEGRA_SWGROUP_XUSB_DEV,
781 .swgroup = TEGRA_SWGROUP_XUSB_DEV,
795 .swgroup = TEGRA_SWGROUP_NV,
809 .swgroup = TEGRA_SWGROUP_NV,
823 .swgroup = TEGRA_SWGROUP_NV,
837 .swgroup = TEGRA_SWGROUP_NV,
851 .swgroup = TEGRA_SWGROUP_EMUCIF,
861 .swgroup = TEGRA_SWGROUP_EMUCIF,
871 .swgroup = TEGRA_SWGROUP_TSEC,
885 .swgroup = TEGRA_SWGROUP_TSEC,
899 static const struct tegra_smmu_swgroup tegra114_swgroups[] = {
900 { .name = "dc", .swgroup = TEGRA_SWGROUP_DC, .reg = 0x240 },
901 { .name = "dcb", .swgroup = TEGRA_SWGROUP_DCB, .reg = 0x244 },
902 { .name = "epp", .swgroup = TEGRA_SWGROUP_EPP, .reg = 0x248 },
903 { .name = "g2", .swgroup = TEGRA_SWGROUP_G2, .reg = 0x24c },
904 { .name = "avpc", .swgroup = TEGRA_SWGROUP_AVPC, .reg = 0x23c },
905 { .name = "nv", .swgroup = TEGRA_SWGROUP_NV, .reg = 0x268 },
906 { .name = "hda", .swgroup = TEGRA_SWGROUP_HDA, .reg = 0x254 },
907 { .name = "hc", .swgroup = TEGRA_SWGROUP_HC, .reg = 0x250 },
908 { .name = "msenc", .swgroup = TEGRA_SWGROUP_MSENC, .reg = 0x264 },
909 { .name = "ppcs", .swgroup = TEGRA_SWGROUP_PPCS, .reg = 0x270 },
910 { .name = "vde", .swgroup = TEGRA_SWGROUP_VDE, .reg = 0x27c },
911 { .name = "vi", .swgroup = TEGRA_SWGROUP_VI, .reg = 0x280 },
912 { .name = "isp", .swgroup = TEGRA_SWGROUP_ISP, .reg = 0x258 },
913 { .name = "xusb_host", .swgroup = TEGRA_SWGROUP_XUSB_HOST, .reg = 0x288 },
914 { .name = "xusb_dev", .swgroup = TEGRA_SWGROUP_XUSB_DEV, .reg = 0x28c },
915 { .name = "tsec", .swgroup = TEGRA_SWGROUP_TSEC, .reg = 0x294 },
918 static const unsigned int tegra114_group_drm[] = {
925 static const struct tegra_smmu_group_soc tegra114_groups[] = {
928 .swgroups = tegra114_group_drm,
929 .num_swgroups = ARRAY_SIZE(tegra114_group_drm),
933 static const struct tegra_smmu_soc tegra114_smmu_soc = {
934 .clients = tegra114_mc_clients,
935 .num_clients = ARRAY_SIZE(tegra114_mc_clients),
936 .swgroups = tegra114_swgroups,
937 .num_swgroups = ARRAY_SIZE(tegra114_swgroups),
938 .groups = tegra114_groups,
939 .num_groups = ARRAY_SIZE(tegra114_groups),
940 .supports_round_robin_arbitration = false,
941 .supports_request_limit = false,
946 #define TEGRA114_MC_RESET(_name, _control, _status, _bit) \
949 .id = TEGRA114_MC_RESET_##_name, \
950 .control = _control, \
955 static const struct tegra_mc_reset tegra114_mc_resets[] = {
956 TEGRA114_MC_RESET(AVPC, 0x200, 0x204, 1),
957 TEGRA114_MC_RESET(DC, 0x200, 0x204, 2),
958 TEGRA114_MC_RESET(DCB, 0x200, 0x204, 3),
959 TEGRA114_MC_RESET(EPP, 0x200, 0x204, 4),
960 TEGRA114_MC_RESET(2D, 0x200, 0x204, 5),
961 TEGRA114_MC_RESET(HC, 0x200, 0x204, 6),
962 TEGRA114_MC_RESET(HDA, 0x200, 0x204, 7),
963 TEGRA114_MC_RESET(ISP, 0x200, 0x204, 8),
964 TEGRA114_MC_RESET(MPCORE, 0x200, 0x204, 9),
965 TEGRA114_MC_RESET(MPCORELP, 0x200, 0x204, 10),
966 TEGRA114_MC_RESET(MPE, 0x200, 0x204, 11),
967 TEGRA114_MC_RESET(3D, 0x200, 0x204, 12),
968 TEGRA114_MC_RESET(3D2, 0x200, 0x204, 13),
969 TEGRA114_MC_RESET(PPCS, 0x200, 0x204, 14),
970 TEGRA114_MC_RESET(VDE, 0x200, 0x204, 16),
971 TEGRA114_MC_RESET(VI, 0x200, 0x204, 17),
974 const struct tegra_mc_soc tegra114_mc_soc = {
975 .clients = tegra114_mc_clients,
976 .num_clients = ARRAY_SIZE(tegra114_mc_clients),
977 .num_address_bits = 32,
979 .client_id_mask = 0x7f,
980 .smmu = &tegra114_smmu_soc,
981 .intmask = MC_INT_INVALID_SMMU_PAGE | MC_INT_SECURITY_VIOLATION |
983 .reset_ops = &tegra_mc_reset_ops_common,
984 .resets = tegra114_mc_resets,
985 .num_resets = ARRAY_SIZE(tegra114_mc_resets),