diff --git a/common/tegra_hwpm_init.c b/common/tegra_hwpm_init.c index 2d4cefb..85abfda 100644 --- a/common/tegra_hwpm_init.c +++ b/common/tegra_hwpm_init.c @@ -183,13 +183,6 @@ int tegra_hwpm_setup_hw(struct tegra_soc_hwpm *hwpm) goto fail; } - /* Disable SLCG */ - ret = hwpm->active_chip->disable_slcg(hwpm); - if (ret < 0) { - tegra_hwpm_err(hwpm, "Unable to disable SLCG"); - goto fail; - } - /* Program PROD values */ ret = hwpm->active_chip->init_prod_values(hwpm); if (ret < 0) { @@ -197,6 +190,13 @@ int tegra_hwpm_setup_hw(struct tegra_soc_hwpm *hwpm) goto fail; } + /* Disable SLCG */ + ret = hwpm->active_chip->disable_cg(hwpm); + if (ret < 0) { + tegra_hwpm_err(hwpm, "Unable to disable SLCG"); + goto fail; + } + return 0; fail: return ret; @@ -215,8 +215,8 @@ int tegra_hwpm_release_hw(struct tegra_soc_hwpm *hwpm) tegra_hwpm_fn(hwpm, " "); - /* Enable SLCG */ - ret = hwpm->active_chip->enable_slcg(hwpm); + /* Enable CG */ + ret = hwpm->active_chip->enable_cg(hwpm); if (ret < 0) { tegra_hwpm_err(hwpm, "Unable to enable SLCG"); goto fail; diff --git a/hal/t234/t234_hwpm_aperture_utils.c b/hal/t234/t234_hwpm_aperture_utils.c index b5141d8..9e18264 100644 --- a/hal/t234/t234_hwpm_aperture_utils.c +++ b/hal/t234/t234_hwpm_aperture_utils.c @@ -198,10 +198,17 @@ int t234_hwpm_init_prod_values(struct tegra_soc_hwpm *hwpm) return err; } + /* CG enable is expected PROD value */ + err = hwpm->active_chip->enable_cg(hwpm); + if (err < 0) { + tegra_hwpm_err(hwpm, "Unable to enable SLCG"); + return err; + } + return 0; } -int t234_hwpm_disable_slcg(struct tegra_soc_hwpm *hwpm) +int t234_hwpm_disable_cg(struct tegra_soc_hwpm *hwpm) { int err = 0; u32 field_mask = 0U; @@ -257,7 +264,7 @@ int t234_hwpm_disable_slcg(struct tegra_soc_hwpm *hwpm) return 0; } -int t234_hwpm_enable_slcg(struct tegra_soc_hwpm *hwpm) +int t234_hwpm_enable_cg(struct tegra_soc_hwpm *hwpm) { int err = 0; u32 reg_val = 0U; diff --git a/hal/t234/t234_hwpm_interface_utils.c b/hal/t234/t234_hwpm_interface_utils.c index c3a96b8..befc807 100644 --- a/hal/t234/t234_hwpm_interface_utils.c +++ b/hal/t234/t234_hwpm_interface_utils.c @@ -38,8 +38,8 @@ static struct tegra_soc_hwpm_chip t234_chip_info = { .get_resource_info = t234_hwpm_get_resource_info, .init_prod_values = t234_hwpm_init_prod_values, - .disable_slcg = t234_hwpm_disable_slcg, - .enable_slcg = t234_hwpm_enable_slcg, + .disable_cg = t234_hwpm_disable_cg, + .enable_cg = t234_hwpm_enable_cg, .reserve_rtr = tegra_hwpm_reserve_rtr, .release_rtr = tegra_hwpm_release_rtr, @@ -118,13 +118,13 @@ static bool t234_hwpm_validate_hals(struct tegra_soc_hwpm *hwpm) return false; } - if (hwpm->active_chip->disable_slcg == NULL) { - tegra_hwpm_err(hwpm, "disable_slcg uninitialized"); + if (hwpm->active_chip->disable_cg == NULL) { + tegra_hwpm_err(hwpm, "disable_cg uninitialized"); return false; } - if (hwpm->active_chip->enable_slcg == NULL) { - tegra_hwpm_err(hwpm, "enable_slcg uninitialized"); + if (hwpm->active_chip->enable_cg == NULL) { + tegra_hwpm_err(hwpm, "enable_cg uninitialized"); return false; } diff --git a/hal/t234/t234_hwpm_internal.h b/hal/t234/t234_hwpm_internal.h index 5851e65..c1383e1 100644 --- a/hal/t234/t234_hwpm_internal.h +++ b/hal/t234/t234_hwpm_internal.h @@ -86,8 +86,8 @@ int t234_hwpm_get_resource_info(struct tegra_soc_hwpm *hwpm, u32 resource_enum, u8 *status); int t234_hwpm_init_prod_values(struct tegra_soc_hwpm *hwpm); -int t234_hwpm_disable_slcg(struct tegra_soc_hwpm *hwpm); -int t234_hwpm_enable_slcg(struct tegra_soc_hwpm *hwpm); +int t234_hwpm_disable_cg(struct tegra_soc_hwpm *hwpm); +int t234_hwpm_enable_cg(struct tegra_soc_hwpm *hwpm); int t234_hwpm_disable_triggers(struct tegra_soc_hwpm *hwpm); int t234_hwpm_perfmon_enable(struct tegra_soc_hwpm *hwpm, diff --git a/include/tegra_hwpm.h b/include/tegra_hwpm.h index 7194ec2..26aad8a 100644 --- a/include/tegra_hwpm.h +++ b/include/tegra_hwpm.h @@ -361,8 +361,8 @@ struct tegra_soc_hwpm_chip { u32 resource_enum, u8 *status); int (*init_prod_values)(struct tegra_soc_hwpm *hwpm); - int (*disable_slcg)(struct tegra_soc_hwpm *hwpm); - int (*enable_slcg)(struct tegra_soc_hwpm *hwpm); + int (*disable_cg)(struct tegra_soc_hwpm *hwpm); + int (*enable_cg)(struct tegra_soc_hwpm *hwpm); int (*reserve_rtr)(struct tegra_soc_hwpm *hwpm); int (*release_rtr)(struct tegra_soc_hwpm *hwpm);