diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gp106')
-rw-r--r-- | drivers/gpu/nvgpu/gp106/bios_gp106.c | 19 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp106/bios_gp106.h | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp106/hal_gp106.c | 7 |
3 files changed, 20 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/gp106/bios_gp106.c b/drivers/gpu/nvgpu/gp106/bios_gp106.c index b7e031c6..3178ae53 100644 --- a/drivers/gpu/nvgpu/gp106/bios_gp106.c +++ b/drivers/gpu/nvgpu/gp106/bios_gp106.c | |||
@@ -135,6 +135,16 @@ out: | |||
135 | return err; | 135 | return err; |
136 | } | 136 | } |
137 | 137 | ||
138 | int gp106_bios_preos_wait_for_halt(struct gk20a *g) | ||
139 | { | ||
140 | int err = 0; | ||
141 | |||
142 | if (nvgpu_flcn_wait_for_halt(g->pmu.flcn, PMU_BOOT_TIMEOUT_MAX / 1000)) | ||
143 | err = -ETIMEDOUT; | ||
144 | |||
145 | return err; | ||
146 | } | ||
147 | |||
138 | static int gp106_bios_preos(struct gk20a *g) | 148 | static int gp106_bios_preos(struct gk20a *g) |
139 | { | 149 | { |
140 | int err = 0; | 150 | int err = 0; |
@@ -146,6 +156,9 @@ static int gp106_bios_preos(struct gk20a *g) | |||
146 | goto out; | 156 | goto out; |
147 | } | 157 | } |
148 | 158 | ||
159 | if (g->ops.bios.preos_reload_check) | ||
160 | g->ops.bios.preos_reload_check(g); | ||
161 | |||
149 | upload_code(g, g->bios.preos.bootloader_phys_base, | 162 | upload_code(g, g->bios.preos.bootloader_phys_base, |
150 | g->bios.preos.bootloader, | 163 | g->bios.preos.bootloader, |
151 | g->bios.preos.bootloader_size, | 164 | g->bios.preos.bootloader_size, |
@@ -161,11 +174,7 @@ static int gp106_bios_preos(struct gk20a *g) | |||
161 | 174 | ||
162 | nvgpu_flcn_bootstrap(g->pmu.flcn, g->bios.preos.code_entry_point); | 175 | nvgpu_flcn_bootstrap(g->pmu.flcn, g->bios.preos.code_entry_point); |
163 | 176 | ||
164 | if (nvgpu_flcn_wait_for_halt(g->pmu.flcn, | 177 | err = g->ops.bios.preos_wait_for_halt(g); |
165 | PMU_BOOT_TIMEOUT_MAX / 1000)) { | ||
166 | err = -ETIMEDOUT; | ||
167 | goto out; | ||
168 | } | ||
169 | 178 | ||
170 | nvgpu_flcn_clear_halt_intr_status(g->pmu.flcn, | 179 | nvgpu_flcn_clear_halt_intr_status(g->pmu.flcn, |
171 | gk20a_get_gr_idle_timeout(g)); | 180 | gk20a_get_gr_idle_timeout(g)); |
diff --git a/drivers/gpu/nvgpu/gp106/bios_gp106.h b/drivers/gpu/nvgpu/gp106/bios_gp106.h index 0301177e..a5229fff 100644 --- a/drivers/gpu/nvgpu/gp106/bios_gp106.h +++ b/drivers/gpu/nvgpu/gp106/bios_gp106.h | |||
@@ -27,6 +27,5 @@ struct gk20a; | |||
27 | struct gpu_ops; | 27 | struct gpu_ops; |
28 | 28 | ||
29 | int gp106_bios_init(struct gk20a *g); | 29 | int gp106_bios_init(struct gk20a *g); |
30 | void gp106_init_bios_ops(struct gpu_ops *gops); | 30 | int gp106_bios_preos_wait_for_halt(struct gk20a *g); |
31 | |||
32 | #endif | 31 | #endif |
diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c index 1c423785..8523e7d1 100644 --- a/drivers/gpu/nvgpu/gp106/hal_gp106.c +++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c | |||
@@ -216,6 +216,10 @@ static int gp106_init_gpu_characteristics(struct gk20a *g) | |||
216 | } | 216 | } |
217 | 217 | ||
218 | static const struct gpu_ops gp106_ops = { | 218 | static const struct gpu_ops gp106_ops = { |
219 | .bios = { | ||
220 | .init = gp106_bios_init, | ||
221 | .preos_wait_for_halt = gp106_bios_preos_wait_for_halt, | ||
222 | }, | ||
219 | .ltc = { | 223 | .ltc = { |
220 | .determine_L2_size_bytes = gp10b_determine_L2_size_bytes, | 224 | .determine_L2_size_bytes = gp10b_determine_L2_size_bytes, |
221 | .set_zbc_color_entry = gm20b_ltc_set_zbc_color_entry, | 225 | .set_zbc_color_entry = gm20b_ltc_set_zbc_color_entry, |
@@ -695,7 +699,6 @@ static const struct gpu_ops gp106_ops = { | |||
695 | }, | 699 | }, |
696 | .get_litter_value = gp106_get_litter_value, | 700 | .get_litter_value = gp106_get_litter_value, |
697 | .chip_init_gpu_characteristics = gp106_init_gpu_characteristics, | 701 | .chip_init_gpu_characteristics = gp106_init_gpu_characteristics, |
698 | .bios_init = gp106_bios_init, | ||
699 | }; | 702 | }; |
700 | 703 | ||
701 | int gp106_init_hal(struct gk20a *g) | 704 | int gp106_init_hal(struct gk20a *g) |
@@ -705,6 +708,7 @@ int gp106_init_hal(struct gk20a *g) | |||
705 | 708 | ||
706 | gk20a_dbg_fn(""); | 709 | gk20a_dbg_fn(""); |
707 | 710 | ||
711 | gops->bios = gp106_ops.bios; | ||
708 | gops->ltc = gp106_ops.ltc; | 712 | gops->ltc = gp106_ops.ltc; |
709 | gops->ce2 = gp106_ops.ce2; | 713 | gops->ce2 = gp106_ops.ce2; |
710 | gops->gr = gp106_ops.gr; | 714 | gops->gr = gp106_ops.gr; |
@@ -747,7 +751,6 @@ int gp106_init_hal(struct gk20a *g) | |||
747 | gops->get_litter_value = gp106_ops.get_litter_value; | 751 | gops->get_litter_value = gp106_ops.get_litter_value; |
748 | gops->chip_init_gpu_characteristics = | 752 | gops->chip_init_gpu_characteristics = |
749 | gp106_ops.chip_init_gpu_characteristics; | 753 | gp106_ops.chip_init_gpu_characteristics; |
750 | gops->bios_init = gp106_ops.bios_init; | ||
751 | 754 | ||
752 | __nvgpu_set_enabled(g, NVGPU_GR_USE_DMA_FOR_FW_BOOTSTRAP, true); | 755 | __nvgpu_set_enabled(g, NVGPU_GR_USE_DMA_FOR_FW_BOOTSTRAP, true); |
753 | __nvgpu_set_enabled(g, NVGPU_SEC_PRIVSECURITY, true); | 756 | __nvgpu_set_enabled(g, NVGPU_SEC_PRIVSECURITY, true); |