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 unsigned long tegra30_mc_emem_regs[] = {
15 MC_EMEM_ARB_OUTSTANDING_REQ,
16 MC_EMEM_ARB_TIMING_RCD,
17 MC_EMEM_ARB_TIMING_RP,
18 MC_EMEM_ARB_TIMING_RC,
19 MC_EMEM_ARB_TIMING_RAS,
20 MC_EMEM_ARB_TIMING_FAW,
21 MC_EMEM_ARB_TIMING_RRD,
22 MC_EMEM_ARB_TIMING_RAP2PRE,
23 MC_EMEM_ARB_TIMING_WAP2PRE,
24 MC_EMEM_ARB_TIMING_R2R,
25 MC_EMEM_ARB_TIMING_W2W,
26 MC_EMEM_ARB_TIMING_R2W,
27 MC_EMEM_ARB_TIMING_W2R,
29 MC_EMEM_ARB_DA_COVERS,
31 MC_EMEM_ARB_RING1_THROTTLE,
34 static const struct tegra_mc_client tegra30_mc_clients[] = {
38 .swgroup = TEGRA_SWGROUP_PTC,
48 .swgroup = TEGRA_SWGROUP_DC,
62 .swgroup = TEGRA_SWGROUP_DCB,
76 .swgroup = TEGRA_SWGROUP_DC,
90 .swgroup = TEGRA_SWGROUP_DCB,
104 .swgroup = TEGRA_SWGROUP_DC,
117 .name = "display0cb",
118 .swgroup = TEGRA_SWGROUP_DCB,
132 .swgroup = TEGRA_SWGROUP_DC,
145 .name = "display1bb",
146 .swgroup = TEGRA_SWGROUP_DCB,
160 .swgroup = TEGRA_SWGROUP_EPP,
174 .swgroup = TEGRA_SWGROUP_G2,
188 .swgroup = TEGRA_SWGROUP_G2,
202 .swgroup = TEGRA_SWGROUP_MPE,
216 .swgroup = TEGRA_SWGROUP_VI,
230 .swgroup = TEGRA_SWGROUP_AFI,
244 .swgroup = TEGRA_SWGROUP_AVPC,
258 .swgroup = TEGRA_SWGROUP_DC,
271 .name = "displayhcb",
272 .swgroup = TEGRA_SWGROUP_DCB,
286 .swgroup = TEGRA_SWGROUP_NV,
300 .swgroup = TEGRA_SWGROUP_NV2,
314 .swgroup = TEGRA_SWGROUP_G2,
328 .swgroup = TEGRA_SWGROUP_HDA,
341 .name = "host1xdmar",
342 .swgroup = TEGRA_SWGROUP_HC,
356 .swgroup = TEGRA_SWGROUP_HC,
370 .swgroup = TEGRA_SWGROUP_NV,
384 .swgroup = TEGRA_SWGROUP_NV2,
398 .swgroup = TEGRA_SWGROUP_MPE,
412 .swgroup = TEGRA_SWGROUP_MPE,
426 .swgroup = TEGRA_SWGROUP_MPE,
439 .name = "ppcsahbdmar",
440 .swgroup = TEGRA_SWGROUP_PPCS,
453 .name = "ppcsahbslvr",
454 .swgroup = TEGRA_SWGROUP_PPCS,
468 .swgroup = TEGRA_SWGROUP_SATA,
482 .swgroup = TEGRA_SWGROUP_NV,
496 .swgroup = TEGRA_SWGROUP_NV2,
510 .swgroup = TEGRA_SWGROUP_VDE,
524 .swgroup = TEGRA_SWGROUP_VDE,
538 .swgroup = TEGRA_SWGROUP_VDE,
552 .swgroup = TEGRA_SWGROUP_VDE,
566 .swgroup = TEGRA_SWGROUP_MPCORELP,
576 .swgroup = TEGRA_SWGROUP_MPCORE,
586 .swgroup = TEGRA_SWGROUP_EPP,
600 .swgroup = TEGRA_SWGROUP_EPP,
614 .swgroup = TEGRA_SWGROUP_EPP,
628 .swgroup = TEGRA_SWGROUP_MPE,
642 .swgroup = TEGRA_SWGROUP_VI,
656 .swgroup = TEGRA_SWGROUP_VI,
670 .swgroup = TEGRA_SWGROUP_VI,
684 .swgroup = TEGRA_SWGROUP_VI,
698 .swgroup = TEGRA_SWGROUP_G2,
712 .swgroup = TEGRA_SWGROUP_AFI,
726 .swgroup = TEGRA_SWGROUP_AVPC,
740 .swgroup = TEGRA_SWGROUP_NV,
754 .swgroup = TEGRA_SWGROUP_NV2,
768 .swgroup = TEGRA_SWGROUP_HDA,
782 .swgroup = TEGRA_SWGROUP_HC,
796 .swgroup = TEGRA_SWGROUP_ISP,
810 .swgroup = TEGRA_SWGROUP_MPCORELP,
820 .swgroup = TEGRA_SWGROUP_MPCORE,
830 .swgroup = TEGRA_SWGROUP_MPE,
843 .name = "ppcsahbdmaw",
844 .swgroup = TEGRA_SWGROUP_PPCS,
857 .name = "ppcsahbslvw",
858 .swgroup = TEGRA_SWGROUP_PPCS,
872 .swgroup = TEGRA_SWGROUP_SATA,
886 .swgroup = TEGRA_SWGROUP_VDE,
900 .swgroup = TEGRA_SWGROUP_VDE,
914 .swgroup = TEGRA_SWGROUP_VDE,
928 .swgroup = TEGRA_SWGROUP_VDE,
942 static const struct tegra_smmu_swgroup tegra30_swgroups[] = {
943 { .name = "dc", .swgroup = TEGRA_SWGROUP_DC, .reg = 0x240 },
944 { .name = "dcb", .swgroup = TEGRA_SWGROUP_DCB, .reg = 0x244 },
945 { .name = "epp", .swgroup = TEGRA_SWGROUP_EPP, .reg = 0x248 },
946 { .name = "g2", .swgroup = TEGRA_SWGROUP_G2, .reg = 0x24c },
947 { .name = "mpe", .swgroup = TEGRA_SWGROUP_MPE, .reg = 0x264 },
948 { .name = "vi", .swgroup = TEGRA_SWGROUP_VI, .reg = 0x280 },
949 { .name = "afi", .swgroup = TEGRA_SWGROUP_AFI, .reg = 0x238 },
950 { .name = "avpc", .swgroup = TEGRA_SWGROUP_AVPC, .reg = 0x23c },
951 { .name = "nv", .swgroup = TEGRA_SWGROUP_NV, .reg = 0x268 },
952 { .name = "nv2", .swgroup = TEGRA_SWGROUP_NV2, .reg = 0x26c },
953 { .name = "hda", .swgroup = TEGRA_SWGROUP_HDA, .reg = 0x254 },
954 { .name = "hc", .swgroup = TEGRA_SWGROUP_HC, .reg = 0x250 },
955 { .name = "ppcs", .swgroup = TEGRA_SWGROUP_PPCS, .reg = 0x270 },
956 { .name = "sata", .swgroup = TEGRA_SWGROUP_SATA, .reg = 0x278 },
957 { .name = "vde", .swgroup = TEGRA_SWGROUP_VDE, .reg = 0x27c },
958 { .name = "isp", .swgroup = TEGRA_SWGROUP_ISP, .reg = 0x258 },
961 static const unsigned int tegra30_group_drm[] = {
969 static const struct tegra_smmu_group_soc tegra30_groups[] = {
972 .swgroups = tegra30_group_drm,
973 .num_swgroups = ARRAY_SIZE(tegra30_group_drm),
977 static const struct tegra_smmu_soc tegra30_smmu_soc = {
978 .clients = tegra30_mc_clients,
979 .num_clients = ARRAY_SIZE(tegra30_mc_clients),
980 .swgroups = tegra30_swgroups,
981 .num_swgroups = ARRAY_SIZE(tegra30_swgroups),
982 .groups = tegra30_groups,
983 .num_groups = ARRAY_SIZE(tegra30_groups),
984 .supports_round_robin_arbitration = false,
985 .supports_request_limit = false,
990 #define TEGRA30_MC_RESET(_name, _control, _status, _bit) \
993 .id = TEGRA30_MC_RESET_##_name, \
994 .control = _control, \
999 static const struct tegra_mc_reset tegra30_mc_resets[] = {
1000 TEGRA30_MC_RESET(AFI, 0x200, 0x204, 0),
1001 TEGRA30_MC_RESET(AVPC, 0x200, 0x204, 1),
1002 TEGRA30_MC_RESET(DC, 0x200, 0x204, 2),
1003 TEGRA30_MC_RESET(DCB, 0x200, 0x204, 3),
1004 TEGRA30_MC_RESET(EPP, 0x200, 0x204, 4),
1005 TEGRA30_MC_RESET(2D, 0x200, 0x204, 5),
1006 TEGRA30_MC_RESET(HC, 0x200, 0x204, 6),
1007 TEGRA30_MC_RESET(HDA, 0x200, 0x204, 7),
1008 TEGRA30_MC_RESET(ISP, 0x200, 0x204, 8),
1009 TEGRA30_MC_RESET(MPCORE, 0x200, 0x204, 9),
1010 TEGRA30_MC_RESET(MPCORELP, 0x200, 0x204, 10),
1011 TEGRA30_MC_RESET(MPE, 0x200, 0x204, 11),
1012 TEGRA30_MC_RESET(3D, 0x200, 0x204, 12),
1013 TEGRA30_MC_RESET(3D2, 0x200, 0x204, 13),
1014 TEGRA30_MC_RESET(PPCS, 0x200, 0x204, 14),
1015 TEGRA30_MC_RESET(SATA, 0x200, 0x204, 15),
1016 TEGRA30_MC_RESET(VDE, 0x200, 0x204, 16),
1017 TEGRA30_MC_RESET(VI, 0x200, 0x204, 17),
1020 const struct tegra_mc_soc tegra30_mc_soc = {
1021 .clients = tegra30_mc_clients,
1022 .num_clients = ARRAY_SIZE(tegra30_mc_clients),
1023 .num_address_bits = 32,
1025 .client_id_mask = 0x7f,
1026 .smmu = &tegra30_smmu_soc,
1027 .emem_regs = tegra30_mc_emem_regs,
1028 .num_emem_regs = ARRAY_SIZE(tegra30_mc_emem_regs),
1029 .intmask = MC_INT_INVALID_SMMU_PAGE | MC_INT_SECURITY_VIOLATION |
1031 .reset_ops = &tegra_mc_reset_ops_common,
1032 .resets = tegra30_mc_resets,
1033 .num_resets = ARRAY_SIZE(tegra30_mc_resets),