gpu: nvgpu: add platform support for Static PG

- Add support for taking static PG config values
  from DT nodes
- Check those values against valid set of values
  for GPC, TPC and FBP
- Store valid values in g->gpc_pg_mask, g->fbp_pg_mask
  and g->tpc_pg_mask[] array.

Bug 200768322
JIRA NVGPU-6433

Change-Id: Ifc87e7d369034b1daa13866bc16a970602514bf6
Signed-off-by: Divya <dsinghatwari@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2594802
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Divya
2021-09-09 07:22:51 +00:00
committed by mobile promotions
parent 9984b59a00
commit ae2d561c48
12 changed files with 364 additions and 113 deletions

View File

@@ -1588,6 +1588,7 @@ static int nvgpu_read_fuse_overrides(struct gk20a *g)
struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g));
u32 *fuses;
int count, i;
int ret = 0;
if (!np) /* may be pcie device */
return 0;
@@ -1612,24 +1613,44 @@ static int nvgpu_read_fuse_overrides(struct gk20a *g)
case GP10B_FUSE_OPT_ECC_EN:
g->fecs_feature_override_ecc_val = value;
break;
#ifdef CONFIG_NVGPU_STATIC_POWERGATE
case GV11B_FUSE_OPT_TPC_DISABLE:
if (platform->set_tpc_pg_mask != NULL)
platform->set_tpc_pg_mask(dev_from_gk20a(g),
if (platform->set_tpc_pg_mask != NULL) {
ret = platform->set_tpc_pg_mask(dev_from_gk20a(g),
value);
if (ret != 0) {
return -EINVAL;
}
}
break;
case GA10B_FUSE_OPT_TPC_DISABLE:
/* TBD- JIRA NVGPU-6433 */
if (platform->set_tpc_pg_mask != NULL) {
ret = platform->set_tpc_pg_mask(dev_from_gk20a(g),
value);
if (ret != 0) {
return -EINVAL;
}
}
break;
case GA10B_FUSE_OPT_GPC_DISABLE:
if (platform->set_gpc_mask != NULL)
platform->set_gpc_mask(dev_from_gk20a(g),
if (platform->set_gpc_pg_mask != NULL) {
ret = platform->set_gpc_pg_mask(dev_from_gk20a(g),
value);
if (ret != 0) {
return -EINVAL;
}
}
break;
case GA10B_FUSE_OPT_FBP_DISABLE:
if (platform->set_fbp_mask != NULL)
platform->set_fbp_mask(dev_from_gk20a(g),
if (platform->set_fbp_pg_mask != NULL) {
ret = platform->set_fbp_pg_mask(dev_from_gk20a(g),
value);
if (ret != 0) {
return -EINVAL;
}
}
break;
#endif
default:
nvgpu_err(g, "ignore unknown fuse override %08x", fuse);
break;