Skip to content

Commit 2a8102d

Browse files
committed
memory: tegra: Create SMMU display groups
Create SMMU display groups for Tegra30, Tegra114, Tegra124 and Tegra210. This allows the display controllers on these devices to share the same IOMMU domain using the standard IOMMU group mechanism. Signed-off-by: Thierry Reding <treding@nvidia.com>
1 parent 02b0cc5 commit 2a8102d

5 files changed

Lines changed: 71 additions & 0 deletions

File tree

‎drivers/memory/tegra/tegra114.c‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,11 +912,26 @@ static const struct tegra_smmu_swgroup tegra114_swgroups[] = {
912912
{ .name = "tsec", .swgroup = TEGRA_SWGROUP_TSEC, .reg = 0x294 },
913913
};
914914

915+
static const unsigned int tegra114_group_display[] = {
916+
TEGRA_SWGROUP_DC,
917+
TEGRA_SWGROUP_DCB,
918+
};
919+
920+
static const struct tegra_smmu_group_soc tegra114_groups[] = {
921+
{
922+
.name = "display",
923+
.swgroups = tegra114_group_display,
924+
.num_swgroups = ARRAY_SIZE(tegra114_group_display),
925+
},
926+
};
927+
915928
static const struct tegra_smmu_soc tegra114_smmu_soc = {
916929
.clients = tegra114_mc_clients,
917930
.num_clients = ARRAY_SIZE(tegra114_mc_clients),
918931
.swgroups = tegra114_swgroups,
919932
.num_swgroups = ARRAY_SIZE(tegra114_swgroups),
933+
.groups = tegra114_groups,
934+
.num_groups = ARRAY_SIZE(tegra114_groups),
920935
.supports_round_robin_arbitration = false,
921936
.supports_request_limit = false,
922937
.num_tlb_lines = 32,

‎drivers/memory/tegra/tegra124.c‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -999,12 +999,27 @@ static const struct tegra_smmu_swgroup tegra124_swgroups[] = {
999999
{ .name = "vi", .swgroup = TEGRA_SWGROUP_VI, .reg = 0x280 },
10001000
};
10011001

1002+
static const unsigned int tegra124_group_display[] = {
1003+
TEGRA_SWGROUP_DC,
1004+
TEGRA_SWGROUP_DCB,
1005+
};
1006+
1007+
static const struct tegra_smmu_group_soc tegra124_groups[] = {
1008+
{
1009+
.name = "display",
1010+
.swgroups = tegra124_group_display,
1011+
.num_swgroups = ARRAY_SIZE(tegra124_group_display),
1012+
},
1013+
};
1014+
10021015
#ifdef CONFIG_ARCH_TEGRA_124_SOC
10031016
static const struct tegra_smmu_soc tegra124_smmu_soc = {
10041017
.clients = tegra124_mc_clients,
10051018
.num_clients = ARRAY_SIZE(tegra124_mc_clients),
10061019
.swgroups = tegra124_swgroups,
10071020
.num_swgroups = ARRAY_SIZE(tegra124_swgroups),
1021+
.groups = tegra124_groups,
1022+
.num_groups = ARRAY_SIZE(tegra124_groups),
10081023
.supports_round_robin_arbitration = true,
10091024
.supports_request_limit = true,
10101025
.num_tlb_lines = 32,
@@ -1029,6 +1044,8 @@ static const struct tegra_smmu_soc tegra132_smmu_soc = {
10291044
.num_clients = ARRAY_SIZE(tegra124_mc_clients),
10301045
.swgroups = tegra124_swgroups,
10311046
.num_swgroups = ARRAY_SIZE(tegra124_swgroups),
1047+
.groups = tegra124_groups,
1048+
.num_groups = ARRAY_SIZE(tegra124_groups),
10321049
.supports_round_robin_arbitration = true,
10331050
.supports_request_limit = true,
10341051
.num_tlb_lines = 32,

‎drivers/memory/tegra/tegra210.c‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,11 +1059,26 @@ static const struct tegra_smmu_swgroup tegra210_swgroups[] = {
10591059
{ .name = "tsecb", .swgroup = TEGRA_SWGROUP_TSECB, .reg = 0xad4 },
10601060
};
10611061

1062+
static const unsigned int tegra210_group_display[] = {
1063+
TEGRA_SWGROUP_DC,
1064+
TEGRA_SWGROUP_DCB,
1065+
};
1066+
1067+
static const struct tegra_smmu_group_soc tegra210_groups[] = {
1068+
{
1069+
.name = "display",
1070+
.swgroups = tegra210_group_display,
1071+
.num_swgroups = ARRAY_SIZE(tegra210_group_display),
1072+
},
1073+
};
1074+
10621075
static const struct tegra_smmu_soc tegra210_smmu_soc = {
10631076
.clients = tegra210_mc_clients,
10641077
.num_clients = ARRAY_SIZE(tegra210_mc_clients),
10651078
.swgroups = tegra210_swgroups,
10661079
.num_swgroups = ARRAY_SIZE(tegra210_swgroups),
1080+
.groups = tegra210_groups,
1081+
.num_groups = ARRAY_SIZE(tegra210_groups),
10671082
.supports_round_robin_arbitration = true,
10681083
.supports_request_limit = true,
10691084
.num_tlb_lines = 32,

‎drivers/memory/tegra/tegra30.c‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,11 +934,26 @@ static const struct tegra_smmu_swgroup tegra30_swgroups[] = {
934934
{ .name = "isp", .swgroup = TEGRA_SWGROUP_ISP, .reg = 0x258 },
935935
};
936936

937+
static const unsigned int tegra30_group_display[] = {
938+
TEGRA_SWGROUP_DC,
939+
TEGRA_SWGROUP_DCB,
940+
};
941+
942+
static const struct tegra_smmu_group_soc tegra30_groups[] = {
943+
{
944+
.name = "display",
945+
.swgroups = tegra30_group_display,
946+
.num_swgroups = ARRAY_SIZE(tegra30_group_display),
947+
},
948+
};
949+
937950
static const struct tegra_smmu_soc tegra30_smmu_soc = {
938951
.clients = tegra30_mc_clients,
939952
.num_clients = ARRAY_SIZE(tegra30_mc_clients),
940953
.swgroups = tegra30_swgroups,
941954
.num_swgroups = ARRAY_SIZE(tegra30_swgroups),
955+
.groups = tegra30_groups,
956+
.num_groups = ARRAY_SIZE(tegra30_groups),
942957
.supports_round_robin_arbitration = false,
943958
.supports_request_limit = false,
944959
.num_tlb_lines = 16,

‎include/soc/tegra/mc.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,22 @@ struct tegra_smmu_swgroup {
5151
unsigned int reg;
5252
};
5353

54+
struct tegra_smmu_group_soc {
55+
const char *name;
56+
const unsigned int *swgroups;
57+
unsigned int num_swgroups;
58+
};
59+
5460
struct tegra_smmu_soc {
5561
const struct tegra_mc_client *clients;
5662
unsigned int num_clients;
5763

5864
const struct tegra_smmu_swgroup *swgroups;
5965
unsigned int num_swgroups;
6066

67+
const struct tegra_smmu_group_soc *groups;
68+
unsigned int num_groups;
69+
6170
bool supports_round_robin_arbitration;
6271
bool supports_request_limit;
6372

0 commit comments

Comments
 (0)