]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amdgpu: Fine-grained TMZ support
authorLuben Tuikov <luben.tuikov@amd.com>
Wed, 26 Feb 2020 20:30:36 +0000 (15:30 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 28 Apr 2020 20:20:30 +0000 (16:20 -0400)
Add fine-grained per-ASIC TMZ support.

At the moment TMZ support is experimental for all
ASICs which support it.

Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c

index ce13c37584608519e1b3892f86199e7d4e838f96..acabb57aa8af9e8007e49dc17b53071ed40f65eb 100644 (file)
@@ -383,18 +383,28 @@ int amdgpu_gmc_allocate_vm_inv_eng(struct amdgpu_device *adev)
  */
 void amdgpu_gmc_tmz_set(struct amdgpu_device *adev)
 {
-       if (!amdgpu_tmz)
-               return;
-
-       if (adev->asic_type < CHIP_RAVEN ||
-           adev->asic_type == CHIP_ARCTURUS) {
+       switch (adev->asic_type) {
+       case CHIP_RAVEN:
+       case CHIP_RENOIR:
+       case CHIP_NAVI10:
+       case CHIP_NAVI14:
+       case CHIP_NAVI12:
+               /* Don't enable it by default yet.
+                */
+               if (amdgpu_tmz < 1) {
+                       adev->gmc.tmz_enabled = false;
+                       dev_info(adev->dev,
+                                "Trusted Memory Zone (TMZ) feature disabled as experimental (default)\n");
+               } else {
+                       adev->gmc.tmz_enabled = true;
+                       dev_info(adev->dev,
+                                "Trusted Memory Zone (TMZ) feature enabled as experimental (cmd line)\n");
+               }
+               break;
+       default:
                adev->gmc.tmz_enabled = false;
                dev_warn(adev->dev,
                         "Trusted Memory Zone (TMZ) feature not supported\n");
-       } else {
-
-               adev->gmc.tmz_enabled = true;
-               dev_info(adev->dev,
-                        "Trusted Memory Zone (TMZ) feature supported and enabled\n");
+               break;
        }
 }