gpu: nvgpu: enable devfreq after finalize poweron

Enabling gpu scaling driver after finalize poweron,
will make gpu booting happen at initially set
frequency(1GHz).

Also doing platform specific init scale after enabling
scaling driver.

Bug 2049965
Bug 2039013
Bug 200377508

Change-Id: I633f8f5a25d9de18cbb3a022913b8b725ccd87e5
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1644703
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
seshendra Gadagottu
2018-01-23 13:12:04 -08:00
committed by mobile promotions
parent 791ce6bd54
commit 9afb084055
5 changed files with 20 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. * Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License, * under the terms and conditions of the GNU General Public License,
@@ -27,7 +27,6 @@
#include <nvgpu/debug.h> #include <nvgpu/debug.h>
#include <nvgpu/sizes.h> #include <nvgpu/sizes.h>
#include "scale.h"
#include "gk20a/gk20a.h" #include "gk20a/gk20a.h"
#include "platform_gk20a.h" #include "platform_gk20a.h"
#include "module.h" #include "module.h"
@@ -226,11 +225,6 @@ int nvgpu_probe(struct gk20a *g,
if (err) if (err)
return err; return err;
/* Initialise scaling */
if (IS_ENABLED(CONFIG_GK20A_DEVFREQ))
gk20a_scale_init(dev);
if (platform->late_probe) { if (platform->late_probe) {
err = platform->late_probe(dev); err = platform->late_probe(dev);
if (err) { if (err) {

View File

@@ -264,6 +264,13 @@ int gk20a_pm_finalize_poweron(struct device *dev)
if (err) if (err)
goto done; goto done;
/* Initialise scaling: it will initialize scaling drive only once */
if (IS_ENABLED(CONFIG_GK20A_DEVFREQ)) {
gk20a_scale_init(dev);
if (platform->initscale)
platform->initscale(dev);
}
trace_gk20a_finalize_poweron_done(dev_name(dev)); trace_gk20a_finalize_poweron_done(dev_name(dev));
err = nvgpu_init_os_linux_ops(l); err = nvgpu_init_os_linux_ops(l);

View File

@@ -177,6 +177,9 @@ struct gk20a_platform {
/* Called to register GPCPLL with common clk framework */ /* Called to register GPCPLL with common clk framework */
int (*clk_register)(struct gk20a *g); int (*clk_register)(struct gk20a *g);
/* platform specific scale init quirks */
void (*initscale)(struct device *dev);
/* Postscale callback is called after frequency change */ /* Postscale callback is called after frequency change */
void (*postscale)(struct device *dev, void (*postscale)(struct device *dev,
unsigned long freq); unsigned long freq);

View File

@@ -1,7 +1,7 @@
/* /*
* GK20A Tegra Platform Interface * GK20A Tegra Platform Interface
* *
* Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. * Copyright (c) 2014-2018, NVIDIA CORPORATION. All rights reserved.
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License, * under the terms and conditions of the GNU General Public License,
@@ -592,6 +592,9 @@ static void gk20a_tegra_scale_init(struct device *dev)
if (!profile) if (!profile)
return; return;
if (profile->private_data)
return;
emc_params = nvgpu_kzalloc(platform->g, sizeof(*emc_params)); emc_params = nvgpu_kzalloc(platform->g, sizeof(*emc_params));
if (!emc_params) if (!emc_params)
return; return;
@@ -850,9 +853,6 @@ static int gk20a_tegra_late_probe(struct device *dev)
/* Cause early VPR resize */ /* Cause early VPR resize */
gk20a_tegra_secure_page_alloc(dev); gk20a_tegra_secure_page_alloc(dev);
/* Initialise tegra specific scaling quirks */
gk20a_tegra_scale_init(dev);
return 0; return 0;
} }
@@ -958,6 +958,7 @@ struct gk20a_platform gm20b_tegra_platform = {
#endif #endif
/* frequency scaling configuration */ /* frequency scaling configuration */
.initscale = gk20a_tegra_scale_init,
.prescale = gk20a_tegra_prescale, .prescale = gk20a_tegra_prescale,
#ifdef CONFIG_TEGRA_BWMGR #ifdef CONFIG_TEGRA_BWMGR
.postscale = gm20b_tegra_postscale, .postscale = gm20b_tegra_postscale,

View File

@@ -106,6 +106,9 @@ static void gp10b_tegra_scale_init(struct device *dev)
if (!profile) if (!profile)
return; return;
if ((struct tegra_bwmgr_client *)profile->private_data)
return;
bwmgr_handle = tegra_bwmgr_register(TEGRA_BWMGR_CLIENT_GPU); bwmgr_handle = tegra_bwmgr_register(TEGRA_BWMGR_CLIENT_GPU);
if (!bwmgr_handle) if (!bwmgr_handle)
return; return;
@@ -157,8 +160,6 @@ static int gp10b_tegra_late_probe(struct device *dev)
/* Cause early VPR resize */ /* Cause early VPR resize */
gk20a_tegra_secure_page_alloc(dev); gk20a_tegra_secure_page_alloc(dev);
/* Initialise tegra specific scaling quirks */
gp10b_tegra_scale_init(dev);
return 0; return 0;
} }
@@ -405,6 +406,7 @@ struct gk20a_platform gp10b_tegra_platform = {
.get_clk_freqs = gp10b_clk_get_freqs, .get_clk_freqs = gp10b_clk_get_freqs,
/* frequency scaling configuration */ /* frequency scaling configuration */
.initscale = gp10b_tegra_scale_init,
.prescale = gp10b_tegra_prescale, .prescale = gp10b_tegra_prescale,
.postscale = gp10b_tegra_postscale, .postscale = gp10b_tegra_postscale,
.devfreq_governor = "nvhost_podgov", .devfreq_governor = "nvhost_podgov",