summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMahantesh Kumbar <mkumbar@nvidia.com>2016-06-17 04:39:34 -0400
committerDeepak Nibade <dnibade@nvidia.com>2016-12-27 04:56:17 -0500
commitd4eb7f691ef14263377c0f33777b104e2b1a0c53 (patch)
treeaa6f0dbbe9cfea722f62bce036130ff999d2c108
parent454cb1631be1a09b25c45a18a97fdaae2f5cdf76 (diff)
gpu: nvgpu: select FW based on ARCH
JIRA DNVGPU-34 Change-Id: Iea1964c7d12536591659188c8e969fc7fb632d12 Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com> Reviewed-on: http://git-master/r/1166785 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/gp106/acr_gp106.c31
-rw-r--r--drivers/gpu/nvgpu/gp106/acr_gp106.h5
-rw-r--r--drivers/gpu/nvgpu/gp106/gr_ctx_gp106.c19
-rw-r--r--drivers/gpu/nvgpu/gp106/gr_ctx_gp106.h1
-rw-r--r--drivers/gpu/nvgpu/gp106/hal_gp106.c13
-rw-r--r--drivers/gpu/nvgpu/gp10b/gr_ctx_gp10b.c2
6 files changed, 52 insertions, 19 deletions
diff --git a/drivers/gpu/nvgpu/gp106/acr_gp106.c b/drivers/gpu/nvgpu/gp106/acr_gp106.c
index 0e49214e..a578c4a0 100644
--- a/drivers/gpu/nvgpu/gp106/acr_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/acr_gp106.c
@@ -27,6 +27,7 @@
27#include "gm20b/acr_gm20b.h" 27#include "gm20b/acr_gm20b.h"
28#include "gm206/pmu_gm206.h" 28#include "gm206/pmu_gm206.h"
29#include "sec2_gp106.h" 29#include "sec2_gp106.h"
30#include "nvgpu_gpuid_t18x.h"
30 31
31/*Defines*/ 32/*Defines*/
32#define gp106_dbg_pmu(fmt, arg...) \ 33#define gp106_dbg_pmu(fmt, arg...) \
@@ -185,11 +186,22 @@ release_img_fw:
185 186
186int fecs_ucode_details(struct gk20a *g, struct flcn_ucode_img_v1 *p_img) 187int fecs_ucode_details(struct gk20a *g, struct flcn_ucode_img_v1 *p_img)
187{ 188{
189 u32 ver = g->gpu_characteristics.arch + g->gpu_characteristics.impl;
188 struct lsf_ucode_desc_v1 *lsf_desc; 190 struct lsf_ucode_desc_v1 *lsf_desc;
189 const struct firmware *fecs_sig; 191 const struct firmware *fecs_sig = NULL;
190 int err; 192 int err;
191 193
192 fecs_sig = gk20a_request_firmware(g, GM20B_FECS_UCODE_SIG); 194 switch (ver) {
195 case NVGPU_GPUID_GP104:
196 fecs_sig = gk20a_request_firmware(g, GP104_FECS_UCODE_SIG);
197 break;
198 case NVGPU_GPUID_GP106:
199 fecs_sig = gk20a_request_firmware(g, GP106_FECS_UCODE_SIG);
200 break;
201 default:
202 gk20a_err(g->dev, "no support for GPUID %x", ver);
203 }
204
193 if (!fecs_sig) { 205 if (!fecs_sig) {
194 gk20a_err(dev_from_gk20a(g), "failed to load fecs sig"); 206 gk20a_err(dev_from_gk20a(g), "failed to load fecs sig");
195 return -ENOENT; 207 return -ENOENT;
@@ -252,14 +264,25 @@ rel_sig:
252} 264}
253int gpccs_ucode_details(struct gk20a *g, struct flcn_ucode_img_v1 *p_img) 265int gpccs_ucode_details(struct gk20a *g, struct flcn_ucode_img_v1 *p_img)
254{ 266{
267 u32 ver = g->gpu_characteristics.arch + g->gpu_characteristics.impl;
255 struct lsf_ucode_desc_v1 *lsf_desc; 268 struct lsf_ucode_desc_v1 *lsf_desc;
256 const struct firmware *gpccs_sig; 269 const struct firmware *gpccs_sig = NULL;
257 int err; 270 int err;
258 271
259 if (g->ops.securegpccs == false) 272 if (g->ops.securegpccs == false)
260 return -ENOENT; 273 return -ENOENT;
261 274
262 gpccs_sig = gk20a_request_firmware(g, T18x_GPCCS_UCODE_SIG); 275 switch (ver) {
276 case NVGPU_GPUID_GP104:
277 gpccs_sig = gk20a_request_firmware(g, GP104_GPCCS_UCODE_SIG);
278 break;
279 case NVGPU_GPUID_GP106:
280 gpccs_sig = gk20a_request_firmware(g, GP106_GPCCS_UCODE_SIG);
281 break;
282 default:
283 gk20a_err(g->dev, "no support for GPUID %x", ver);
284 }
285
263 if (!gpccs_sig) { 286 if (!gpccs_sig) {
264 gk20a_err(dev_from_gk20a(g), "failed to load gpccs sig"); 287 gk20a_err(dev_from_gk20a(g), "failed to load gpccs sig");
265 return -ENOENT; 288 return -ENOENT;
diff --git a/drivers/gpu/nvgpu/gp106/acr_gp106.h b/drivers/gpu/nvgpu/gp106/acr_gp106.h
index 9afec529..cd555eb8 100644
--- a/drivers/gpu/nvgpu/gp106/acr_gp106.h
+++ b/drivers/gpu/nvgpu/gp106/acr_gp106.h
@@ -17,6 +17,11 @@
17#include "gm20b/acr_gm20b.h" 17#include "gm20b/acr_gm20b.h"
18#include "gm206/acr_gm206.h" 18#include "gm206/acr_gm206.h"
19 19
20#define GP106_FECS_UCODE_SIG "gp106/fecs_sig.bin"
21#define GP106_GPCCS_UCODE_SIG "gp106/gpccs_sig.bin"
22#define GP104_FECS_UCODE_SIG "gp104/fecs_sig.bin"
23#define GP104_GPCCS_UCODE_SIG "gp104/gpccs_sig.bin"
24
20struct lsf_ucode_desc_v1 { 25struct lsf_ucode_desc_v1 {
21 u8 prd_keys[2][16]; 26 u8 prd_keys[2][16];
22 u8 dbg_keys[2][16]; 27 u8 dbg_keys[2][16];
diff --git a/drivers/gpu/nvgpu/gp106/gr_ctx_gp106.c b/drivers/gpu/nvgpu/gp106/gr_ctx_gp106.c
index 34e1f859..1f47cc5a 100644
--- a/drivers/gpu/nvgpu/gp106/gr_ctx_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/gr_ctx_gp106.c
@@ -15,10 +15,25 @@
15 15
16#include "gk20a/gk20a.h" 16#include "gk20a/gk20a.h"
17#include "gr_ctx_gp106.h" 17#include "gr_ctx_gp106.h"
18#include "nvgpu_gpuid_t18x.h"
18 19
19static int gr_gp106_get_netlist_name(int index, char *name) 20static int gr_gp106_get_netlist_name(struct gk20a *g, int index, char *name)
20{ 21{
21 sprintf(name, GP106_NETLIST_IMAGE_FW_NAME); 22 u32 ver = g->gpu_characteristics.arch + g->gpu_characteristics.impl;
23
24 switch (ver) {
25 case NVGPU_GPUID_GP104:
26 sprintf(name, "%s/%s", "gp104",
27 GP104_NETLIST_IMAGE_FW_NAME);
28 break;
29 case NVGPU_GPUID_GP106:
30 sprintf(name, "%s/%s", "gp106",
31 GP106_NETLIST_IMAGE_FW_NAME);
32 break;
33 default:
34 gk20a_err(g->dev, "no support for GPUID %x", ver);
35 }
36
22 return 0; 37 return 0;
23} 38}
24 39
diff --git a/drivers/gpu/nvgpu/gp106/gr_ctx_gp106.h b/drivers/gpu/nvgpu/gp106/gr_ctx_gp106.h
index d14a9126..fef80abb 100644
--- a/drivers/gpu/nvgpu/gp106/gr_ctx_gp106.h
+++ b/drivers/gpu/nvgpu/gp106/gr_ctx_gp106.h
@@ -20,6 +20,7 @@
20 20
21/* production netlist, one and only one from below */ 21/* production netlist, one and only one from below */
22#define GP106_NETLIST_IMAGE_FW_NAME GK20A_NETLIST_IMAGE_C 22#define GP106_NETLIST_IMAGE_FW_NAME GK20A_NETLIST_IMAGE_C
23#define GP104_NETLIST_IMAGE_FW_NAME GK20A_NETLIST_IMAGE_D
23 24
24void gp106_init_gr_ctx(struct gpu_ops *gops); 25void gp106_init_gr_ctx(struct gpu_ops *gops);
25 26
diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c
index f9cd2e07..a47fa0fd 100644
--- a/drivers/gpu/nvgpu/gp106/hal_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c
@@ -180,7 +180,6 @@ int gp106_init_hal(struct gk20a *g)
180{ 180{
181 struct gpu_ops *gops = &g->ops; 181 struct gpu_ops *gops = &g->ops;
182 struct nvgpu_gpu_characteristics *c = &g->gpu_characteristics; 182 struct nvgpu_gpu_characteristics *c = &g->gpu_characteristics;
183 u32 ver = g->gpu_characteristics.arch + g->gpu_characteristics.impl;
184 183
185 gk20a_dbg_fn(""); 184 gk20a_dbg_fn("");
186 185
@@ -203,17 +202,7 @@ int gp106_init_hal(struct gk20a *g)
203 gp10b_init_cde_ops(gops); 202 gp10b_init_cde_ops(gops);
204 gp10b_init_therm_ops(gops); 203 gp10b_init_therm_ops(gops);
205 gm206_init_bios(gops); 204 gm206_init_bios(gops);
206 switch(ver){ 205 gops->name = "gp10x";
207 case NVGPU_GPUID_GP106:
208 gops->name = "gp106";
209 break;
210 case NVGPU_GPUID_GP104:
211 gops->name = "gp104";
212 break;
213 default:
214 gk20a_err(g->dev, "no support for %x", ver);
215 BUG();
216 }
217 gops->get_litter_value = gp106_get_litter_value; 206 gops->get_litter_value = gp106_get_litter_value;
218 gops->chip_init_gpu_characteristics = gk20a_init_gpu_characteristics; 207 gops->chip_init_gpu_characteristics = gk20a_init_gpu_characteristics;
219 gops->gr_ctx.use_dma_for_fw_bootstrap = true; 208 gops->gr_ctx.use_dma_for_fw_bootstrap = true;
diff --git a/drivers/gpu/nvgpu/gp10b/gr_ctx_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_ctx_gp10b.c
index b2956257..2bb4a313 100644
--- a/drivers/gpu/nvgpu/gp10b/gr_ctx_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/gr_ctx_gp10b.c
@@ -22,7 +22,7 @@
22#include "gk20a/gk20a.h" 22#include "gk20a/gk20a.h"
23#include "gr_ctx_gp10b.h" 23#include "gr_ctx_gp10b.h"
24 24
25static int gr_gp10b_get_netlist_name(int index, char *name) 25static int gr_gp10b_get_netlist_name(struct gk20a *g, int index, char *name)
26{ 26{
27 switch (index) { 27 switch (index) {
28#ifdef GP10B_NETLIST_IMAGE_FW_NAME 28#ifdef GP10B_NETLIST_IMAGE_FW_NAME