diff options
author | Seema Khowala <seemaj@nvidia.com> | 2017-11-09 17:13:25 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-11-22 03:59:28 -0500 |
commit | 8fe633449f92d35b60a60de647a4e8fc1b5c8936 (patch) | |
tree | f29ee0ed1c9eba66b99033a17d3b2854662b0a15 /drivers/gpu/nvgpu/gp106 | |
parent | f34a4d0b125ebf45373e40478925b3eb75b7898a (diff) |
gpu: nvgpu: Add check_priv_security fuse ops
-New fuse ops is added to set NVGPU_SEC_PRIVSECURITY
and NVGPU_SEC_SECUREGPCCS bits in g->enabled_flags
during hal initialization
-For igpu non simulation platforms, fuses are read
to decide if gpu should be allowed to boot or not.
--Do not boot gpu if priv_sec_en is set but wpr_enabled
is not set to 1 or vpr_auto_fetch_disable is not set to 0
--With priv_sec_en set, all falcons have to boot
in LS mode and this needs wpr_enabled set to 1
AND vpr_auto_fetch_disable set to 0. In this case
gmmu tries to pull wpr and vpr settings from tegra mc
Bug 2018223
Change-Id: Iceaa1b0b3214e9a3d6cef5d77a82e034302f748b
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1595454
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp106')
-rw-r--r-- | drivers/gpu/nvgpu/gp106/fuse_gp106.c | 35 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp106/fuse_gp106.h | 32 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp106/hal_gp106.c | 11 |
3 files changed, 76 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gp106/fuse_gp106.c b/drivers/gpu/nvgpu/gp106/fuse_gp106.c new file mode 100644 index 00000000..68c0db89 --- /dev/null +++ b/drivers/gpu/nvgpu/gp106/fuse_gp106.c | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * GP106 FUSE | ||
3 | * | ||
4 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | ||
5 | * | ||
6 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
7 | * copy of this software and associated documentation files (the "Software"), | ||
8 | * to deal in the Software without restriction, including without limitation | ||
9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
10 | * and/or sell copies of the Software, and to permit persons to whom the | ||
11 | * Software is furnished to do so, subject to the following conditions: | ||
12 | * | ||
13 | * The above copyright notice and this permission notice shall be included in | ||
14 | * all copies or substantial portions of the Software. | ||
15 | * | ||
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
19 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
22 | * DEALINGS IN THE SOFTWARE. | ||
23 | */ | ||
24 | |||
25 | #include <nvgpu/enabled.h> | ||
26 | |||
27 | #include "gk20a/gk20a.h" | ||
28 | |||
29 | int gp106_fuse_check_priv_security(struct gk20a *g) | ||
30 | { | ||
31 | __nvgpu_set_enabled(g, NVGPU_SEC_PRIVSECURITY, true); | ||
32 | __nvgpu_set_enabled(g, NVGPU_SEC_SECUREGPCCS, true); | ||
33 | |||
34 | return 0; | ||
35 | } | ||
diff --git a/drivers/gpu/nvgpu/gp106/fuse_gp106.h b/drivers/gpu/nvgpu/gp106/fuse_gp106.h new file mode 100644 index 00000000..dfb776b8 --- /dev/null +++ b/drivers/gpu/nvgpu/gp106/fuse_gp106.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * GP106 FUSE | ||
3 | * | ||
4 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | ||
5 | * | ||
6 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
7 | * copy of this software and associated documentation files (the "Software"), | ||
8 | * to deal in the Software without restriction, including without limitation | ||
9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
10 | * and/or sell copies of the Software, and to permit persons to whom the | ||
11 | * Software is furnished to do so, subject to the following conditions: | ||
12 | * | ||
13 | * The above copyright notice and this permission notice shall be included in | ||
14 | * all copies or substantial portions of the Software. | ||
15 | * | ||
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
19 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
22 | * DEALINGS IN THE SOFTWARE. | ||
23 | */ | ||
24 | |||
25 | #ifndef _NVGPU_GP106_FUSE | ||
26 | #define _NVGPU_GP106_FUSE | ||
27 | |||
28 | struct gk20a; | ||
29 | |||
30 | int gp106_fuse_check_priv_security(struct gk20a *g); | ||
31 | |||
32 | #endif | ||
diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c index e9ee77fc..d63398c7 100644 --- a/drivers/gpu/nvgpu/gp106/hal_gp106.c +++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c | |||
@@ -79,6 +79,7 @@ | |||
79 | #include "gp106/fb_gp106.h" | 79 | #include "gp106/fb_gp106.h" |
80 | #include "gp106/gp106_gating_reglist.h" | 80 | #include "gp106/gp106_gating_reglist.h" |
81 | #include "gp106/flcn_gp106.h" | 81 | #include "gp106/flcn_gp106.h" |
82 | #include "gp106/fuse_gp106.h" | ||
82 | 83 | ||
83 | #include "hal_gp106.h" | 84 | #include "hal_gp106.h" |
84 | 85 | ||
@@ -704,6 +705,9 @@ static const struct gpu_ops gp106_ops = { | |||
704 | .priv_ring = { | 705 | .priv_ring = { |
705 | .isr = gp10b_priv_ring_isr, | 706 | .isr = gp10b_priv_ring_isr, |
706 | }, | 707 | }, |
708 | .fuse = { | ||
709 | .check_priv_security = gp106_fuse_check_priv_security, | ||
710 | }, | ||
707 | .get_litter_value = gp106_get_litter_value, | 711 | .get_litter_value = gp106_get_litter_value, |
708 | .chip_init_gpu_characteristics = gp106_init_gpu_characteristics, | 712 | .chip_init_gpu_characteristics = gp106_init_gpu_characteristics, |
709 | }; | 713 | }; |
@@ -753,6 +757,7 @@ int gp106_init_hal(struct gk20a *g) | |||
753 | gops->xve = gp106_ops.xve; | 757 | gops->xve = gp106_ops.xve; |
754 | gops->falcon = gp106_ops.falcon; | 758 | gops->falcon = gp106_ops.falcon; |
755 | gops->priv_ring = gp106_ops.priv_ring; | 759 | gops->priv_ring = gp106_ops.priv_ring; |
760 | gops->fuse = gp106_ops.fuse; | ||
756 | 761 | ||
757 | /* Lone functions */ | 762 | /* Lone functions */ |
758 | gops->get_litter_value = gp106_ops.get_litter_value; | 763 | gops->get_litter_value = gp106_ops.get_litter_value; |
@@ -760,11 +765,13 @@ int gp106_init_hal(struct gk20a *g) | |||
760 | gp106_ops.chip_init_gpu_characteristics; | 765 | gp106_ops.chip_init_gpu_characteristics; |
761 | 766 | ||
762 | __nvgpu_set_enabled(g, NVGPU_GR_USE_DMA_FOR_FW_BOOTSTRAP, true); | 767 | __nvgpu_set_enabled(g, NVGPU_GR_USE_DMA_FOR_FW_BOOTSTRAP, true); |
763 | __nvgpu_set_enabled(g, NVGPU_SEC_PRIVSECURITY, true); | ||
764 | __nvgpu_set_enabled(g, NVGPU_SEC_SECUREGPCCS, true); | ||
765 | __nvgpu_set_enabled(g, NVGPU_PMU_PSTATE, true); | 768 | __nvgpu_set_enabled(g, NVGPU_PMU_PSTATE, true); |
766 | __nvgpu_set_enabled(g, NVGPU_PMU_FECS_BOOTSTRAP_DONE, false); | 769 | __nvgpu_set_enabled(g, NVGPU_PMU_FECS_BOOTSTRAP_DONE, false); |
767 | 770 | ||
771 | /* Read fuses to check if gpu needs to boot in secure/non-secure mode */ | ||
772 | if (gops->fuse.check_priv_security(g)) | ||
773 | return -EINVAL; /* Do not boot gpu */ | ||
774 | |||
768 | g->pmu_lsf_pmu_wpr_init_done = 0; | 775 | g->pmu_lsf_pmu_wpr_init_done = 0; |
769 | g->bootstrap_owner = LSF_FALCON_ID_SEC2; | 776 | g->bootstrap_owner = LSF_FALCON_ID_SEC2; |
770 | 777 | ||