aboutsummaryrefslogtreecommitdiff
path: root/plat/nvidia/tegra/common/drivers/smmu/smmu.c
diff options
context:
space:
mode:
authorSteven Kao <skao@nvidia.com>2017-07-25 11:29:46 +0800
committerVarun Wadekar <vwadekar@nvidia.com>2019-01-18 09:21:50 -0800
commitbc5a86f767471e34a3410c6ddefe338086222238 (patch)
tree2e2e406efdc392c0d1666d1b0318a40ebb171979 /plat/nvidia/tegra/common/drivers/smmu/smmu.c
parent4c9940022801725ad6871078650be09ca01ca0d5 (diff)
downloadtrusted-firmware-a-bc5a86f767471e34a3410c6ddefe338086222238.tar.gz
Tegra: smmu: add a hook to get number of devices
This patch adds a hook to get the number of smmu devices and removes the NUM_SMMU_DEVICES macro. Change-Id: Ia8dba7e9304224976b5da688b9e4b5438f11cc41 Signed-off-by: Steven Kao <skao@nvidia.com>
Diffstat (limited to 'plat/nvidia/tegra/common/drivers/smmu/smmu.c')
-rw-r--r--plat/nvidia/tegra/common/drivers/smmu/smmu.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/plat/nvidia/tegra/common/drivers/smmu/smmu.c b/plat/nvidia/tegra/common/drivers/smmu/smmu.c
index 0bda5e6892..2186deaa09 100644
--- a/plat/nvidia/tegra/common/drivers/smmu/smmu.c
+++ b/plat/nvidia/tegra/common/drivers/smmu/smmu.c
@@ -137,8 +137,10 @@ void tegra_smmu_save_context(uint64_t smmu_ctx_addr)
void tegra_smmu_init(void)
{
uint32_t val, cb_idx, smmu_id, ctx_base;
+ uint32_t smmu_counter = plat_get_num_smmu_devices();
+
+ for (smmu_id = 0UL; smmu_id < smmu_counter; smmu_id++) {
- for (smmu_id = 0; smmu_id < NUM_SMMU_DEVICES; smmu_id++) {
/* Program the SMMU pagesize and reset CACHE_LOCK bit */
val = tegra_smmu_read_32(smmu_id, SMMU_GSR0_SECURE_ACR);
val |= SMMU_GSR0_PGSIZE_64K;