diff options
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 | ||