mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 09:12:24 +03:00
gpu: nvgpu: Fix build without Tegra clk framework
Do not build clock code if TEGRA_CLK_FRAMEWORK is not defined. Also make GK20A_DEVFREQ depend on TEGRA_CLK_FRAMEWORK, and build scaling governor only if GK20A_DEVFREQ is enabled. Bug 1567274 Change-Id: I6ea1462e7a110fb46c9d66ceda71167cff19699e Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/562475
This commit is contained in:
committed by
Dan Willemsen
parent
fcf4a10799
commit
cc8e05c215
@@ -44,6 +44,7 @@ config GK20A_PERFMON
|
||||
decrease frequency if idle).
|
||||
|
||||
config GK20A_DEVFREQ
|
||||
depends on TEGRA_CLK_FRAMEWORK
|
||||
bool "Use Devfreq"
|
||||
help
|
||||
Select this to use devfreq based scaling.
|
||||
|
||||
@@ -25,12 +25,10 @@ nvgpu-y := \
|
||||
gk20a/priv_ring_gk20a.o \
|
||||
gk20a/semaphore_gk20a.o \
|
||||
gk20a/fence_gk20a.o \
|
||||
gk20a/clk_gk20a.o \
|
||||
gk20a/therm_gk20a.o \
|
||||
gk20a/gr_ctx_gk20a_sim.o \
|
||||
gk20a/gr_ctx_gk20a.o \
|
||||
gk20a/gk20a_gating_reglist.o \
|
||||
gk20a/gk20a_scale.o \
|
||||
gk20a/gk20a_sysfs.o \
|
||||
gk20a/ltc_gk20a.o \
|
||||
gk20a/fb_gk20a.o \
|
||||
@@ -50,7 +48,6 @@ nvgpu-y := \
|
||||
gm20b/gm20b_gating_reglist.o \
|
||||
gm20b/acr_gm20b.o \
|
||||
gm20b/pmu_gm20b.o \
|
||||
gm20b/clk_gm20b.o \
|
||||
gm20b/mm_gm20b.o \
|
||||
gm20b/regops_gm20b.o
|
||||
|
||||
@@ -64,3 +61,10 @@ nvgpu-$(CONFIG_TEGRA_GR_VIRTUALIZATION) += \
|
||||
vgpu/fifo_vgpu.o \
|
||||
vgpu/mm_vgpu.o \
|
||||
vgpu/vgpu.o
|
||||
|
||||
nvgpu-$(CONFIG_TEGRA_CLK_FRAMEWORK) += \
|
||||
gm20b/clk_gm20b.o \
|
||||
gk20a/clk_gk20a.o
|
||||
|
||||
nvgpu-$(CONFIG_GK20A_DEVFREQ) += \
|
||||
gk20a/gk20a_scale.o
|
||||
|
||||
@@ -77,6 +77,13 @@ struct clk_gk20a {
|
||||
bool debugfs_set;
|
||||
};
|
||||
|
||||
struct gpu_ops;
|
||||
#ifdef CONFIG_TEGRA_CLK_FRAMEWORK
|
||||
void gk20a_init_clk_ops(struct gpu_ops *gops);
|
||||
#else
|
||||
static inline void gk20a_init_clk_ops(struct gpu_ops *gops) {}
|
||||
#endif
|
||||
|
||||
/* APIs used for both GK20A and GM20B */
|
||||
unsigned long gk20a_clk_get_rate(struct gk20a *g);
|
||||
int gk20a_clk_set_rate(struct gk20a *g, unsigned long rate);
|
||||
|
||||
@@ -765,7 +765,8 @@ static int gk20a_pm_prepare_poweroff(struct device *dev)
|
||||
ret |= gk20a_fifo_suspend(g);
|
||||
|
||||
/* Disable GPCPLL */
|
||||
ret |= g->ops.clk.suspend_clk_support(g);
|
||||
if (g->ops.clk.suspend_clk_support)
|
||||
ret |= g->ops.clk.suspend_clk_support(g);
|
||||
|
||||
g->power_on = false;
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ struct gk20a_scale_profile {
|
||||
void gk20a_scale_init(struct platform_device *);
|
||||
void gk20a_scale_hw_init(struct platform_device *pdev);
|
||||
|
||||
#ifdef CONFIG_GK20A_DEVFREQ
|
||||
/*
|
||||
* call when performing submit to notify scaling mechanism that the module is
|
||||
* in use
|
||||
@@ -46,5 +47,11 @@ void gk20a_scale_notify_idle(struct platform_device *);
|
||||
|
||||
void gk20a_scale_suspend(struct platform_device *);
|
||||
void gk20a_scale_resume(struct platform_device *);
|
||||
#else
|
||||
static inline void gk20a_scale_notify_busy(struct platform_device *pdev) {}
|
||||
static inline void gk20a_scale_notify_idle(struct platform_device *pdev) {}
|
||||
static inline void gk20a_scale_suspend(struct platform_device *pdev) {}
|
||||
static inline void gk20a_scale_resume(struct platform_device *pdev) {}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -21,6 +21,10 @@
|
||||
|
||||
#include <linux/mutex.h>
|
||||
|
||||
#ifdef CONFIG_TEGRA_CLK_FRAMEWORK
|
||||
void gm20b_init_clk_ops(struct gpu_ops *gops);
|
||||
#else
|
||||
static inline void gm20b_init_clk_ops(struct gpu_ops *gops) {}
|
||||
#endif
|
||||
|
||||
#endif /* _NVHOST_CLK_GM20B_H_ */
|
||||
|
||||
Reference in New Issue
Block a user