diff --git a/plat/nvidia/tegra/include/t194/tegra_def.h b/plat/nvidia/tegra/include/t194/tegra_def.h index 8e7b28cac542f92fbe64b9c2119df661745690cb..7bdd975fca94967eba2550f06e1ea98e30e2e834 100644 --- a/plat/nvidia/tegra/include/t194/tegra_def.h +++ b/plat/nvidia/tegra/include/t194/tegra_def.h @@ -219,7 +219,9 @@ /******************************************************************************* * Tegra SMMU Controller constants ******************************************************************************/ -#define TEGRA_SMMU_BASE 0x10000000 +#define TEGRA_SMMU0_BASE 0x12000000 +#define TEGRA_SMMU1_BASE 0x11000000 +#define TEGRA_SMMU2_BASE 0x10000000 /******************************************************************************* * Tegra TZRAM constants diff --git a/plat/nvidia/tegra/soc/t194/drivers/include/smmu_plat_config.h b/plat/nvidia/tegra/soc/t194/drivers/include/smmu_plat_config.h index f955e5366d8cd1f49c12dc15ef6cfd34f0a65e07..72547110e20677ada4e123d5e814f104f339b6ac 100644 --- a/plat/nvidia/tegra/soc/t194/drivers/include/smmu_plat_config.h +++ b/plat/nvidia/tegra/soc/t194/drivers/include/smmu_plat_config.h @@ -414,4 +414,29 @@ static __attribute__((aligned(16))) smmu_regs_t smmu_ctx_regs[] = { _END_OF_TABLE_, }; +static inline uint32_t tegra_smmu_read_32(uint32_t smmu_id, uint32_t off) +{ + if (smmu_id == 0) + return mmio_read_32(TEGRA_SMMU0_BASE + off); + else if (smmu_id == 1) + return mmio_read_32(TEGRA_SMMU1_BASE + off); + else if (smmu_id == 2) + return mmio_read_32(TEGRA_SMMU2_BASE + off); + else + panic(); +} + +static inline void tegra_smmu_write_32(uint32_t smmu_id, + uint32_t off, uint32_t val) +{ + if (smmu_id == 0) + mmio_write_32(TEGRA_SMMU0_BASE + off, val); + else if (smmu_id == 1) + mmio_write_32(TEGRA_SMMU1_BASE + off, val); + else if (smmu_id == 2) + mmio_write_32(TEGRA_SMMU2_BASE + off, val); + else + panic(); +} + #endif //__SMMU_PLAT_CONFIG_H diff --git a/plat/nvidia/tegra/soc/t194/plat_setup.c b/plat/nvidia/tegra/soc/t194/plat_setup.c index aab884e7372f30118440626cc5ffe1fe6a7144bb..3424d1928d1afdfe25cf0213f3807aa0406eb752 100644 --- a/plat/nvidia/tegra/soc/t194/plat_setup.c +++ b/plat/nvidia/tegra/soc/t194/plat_setup.c @@ -81,7 +81,11 @@ static const mmap_region_t tegra_mmap[] = { MT_DEVICE | MT_RW | MT_SECURE), MAP_REGION_FLAT(TEGRA_MMCRAB_BASE, 0x60000, /* 384KB */ MT_DEVICE | MT_RW | MT_SECURE), - MAP_REGION_FLAT(TEGRA_SMMU_BASE, 0x1000000, /* 64KB */ + MAP_REGION_FLAT(TEGRA_SMMU0_BASE, 0x1000000, /* 64KB */ + MT_DEVICE | MT_RW | MT_SECURE), + MAP_REGION_FLAT(TEGRA_SMMU1_BASE, 0x1000000, /* 64KB */ + MT_DEVICE | MT_RW | MT_SECURE), + MAP_REGION_FLAT(TEGRA_SMMU2_BASE, 0x1000000, /* 64KB */ MT_DEVICE | MT_RW | MT_SECURE), {0} }; diff --git a/plat/nvidia/tegra/soc/t194/platform_t194.mk b/plat/nvidia/tegra/soc/t194/platform_t194.mk index 54bc9419ac4959515be65597c9ccb45c097d4e67..cb31bdd1898c7325fbd02e67f3a7108343deb35d 100644 --- a/plat/nvidia/tegra/soc/t194/platform_t194.mk +++ b/plat/nvidia/tegra/soc/t194/platform_t194.mk @@ -23,6 +23,9 @@ $(eval $(call add_define,ENABLE_CHIP_VERIFICATION_HARNESS)) ENABLE_SMMU_DEVICE := 0 $(eval $(call add_define,ENABLE_SMMU_DEVICE)) +NUM_SMMU_DEVICES := 3 +$(eval $(call add_define,NUM_SMMU_DEVICES)) + RESET_TO_BL31 := 1 PROGRAMMABLE_RESET_ADDRESS := 1