diff --git a/drivers/gpu/nvgpu/common/pmu/pmu.c b/drivers/gpu/nvgpu/common/pmu/pmu.c index b788e90fc..b977db47f 100644 --- a/drivers/gpu/nvgpu/common/pmu/pmu.c +++ b/drivers/gpu/nvgpu/common/pmu/pmu.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2021, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -202,6 +202,7 @@ int nvgpu_pmu_early_init(struct gk20a *g) g->elpg_enabled = false; g->aelpg_enabled = false; nvgpu_set_enabled(g, NVGPU_PMU_PERFMON, false); + nvgpu_set_enabled(g, NVGPU_ELPG_MS_ENABLED, false); #ifdef CONFIG_NVGPU_DGPU nvgpu_set_enabled(g, NVGPU_PMU_PSTATE, false); #endif diff --git a/drivers/gpu/nvgpu/include/nvgpu/enabled.h b/drivers/gpu/nvgpu/include/nvgpu/enabled.h index 6413d5585..600a15882 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/enabled.h +++ b/drivers/gpu/nvgpu/include/nvgpu/enabled.h @@ -206,7 +206,8 @@ struct gk20a; DEFINE_FLAG(NVGPU_PMU_NEXT_CORE_ENABLED, "PMU NEXT CORE enabled"), \ DEFINE_FLAG(NVGPU_ACR_NEXT_CORE_ENABLED, \ "NEXT CORE availability for acr"), \ - DEFINE_FLAG(NVGPU_L2_MAX_WAYS_EVICT_LAST_ENABLED, \ + DEFINE_FLAG(NVGPU_ELPG_MS_ENABLED, "ELPG_MS support"), \ + DEFINE_FLAG(NVGPU_L2_MAX_WAYS_EVICT_LAST_ENABLED, \ "Set L2 Max Ways Evict Last support"), \ DEFINE_FLAG(NVGPU_MAX_ENABLED_BITS, "Marks max number of flags"), diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmu/pmuif/pg.h b/drivers/gpu/nvgpu/include/nvgpu/pmu/pmuif/pg.h index 1f0d06a52..ab40b47da 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/pmu/pmuif/pg.h +++ b/drivers/gpu/nvgpu/include/nvgpu/pmu/pmuif/pg.h @@ -32,7 +32,8 @@ /* Identifier for each PG */ #define PMU_PG_ELPG_ENGINE_ID_GRAPHICS (0x00000000U) #define PMU_PG_ELPG_ENGINE_ID_MS (0x00000004U) -#define PMU_PG_ELPG_ENGINE_ID_INVALID_ENGINE (0x00000005U) +#define PMU_PG_ELPG_ENGINE_ID_MS_LTC (0x00000006U) +#define PMU_PG_ELPG_ENGINE_ID_INVALID_ENGINE (0x00000007U) #define PMU_PG_ELPG_ENGINE_MAX PMU_PG_ELPG_ENGINE_ID_INVALID_ENGINE /* RPC function calls supported by PG unit */ diff --git a/drivers/gpu/nvgpu/os/linux/driver_common.c b/drivers/gpu/nvgpu/os/linux/driver_common.c index d95e13fd8..a41a200c2 100644 --- a/drivers/gpu/nvgpu/os/linux/driver_common.c +++ b/drivers/gpu/nvgpu/os/linux/driver_common.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -211,6 +211,12 @@ static void nvgpu_init_pm_vars(struct gk20a *g) } nvgpu_set_enabled(g, NVGPU_PMU_PERFMON, platform->enable_perfmon); + + /* ELPG feature enable is SW pre-requisite for ELPG_MS */ + if (g->elpg_enabled) { + nvgpu_set_enabled(g, NVGPU_ELPG_MS_ENABLED, + platform->enable_elpg_ms); + } } nvgpu_set_enabled(g, NVGPU_SUPPORT_ASPM, !platform->disable_aspm); diff --git a/drivers/gpu/nvgpu/os/linux/platform_gk20a.h b/drivers/gpu/nvgpu/os/linux/platform_gk20a.h index afee4f831..c1ba8c1d1 100644 --- a/drivers/gpu/nvgpu/os/linux/platform_gk20a.h +++ b/drivers/gpu/nvgpu/os/linux/platform_gk20a.h @@ -1,7 +1,7 @@ /* * GK20A Platform (SoC) Interface * - * Copyright (c) 2014-2020, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2021, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -136,6 +136,9 @@ struct gk20a_platform { /* Engine Level Power Gating: true = enable flase = disable */ bool enable_elpg; + /* Memory System power Gating: true = enable false = disable*/ + bool enable_elpg_ms; + /* Adaptative ELPG: true = enable flase = disable */ bool enable_aelpg; diff --git a/drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c index c1c1eb683..67b9804a8 100644 --- a/drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c +++ b/drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c @@ -977,6 +977,7 @@ struct gk20a_platform gm20b_tegra_platform = { .can_blcg = true, .can_elcg = true, .enable_elpg = true, + .enable_elpg_ms = false, .enable_aelpg = true, .enable_perfmon = true, .ptimer_src_freq = 19200000, diff --git a/drivers/gpu/nvgpu/os/linux/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/os/linux/platform_gp10b_tegra.c index 751a12b6e..c26a0591b 100644 --- a/drivers/gpu/nvgpu/os/linux/platform_gp10b_tegra.c +++ b/drivers/gpu/nvgpu/os/linux/platform_gp10b_tegra.c @@ -530,6 +530,7 @@ struct gk20a_platform gp10b_tegra_platform = { /* power management configuration */ .can_railgate_init = true, .enable_elpg = true, + .enable_elpg_ms = false, .can_elpg_init = true, .enable_blcg = true, .enable_slcg = true, diff --git a/drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c index 4d5658a7f..4e3fa7881 100644 --- a/drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c @@ -1,7 +1,7 @@ /* * GV11B Tegra Platform Interface * - * Copyright (c) 2016-2020, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -270,6 +270,7 @@ struct gk20a_platform gv11b_tegra_platform = { /* power management configuration */ .enable_elpg = true, + .enable_elpg_ms = false, .can_elpg_init = true, .enable_aelpg = true, diff --git a/drivers/gpu/nvgpu/os/linux/vgpu/gv11b/platform_gv11b_vgpu_tegra.c b/drivers/gpu/nvgpu/os/linux/vgpu/gv11b/platform_gv11b_vgpu_tegra.c index 29da5553b..ba0bdfec8 100644 --- a/drivers/gpu/nvgpu/os/linux/vgpu/gv11b/platform_gv11b_vgpu_tegra.c +++ b/drivers/gpu/nvgpu/os/linux/vgpu/gv11b/platform_gv11b_vgpu_tegra.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2021, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -89,6 +89,7 @@ struct gk20a_platform gv11b_vgpu_tegra_platform = { .enable_blcg = false, .enable_elcg = false, .enable_elpg = false, + .enable_elpg_ms = false, .enable_aelpg = false, .can_slcg = false, .can_blcg = false, diff --git a/drivers/gpu/nvgpu/os/linux/vgpu/platform_vgpu_tegra.c b/drivers/gpu/nvgpu/os/linux/vgpu/platform_vgpu_tegra.c index 1bcc6d79b..22485b12c 100644 --- a/drivers/gpu/nvgpu/os/linux/vgpu/platform_vgpu_tegra.c +++ b/drivers/gpu/nvgpu/os/linux/vgpu/platform_vgpu_tegra.c @@ -1,7 +1,7 @@ /* * Tegra Virtualized GPU Platform Interface * - * Copyright (c) 2014-2020, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2021, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -74,6 +74,7 @@ struct gk20a_platform vgpu_tegra_platform = { .enable_blcg = false, .enable_elcg = false, .enable_elpg = false, + .enable_elpg_ms = false, .enable_aelpg = false, .can_slcg = false, .can_blcg = false,