From a7288b58676f14a847592b6d6dcbe9080dfb9edb Mon Sep 17 00:00:00 2001 From: kalyani chidambaram Date: Fri, 27 Apr 2018 16:47:37 -0700 Subject: gpu: nvgpu: pmc access through pmc driver The pmc access has to be through pmc driver. This prevents the direct access to pmc registers and supports onlt tz access to it in t210 platforms. Bug 1811649 Change-Id: I235768a07fa93ce4cced656aade160bbd853be62 Signed-off-by: kalyani chidambaram Reviewed-on: https://git-master.nvidia.com/r/1704315 Reviewed-by: mobile promotions Tested-by: mobile promotions --- .../gpu/nvgpu/common/linux/platform_gk20a_tegra.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c') diff --git a/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c index 5301b13d..74309942 100644 --- a/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c +++ b/drivers/gpu/nvgpu/common/linux/platform_gk20a_tegra.c @@ -55,6 +55,7 @@ #include "os_linux.h" #include "../../../arch/arm/mach-tegra/iomap.h" +#include #define TEGRA_GK20A_BW_PER_FREQ 32 #define TEGRA_GM20B_BW_PER_FREQ 64 @@ -84,16 +85,6 @@ struct gk20a_emc_params { }; #endif -static void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE); -static inline u32 __maybe_unused pmc_read(unsigned long reg) -{ - return readl(pmc + reg); -} - -static inline void __maybe_unused pmc_write(u32 val, unsigned long reg) -{ - writel_relaxed(val, pmc + reg); -} #define MHZ_TO_HZ(x) ((x) * 1000000) #define HZ_TO_MHZ(x) ((x) / 1000000) @@ -326,8 +317,8 @@ static int gm20b_tegra_railgate(struct device *dev) udelay(10); /* enable clamp */ - pmc_write(0x1, PMC_GPU_RG_CNTRL_0); - pmc_read(PMC_GPU_RG_CNTRL_0); + tegra_pmc_writel_relaxed(0x1, PMC_GPU_RG_CNTRL_0); + tegra_pmc_readl(PMC_GPU_RG_CNTRL_0); udelay(10); @@ -435,8 +426,8 @@ static int gm20b_tegra_unrailgate(struct device *dev) udelay(10); - pmc_write(0, PMC_GPU_RG_CNTRL_0); - pmc_read(PMC_GPU_RG_CNTRL_0); + tegra_pmc_writel_relaxed(0, PMC_GPU_RG_CNTRL_0); + tegra_pmc_readl(PMC_GPU_RG_CNTRL_0); udelay(10); @@ -833,8 +824,6 @@ static int gk20a_tegra_probe(struct device *dev) return ret; } - pmc = ioremap(TEGRA_PMC_BASE, 4096); - return 0; } -- cgit v1.2.2