diff options
author | Pritesh Raithatha <praithatha@nvidia.com> | 2018-07-17 02:42:27 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-07-18 07:10:11 -0400 |
commit | 007d3f6bbf933c7f6ece484728cf630cbe14d847 (patch) | |
tree | ffa73ee7677a0f560d47db7ef9d0cd151c2889a8 /drivers | |
parent | ce24aeeddcc8e4edbcc254ba66ccefc19a8e2936 (diff) |
iommu: arm-smmu: set SMRG GROUP MAX to 128
Tegra SoC has 128 SMRG(SMR and S2CR). Updating SMRG_GROUP_MAX to 128.
Bug 200383912
Change-Id: I51b1818a507d50b5bc70f5cda70d277c9406ff76
Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1779792
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/iommu/arm-smmu-suspend.c | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/drivers/iommu/arm-smmu-suspend.c b/drivers/iommu/arm-smmu-suspend.c index e0c55f8f1..0ed4ecbea 100644 --- a/drivers/iommu/arm-smmu-suspend.c +++ b/drivers/iommu/arm-smmu-suspend.c | |||
@@ -123,11 +123,16 @@ static void context_save_gnsr0_group(void) | |||
123 | context_save_reg(ARM_SMMU_GR0_sACR); | 123 | context_save_reg(ARM_SMMU_GR0_sACR); |
124 | } | 124 | } |
125 | 125 | ||
126 | #define SMRG_GROUP_REG_SIZE 4 | 126 | #define SMRG_GROUP_REG_SIZE 2 |
127 | static void context_save_smrg_group(int group_num) | 127 | static void context_save_smrg_group(int group_num) |
128 | { | 128 | { |
129 | context_save_reg(ARM_SMMU_GR0_SMR(group_num)); | 129 | context_save_reg(ARM_SMMU_GR0_SMR(group_num)); |
130 | context_save_reg(ARM_SMMU_GR0_S2CR(group_num)); | 130 | context_save_reg(ARM_SMMU_GR0_S2CR(group_num)); |
131 | } | ||
132 | |||
133 | #define CBAR_GROUP_REG_SIZE 2 | ||
134 | static void context_save_cbar_group(int group_num) | ||
135 | { | ||
131 | context_save_reg(SMMU_GNSR1_CBAR_CFG(group_num, | 136 | context_save_reg(SMMU_GNSR1_CBAR_CFG(group_num, |
132 | arm_smmu_ctx.smmu_pgshift)); | 137 | arm_smmu_ctx.smmu_pgshift)); |
133 | context_save_reg(SMMU_GNSR1_CBA2R_CFG(group_num, | 138 | context_save_reg(SMMU_GNSR1_CBA2R_CFG(group_num, |
@@ -157,24 +162,26 @@ static void context_save_cb_group(int group_num) | |||
157 | arm_smmu_ctx.smmu_size, arm_smmu_ctx.smmu_pgshift)); | 162 | arm_smmu_ctx.smmu_size, arm_smmu_ctx.smmu_pgshift)); |
158 | } | 163 | } |
159 | 164 | ||
160 | #define CB_GROUP_NUM 64 | 165 | #define CB_GROUP_MAX 64 |
161 | #define SMRG_GROUP_NUM 64 | 166 | #define SMRG_GROUP_MAX 128 |
162 | static void context_save_smrg(void) | 167 | #define CBAR_GROUP_MAX 64 |
168 | static int arm_smmu_syscore_suspend(void) | ||
163 | { | 169 | { |
164 | int i; | 170 | int i; |
165 | 171 | ||
166 | for (i = 0; i < SMRG_GROUP_NUM; i++) | 172 | context_save_start(); |
173 | |||
174 | context_save_gnsr0_group(); | ||
175 | |||
176 | for (i = 0; i < SMRG_GROUP_MAX; i++) | ||
167 | context_save_smrg_group(i); | 177 | context_save_smrg_group(i); |
168 | 178 | ||
169 | for (i = 0; i < CB_GROUP_NUM; i++) | 179 | for (i = 0; i < CBAR_GROUP_MAX; i++) |
180 | context_save_cbar_group(i); | ||
181 | |||
182 | for (i = 0; i < CB_GROUP_MAX; i++) | ||
170 | context_save_cb_group(i); | 183 | context_save_cb_group(i); |
171 | } | ||
172 | 184 | ||
173 | static int arm_smmu_syscore_suspend(void) | ||
174 | { | ||
175 | context_save_start(); | ||
176 | context_save_gnsr0_group(); | ||
177 | context_save_smrg(); | ||
178 | context_save_end(); | 185 | context_save_end(); |
179 | 186 | ||
180 | return 0; | 187 | return 0; |
@@ -193,8 +200,9 @@ int arm_smmu_suspend_init(void __iomem **smmu_base, u32 *smmu_base_pa, | |||
193 | arm_smmu_ctx.reg_list_table_size = | 200 | arm_smmu_ctx.reg_list_table_size = |
194 | (SMMU_REG_TABLE_START_SIZE + SMMU_REG_TABLE_END_SIZE | 201 | (SMMU_REG_TABLE_START_SIZE + SMMU_REG_TABLE_END_SIZE |
195 | + (GNSR_GROUP_REG_SIZE | 202 | + (GNSR_GROUP_REG_SIZE |
196 | + (CB_GROUP_REG_SIZE * CB_GROUP_NUM) | 203 | + (CB_GROUP_REG_SIZE * CB_GROUP_MAX) |
197 | + (SMRG_GROUP_REG_SIZE * SMRG_GROUP_NUM) | 204 | + (SMRG_GROUP_REG_SIZE * SMRG_GROUP_MAX) |
205 | + (CBAR_GROUP_REG_SIZE * CBAR_GROUP_MAX) | ||
198 | ) * num_smmus); | 206 | ) * num_smmus); |
199 | 207 | ||
200 | arm_smmu_ctx.reg_list_mem_size = | 208 | arm_smmu_ctx.reg_list_mem_size = |