diff options
author | Mahantesh Kumbar <mkumbar@nvidia.com> | 2017-02-14 02:22:20 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-02-15 22:33:28 -0500 |
commit | d465504534b2ec7ab0be190fc98b24e1b77634e2 (patch) | |
tree | 3ee1a90cb49cb2a3df3b39c79b37bdbcddeffe97 /drivers/gpu/nvgpu/gp106 | |
parent | 907adfd785e3a3582b2649c48bf4c32f41745e3f (diff) |
gpu: nvgpu: Remove PMU gm204/gm206 support
-Created new methods for PMU gp106 whichever dependent
on gm206.
-Deleted pmu_gm206.c/h files & removed its involvement
from dependent files.
Change-Id: Ic578da53bff362efb3e142962275227787206233
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: http://git-master/r/1304492
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp106')
-rw-r--r-- | drivers/gpu/nvgpu/gp106/acr_gp106.c | 6 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp106/pmu_gp106.c | 110 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp106/sec2_gp106.c | 4 |
3 files changed, 109 insertions, 11 deletions
diff --git a/drivers/gpu/nvgpu/gp106/acr_gp106.c b/drivers/gpu/nvgpu/gp106/acr_gp106.c index f8d7ba70..f5a4053b 100644 --- a/drivers/gpu/nvgpu/gp106/acr_gp106.c +++ b/drivers/gpu/nvgpu/gp106/acr_gp106.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 4 | * This program is free software; you can redistribute it and/or modify it |
5 | * under the terms and conditions of the GNU General Public License, | 5 | * under the terms and conditions of the GNU General Public License, |
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | #include "gm206/acr_gm206.h" | 25 | #include "gm206/acr_gm206.h" |
26 | #include "gm20b/acr_gm20b.h" | 26 | #include "gm20b/acr_gm20b.h" |
27 | #include "gm206/pmu_gm206.h" | 27 | #include "gp106/pmu_gp106.h" |
28 | 28 | ||
29 | #include "sec2_gp106.h" | 29 | #include "sec2_gp106.h" |
30 | #include "nvgpu_gpuid_t18x.h" | 30 | #include "nvgpu_gpuid_t18x.h" |
@@ -122,8 +122,6 @@ void gp106_init_secure_pmu(struct gpu_ops *gops) | |||
122 | { | 122 | { |
123 | gops->pmu.prepare_ucode = gp106_prepare_ucode_blob; | 123 | gops->pmu.prepare_ucode = gp106_prepare_ucode_blob; |
124 | gops->pmu.pmu_setup_hw_and_bootstrap = gp106_bootstrap_hs_flcn; | 124 | gops->pmu.pmu_setup_hw_and_bootstrap = gp106_bootstrap_hs_flcn; |
125 | gops->pmu.is_lazy_bootstrap = gm206_is_lazy_bootstrap; | ||
126 | gops->pmu.is_priv_load = gm206_is_priv_load; | ||
127 | gops->pmu.get_wpr = gp106_wpr_info; | 125 | gops->pmu.get_wpr = gp106_wpr_info; |
128 | gops->pmu.alloc_blob_space = gp106_alloc_blob_space; | 126 | gops->pmu.alloc_blob_space = gp106_alloc_blob_space; |
129 | gops->pmu.pmu_populate_loader_cfg = gp106_pmu_populate_loader_cfg; | 127 | gops->pmu.pmu_populate_loader_cfg = gp106_pmu_populate_loader_cfg; |
diff --git a/drivers/gpu/nvgpu/gp106/pmu_gp106.c b/drivers/gpu/nvgpu/gp106/pmu_gp106.c index 9aac5328..5a9d5ba6 100644 --- a/drivers/gpu/nvgpu/gp106/pmu_gp106.c +++ b/drivers/gpu/nvgpu/gp106/pmu_gp106.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include "gk20a/pmu_gk20a.h" | 17 | #include "gk20a/pmu_gk20a.h" |
18 | 18 | ||
19 | #include "gm20b/pmu_gm20b.h" | 19 | #include "gm20b/pmu_gm20b.h" |
20 | #include "gm206/pmu_gm206.h" | ||
21 | #include "gp10b/pmu_gp10b.h" | 20 | #include "gp10b/pmu_gp10b.h" |
22 | #include "gp106/pmu_gp106.h" | 21 | #include "gp106/pmu_gp106.h" |
23 | #include "gp106/acr_gp106.h" | 22 | #include "gp106/acr_gp106.h" |
@@ -299,6 +298,109 @@ static bool gp106_pmu_is_lpwr_feature_supported(struct gk20a *g, u32 feature_id) | |||
299 | return is_feature_supported; | 298 | return is_feature_supported; |
300 | } | 299 | } |
301 | 300 | ||
301 | static bool gp106_is_lazy_bootstrap(u32 falcon_id) | ||
302 | { | ||
303 | bool enable_status = false; | ||
304 | |||
305 | switch (falcon_id) { | ||
306 | case LSF_FALCON_ID_FECS: | ||
307 | enable_status = true; | ||
308 | break; | ||
309 | case LSF_FALCON_ID_GPCCS: | ||
310 | enable_status = true; | ||
311 | break; | ||
312 | default: | ||
313 | break; | ||
314 | } | ||
315 | |||
316 | return enable_status; | ||
317 | } | ||
318 | |||
319 | static bool gp106_is_priv_load(u32 falcon_id) | ||
320 | { | ||
321 | bool enable_status = false; | ||
322 | |||
323 | switch (falcon_id) { | ||
324 | case LSF_FALCON_ID_FECS: | ||
325 | enable_status = true; | ||
326 | break; | ||
327 | case LSF_FALCON_ID_GPCCS: | ||
328 | enable_status = true; | ||
329 | break; | ||
330 | default: | ||
331 | break; | ||
332 | } | ||
333 | |||
334 | return enable_status; | ||
335 | } | ||
336 | |||
337 | static void gp106_pmu_load_multiple_falcons(struct gk20a *g, u32 falconidmask, | ||
338 | u32 flags) | ||
339 | { | ||
340 | struct pmu_gk20a *pmu = &g->pmu; | ||
341 | struct pmu_cmd cmd; | ||
342 | u32 seq; | ||
343 | |||
344 | gk20a_dbg_fn(""); | ||
345 | |||
346 | gp106_dbg_pmu("wprinit status = %x\n", g->ops.pmu.lspmuwprinitdone); | ||
347 | if (g->ops.pmu.lspmuwprinitdone) { | ||
348 | /* send message to load FECS falcon */ | ||
349 | memset(&cmd, 0, sizeof(struct pmu_cmd)); | ||
350 | cmd.hdr.unit_id = PMU_UNIT_ACR; | ||
351 | cmd.hdr.size = PMU_CMD_HDR_SIZE + | ||
352 | sizeof(struct pmu_acr_cmd_bootstrap_multiple_falcons); | ||
353 | cmd.cmd.acr.boot_falcons.cmd_type = | ||
354 | PMU_ACR_CMD_ID_BOOTSTRAP_MULTIPLE_FALCONS; | ||
355 | cmd.cmd.acr.boot_falcons.flags = flags; | ||
356 | cmd.cmd.acr.boot_falcons.falconidmask = | ||
357 | falconidmask; | ||
358 | cmd.cmd.acr.boot_falcons.usevamask = 0; | ||
359 | cmd.cmd.acr.boot_falcons.wprvirtualbase.lo = 0; | ||
360 | cmd.cmd.acr.boot_falcons.wprvirtualbase.hi = 0; | ||
361 | |||
362 | gp106_dbg_pmu("PMU_ACR_CMD_ID_BOOTSTRAP_MULTIPLE_FALCONS:%x\n", | ||
363 | falconidmask); | ||
364 | gk20a_pmu_cmd_post(g, &cmd, NULL, NULL, PMU_COMMAND_QUEUE_HPQ, | ||
365 | pmu_handle_fecs_boot_acr_msg, pmu, &seq, ~0); | ||
366 | } | ||
367 | |||
368 | gk20a_dbg_fn("done"); | ||
369 | } | ||
370 | |||
371 | static int gp106_load_falcon_ucode(struct gk20a *g, u32 falconidmask) | ||
372 | { | ||
373 | u32 flags = PMU_ACR_CMD_BOOTSTRAP_FALCON_FLAGS_RESET_YES; | ||
374 | |||
375 | /* GM20B PMU supports loading FECS and GPCCS only */ | ||
376 | if (falconidmask == 0) | ||
377 | return -EINVAL; | ||
378 | if (falconidmask & ~((1 << LSF_FALCON_ID_FECS) | | ||
379 | (1 << LSF_FALCON_ID_GPCCS))) | ||
380 | return -EINVAL; | ||
381 | g->ops.pmu.lsfloadedfalconid = 0; | ||
382 | /* check whether pmu is ready to bootstrap lsf if not wait for it */ | ||
383 | if (!g->ops.pmu.lspmuwprinitdone) { | ||
384 | pmu_wait_message_cond(&g->pmu, | ||
385 | gk20a_get_gr_idle_timeout(g), | ||
386 | &g->ops.pmu.lspmuwprinitdone, 1); | ||
387 | /* check again if it still not ready indicate an error */ | ||
388 | if (!g->ops.pmu.lspmuwprinitdone) { | ||
389 | gk20a_err(dev_from_gk20a(g), | ||
390 | "PMU not ready to load LSF"); | ||
391 | return -ETIMEDOUT; | ||
392 | } | ||
393 | } | ||
394 | /* load falcon(s) */ | ||
395 | gp106_pmu_load_multiple_falcons(g, falconidmask, flags); | ||
396 | pmu_wait_message_cond(&g->pmu, | ||
397 | gk20a_get_gr_idle_timeout(g), | ||
398 | &g->ops.pmu.lsfloadedfalconid, falconidmask); | ||
399 | if (g->ops.pmu.lsfloadedfalconid != falconidmask) | ||
400 | return -ETIMEDOUT; | ||
401 | return 0; | ||
402 | } | ||
403 | |||
302 | void gp106_init_pmu_ops(struct gpu_ops *gops) | 404 | void gp106_init_pmu_ops(struct gpu_ops *gops) |
303 | { | 405 | { |
304 | gk20a_dbg_fn(""); | 406 | gk20a_dbg_fn(""); |
@@ -306,9 +408,9 @@ void gp106_init_pmu_ops(struct gpu_ops *gops) | |||
306 | if (gops->privsecurity) { | 408 | if (gops->privsecurity) { |
307 | gp106_init_secure_pmu(gops); | 409 | gp106_init_secure_pmu(gops); |
308 | gops->pmu.init_wpr_region = gm20b_pmu_init_acr; | 410 | gops->pmu.init_wpr_region = gm20b_pmu_init_acr; |
309 | gops->pmu.load_lsfalcon_ucode = gm206_load_falcon_ucode; | 411 | gops->pmu.load_lsfalcon_ucode = gp106_load_falcon_ucode; |
310 | gops->pmu.is_lazy_bootstrap = gm206_is_lazy_bootstrap; | 412 | gops->pmu.is_lazy_bootstrap = gp106_is_lazy_bootstrap; |
311 | gops->pmu.is_priv_load = gm206_is_priv_load; | 413 | gops->pmu.is_priv_load = gp106_is_priv_load; |
312 | } else { | 414 | } else { |
313 | gk20a_init_pmu_ops(gops); | 415 | gk20a_init_pmu_ops(gops); |
314 | gops->pmu.pmu_setup_hw_and_bootstrap = | 416 | gops->pmu.pmu_setup_hw_and_bootstrap = |
diff --git a/drivers/gpu/nvgpu/gp106/sec2_gp106.c b/drivers/gpu/nvgpu/gp106/sec2_gp106.c index 738519cf..9af16886 100644 --- a/drivers/gpu/nvgpu/gp106/sec2_gp106.c +++ b/drivers/gpu/nvgpu/gp106/sec2_gp106.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 4 | * This program is free software; you can redistribute it and/or modify it |
5 | * under the terms and conditions of the GNU General Public License, | 5 | * under the terms and conditions of the GNU General Public License, |
@@ -17,8 +17,6 @@ | |||
17 | #include "gk20a/gk20a.h" | 17 | #include "gk20a/gk20a.h" |
18 | #include "gk20a/pmu_gk20a.h" | 18 | #include "gk20a/pmu_gk20a.h" |
19 | 19 | ||
20 | #include "gm206/pmu_gm206.h" | ||
21 | |||
22 | #include "gm20b/pmu_gm20b.h" | 20 | #include "gm20b/pmu_gm20b.h" |
23 | 21 | ||
24 | #include "gp10b/pmu_gp10b.h" | 22 | #include "gp10b/pmu_gp10b.h" |