From 7d6645d7affd3776a47a758433f7195bdd0b840e Mon Sep 17 00:00:00 2001 From: Bitan Biswas Date: Sun, 3 May 2020 04:50:43 -0700 Subject: [PATCH] gpu: nvgpu: fuse and chip revision updates for k5.4 1. use fuse.h instead of chip-id.h in k5.4. 2. chip revision checks for TEGRA210_REVISION_A04p and TEGRA194_REVISION_A01 are replaced with chip id check and revision check for TEGRA_REVISION_A04p and TEGRA_REVISION_A01. Bug 200591811 Bug 200602747 Change-Id: I3383b691e400265723214e81ac193fd1cc1946e3 Signed-off-by: Bitan Biswas Signed-off-by: Sagar Kamble Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2338262 Tested-by: mobile promotions Reviewed-by: automaticguardword Reviewed-by: mobile promotions --- drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c | 10 ++++++++++ drivers/gpu/nvgpu/os/linux/soc.c | 5 ++++- drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c | 5 +++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c index 57724611d..51a123dc0 100644 --- a/drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c +++ b/drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c @@ -43,7 +43,12 @@ #include #ifdef CONFIG_NVGPU_TEGRA_FUSE +#include +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) #include +#else +#include +#endif #endif #include @@ -857,7 +862,12 @@ static int gk20a_tegra_probe(struct device *dev) } platform->g->clk.gpc_pll.id = GM20B_GPC_PLL_B1; #ifdef CONFIG_NVGPU_TEGRA_FUSE +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) if (tegra_chip_get_revision() > TEGRA210_REVISION_A04p) +#else + if (tegra_get_chip_id() == TEGRA210 && + tegra_chip_get_revision() > TEGRA_REVISION_A04p) +#endif platform->g->clk.gpc_pll.id = GM20B_GPC_PLL_C1; #endif } diff --git a/drivers/gpu/nvgpu/os/linux/soc.c b/drivers/gpu/nvgpu/os/linux/soc.c index e5aa50244..fe76d3df6 100644 --- a/drivers/gpu/nvgpu/os/linux/soc.c +++ b/drivers/gpu/nvgpu/os/linux/soc.c @@ -11,7 +11,10 @@ * more details. */ +#include +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) #include +#endif #include #include #ifdef CONFIG_TEGRA_HV_MANAGER @@ -53,7 +56,7 @@ bool nvgpu_is_soc_t194_a01(struct gk20a *g) struct gk20a_platform *platform = gk20a_get_platform(dev); return ((platform->platform_chip_id == TEGRA_194 && - tegra_chip_get_revision() == TEGRA194_REVISION_A01) ? + tegra_chip_get_revision() == TEGRA_REVISION_A01) ? true : false); } diff --git a/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c b/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c index 298c7e34d..423e0e11e 100644 --- a/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c +++ b/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_linux.c @@ -23,7 +23,12 @@ #include #include #ifdef CONFIG_NVGPU_TEGRA_FUSE +#include +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) #include +#else +#include +#endif #endif #include