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

@@ -81,6 +81,7 @@ struct gk20a_platform {
/* controls gc off feature for pci gpu */
bool can_pci_gc_off;
#ifdef CONFIG_NVGPU_STATIC_POWERGATE
/* Should be populated at probe. */
bool can_tpc_pg;
@@ -89,7 +90,7 @@ struct gk20a_platform {
/* Should be populated at probe. */
bool can_gpc_pg;
#endif
/* Should be populated at probe. */
bool can_elpg_init;
@@ -118,12 +119,14 @@ struct gk20a_platform {
/* Reset control for device */
struct reset_control *reset_control;
#endif
/* valid TPC-MASK */
u32 valid_tpc_mask[MAX_TPC_PG_CONFIGS];
/* Valid GPC and FBP mask */
u32 valid_gpc_fbp_fs_mask[MAX_GPC_FBP_FS_CONFIGS];
#ifdef CONFIG_NVGPU_STATIC_POWERGATE
/* valid TPC-PG MASK */
u32 valid_tpc_pg_mask[MAX_PG_TPC_CONFIGS];
/* Valid GPC-PG and FBP-PG mask */
u32 valid_gpc_fbp_pg_mask[MAX_PG_GPC_FBP_CONFIGS];
#endif
/* Delay before rail gated */
int railgate_delay_init;
@@ -244,15 +247,16 @@ struct gk20a_platform {
/* Pre callback is called before frequency change */
void (*prescale)(struct device *dev);
#ifdef CONFIG_NVGPU_STATIC_POWERGATE
/* Set TPC_PG_MASK during probe */
void (*set_tpc_pg_mask)(struct device *dev, u32 tpc_pg_mask);
int (*set_tpc_pg_mask)(struct device *dev, u32 dt_tpc_pg_mask);
/* Set GPC_MASK during probe */
void (*set_gpc_mask)(struct device *dev, u32 gpc_mask);
/* Set FBP_MASK during probe */
void (*set_fbp_mask)(struct device *dev, u32 fbp_mask);
/* Set GPC_PG_MASK during probe */
int (*set_gpc_pg_mask)(struct device *dev, u32 dt_gpc_pg_mask);
/* Set FBP_PG_MASK during probe */
int (*set_fbp_pg_mask)(struct device *dev, u32 dt_fbp_pg_mask);
#endif
/* Devfreq governor name. If scaling is enabled, we request
* this governor to be used in scaling */
const char *devfreq_governor;