summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu
diff options
context:
space:
mode:
authorKenneth Adams <kadams@nvidia.com>2014-10-29 02:28:27 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:11:57 -0400
commitaec94d809348e8ff9a900c2a38456d7217c86728 (patch)
treef25fadc67e06b9690b2d39af3207fab420fa6650 /drivers/gpu/nvgpu
parent8371833f4273c2d4a6f923eb3270b4ab93967743 (diff)
gpu: nvgpu: T18x support
nvgpu framework and build for T18x Bug 1567274 Change-Id: I77835302a1110573008869d1106eface512bb9b1 Signed-off-by: Ken Adams <kadams@nvidia.com> Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r--drivers/gpu/nvgpu/Makefile12
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c17
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c3
-rw-r--r--drivers/gpu/nvgpu/gk20a/hal.c10
-rw-r--r--drivers/gpu/nvgpu/gk20a/platform_gk20a.h4
-rw-r--r--drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c6
6 files changed, 47 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile
index 391ccec7..f189cdc9 100644
--- a/drivers/gpu/nvgpu/Makefile
+++ b/drivers/gpu/nvgpu/Makefile
@@ -6,6 +6,12 @@ ccflags-y += -Idrivers/devfreq
6ccflags-y += -Wno-multichar 6ccflags-y += -Wno-multichar
7ccflags-y += -Werror 7ccflags-y += -Werror
8 8
9ifeq ($(CONFIG_ARCH_TEGRA_18x_SOC),y)
10ccflags-$(CONFIG_GK20A) += -I$(srctree)/../kernel-t18x/drivers/gpu/nvgpu
11ccflags-$(CONFIG_GK20A) += -I$(srctree)/../kernel-t18x/include
12ccflags-$(CONFIG_GK20A) += -I$(srctree)/../kernel-t18x/include/uapi
13endif
14
9obj-$(CONFIG_GK20A) := nvgpu.o 15obj-$(CONFIG_GK20A) := nvgpu.o
10 16
11nvgpu-y := \ 17nvgpu-y := \
@@ -70,3 +76,9 @@ nvgpu-$(CONFIG_TEGRA_CLK_FRAMEWORK) += \
70 76
71nvgpu-$(CONFIG_GK20A_DEVFREQ) += \ 77nvgpu-$(CONFIG_GK20A_DEVFREQ) += \
72 gk20a/gk20a_scale.o 78 gk20a/gk20a_scale.o
79
80ifeq ($(CONFIG_ARCH_TEGRA_18x_SOC),y)
81ccflags-$(CONFIG_GK20A) += -I$(srctree)/../kernel-t18x/drivers/gpu/nvgpu
82ccflags-$(CONFIG_GK20A) += -I$(srctree)/../kernel-t18x/include
83obj-$(CONFIG_GK20A) += ../../../../kernel-t18x/drivers/gpu/nvgpu/
84endif
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index 2e1bd003..3df13309 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.c
@@ -64,6 +64,10 @@
64#define CREATE_TRACE_POINTS 64#define CREATE_TRACE_POINTS
65#include <trace/events/gk20a.h> 65#include <trace/events/gk20a.h>
66 66
67#ifdef CONFIG_ARCH_TEGRA_18x_SOC
68#include "nvgpu_gpuid_t18x.h"
69#endif
70
67#ifdef CONFIG_ARM64 71#ifdef CONFIG_ARM64
68#define __cpuc_flush_dcache_area __flush_dcache_area 72#define __cpuc_flush_dcache_area __flush_dcache_area
69#endif 73#endif
@@ -878,6 +882,10 @@ static struct of_device_id tegra_gk20a_of_match[] = {
878 .data = &gk20a_tegra_platform }, 882 .data = &gk20a_tegra_platform },
879 { .compatible = "nvidia,tegra210-gm20b", 883 { .compatible = "nvidia,tegra210-gm20b",
880 .data = &gm20b_tegra_platform }, 884 .data = &gm20b_tegra_platform },
885#ifdef CONFIG_ARCH_TEGRA_18x_SOC
886 { .compatible = TEGRA_18x_GPU_COMPAT_TEGRA,
887 .data = &gk20a_tegra_platform },
888#endif
881#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION 889#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION
882 { .compatible = "nvidia,tegra124-gk20a-vgpu", 890 { .compatible = "nvidia,tegra124-gk20a-vgpu",
883 .data = &vgpu_tegra_platform }, 891 .data = &vgpu_tegra_platform },
@@ -887,11 +895,20 @@ static struct of_device_id tegra_gk20a_of_match[] = {
887 .data = &gk20a_generic_platform }, 895 .data = &gk20a_generic_platform },
888 { .compatible = "nvidia,tegra210-gm20b", 896 { .compatible = "nvidia,tegra210-gm20b",
889 .data = &gk20a_generic_platform }, 897 .data = &gk20a_generic_platform },
898#ifdef CONFIG_ARCH_TEGRA_18x_SOC
899 { .compatible = TEGRA_18x_GPU_COMPAT_TEGRA,
900 .data = &gk20a_generic_platform },
901#endif
902
890#endif 903#endif
891 { .compatible = "nvidia,generic-gk20a", 904 { .compatible = "nvidia,generic-gk20a",
892 .data = &gk20a_generic_platform }, 905 .data = &gk20a_generic_platform },
893 { .compatible = "nvidia,generic-gm20b", 906 { .compatible = "nvidia,generic-gm20b",
894 .data = &gk20a_generic_platform }, 907 .data = &gk20a_generic_platform },
908#ifdef CONFIG_ARCH_TEGRA_18x_SOC
909 { .compatible = TEGRA_18x_GPU_COMPAT_GENERIC,
910 .data = &gk20a_generic_platform },
911#endif
895 { }, 912 { },
896}; 913};
897 914
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index b07d0803..4b0d7591 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -2150,8 +2150,7 @@ int gr_gk20a_load_ctxsw_ucode(struct gk20a *g)
2150 * In case bootloader is not supported, revert to the old way of 2150 * In case bootloader is not supported, revert to the old way of
2151 * loading gr ucode, without the faster bootstrap routine. 2151 * loading gr ucode, without the faster bootstrap routine.
2152 */ 2152 */
2153 if (g->gpu_characteristics.arch != NVGPU_GPU_ARCH_GK100 && 2153 if (g->gpu_characteristics.arch > NVGPU_GPU_ARCH_GM200) {
2154 g->gpu_characteristics.arch != NVGPU_GPU_ARCH_GM200) {
2155 gr_gk20a_load_falcon_dmem(g); 2154 gr_gk20a_load_falcon_dmem(g);
2156 gr_gk20a_load_falcon_imem(g); 2155 gr_gk20a_load_falcon_imem(g);
2157 gr_gk20a_start_falcon_ucode(g); 2156 gr_gk20a_start_falcon_ucode(g);
diff --git a/drivers/gpu/nvgpu/gk20a/hal.c b/drivers/gpu/nvgpu/gk20a/hal.c
index 8d1a29dd..56553819 100644
--- a/drivers/gpu/nvgpu/gk20a/hal.c
+++ b/drivers/gpu/nvgpu/gk20a/hal.c
@@ -17,6 +17,10 @@
17#include "hal_gk20a.h" 17#include "hal_gk20a.h"
18#include "gm20b/hal_gm20b.h" 18#include "gm20b/hal_gm20b.h"
19 19
20#ifdef CONFIG_ARCH_TEGRA_18x_SOC
21#include "nvgpu_gpuid_t18x.h"
22#endif
23
20int gpu_init_hal(struct gk20a *g) 24int gpu_init_hal(struct gk20a *g)
21{ 25{
22 u32 ver = g->gpu_characteristics.arch + g->gpu_characteristics.impl; 26 u32 ver = g->gpu_characteristics.arch + g->gpu_characteristics.impl;
@@ -30,6 +34,12 @@ int gpu_init_hal(struct gk20a *g)
30 if (gm20b_init_hal(&g->ops)) 34 if (gm20b_init_hal(&g->ops))
31 return -ENODEV; 35 return -ENODEV;
32 break; 36 break;
37#if defined(CONFIG_ARCH_TEGRA_18x_SOC)
38 case TEGRA_18x_GPUID:
39 if (TEGRA_18x_GPUID_HAL(&g->ops))
40 return -ENODEV;
41 break;
42#endif
33 default: 43 default:
34 gk20a_err(&g->dev->dev, "no support for %x", ver); 44 gk20a_err(&g->dev->dev, "no support for %x", ver);
35 return -ENODEV; 45 return -ENODEV;
diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h
index d5a1cc91..0cc04595 100644
--- a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h
@@ -185,4 +185,8 @@ static inline bool gk20a_platform_has_syncpoints(struct platform_device *dev)
185 return p->has_syncpoints; 185 return p->has_syncpoints;
186} 186}
187 187
188int gk20a_tegra_busy(struct platform_device *dev);
189void gk20a_tegra_idle(struct platform_device *dev);
190void gk20a_tegra_debug_dump(struct platform_device *pdev);
191
188#endif 192#endif
diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c
index d7500929..a4b7fe18 100644
--- a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c
+++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c
@@ -339,14 +339,14 @@ static void gk20a_tegra_scale_init(struct platform_device *pdev)
339 profile->private_data = emc_params; 339 profile->private_data = emc_params;
340} 340}
341 341
342static void gk20a_tegra_debug_dump(struct platform_device *pdev) 342void gk20a_tegra_debug_dump(struct platform_device *pdev)
343{ 343{
344 struct gk20a_platform *platform = gk20a_get_platform(pdev); 344 struct gk20a_platform *platform = gk20a_get_platform(pdev);
345 struct gk20a *g = platform->g; 345 struct gk20a *g = platform->g;
346 nvhost_debug_dump_device(g->host1x_dev); 346 nvhost_debug_dump_device(g->host1x_dev);
347} 347}
348 348
349static int gk20a_tegra_busy(struct platform_device *dev) 349int gk20a_tegra_busy(struct platform_device *dev)
350{ 350{
351 struct gk20a_platform *platform = gk20a_get_platform(dev); 351 struct gk20a_platform *platform = gk20a_get_platform(dev);
352 struct gk20a *g = platform->g; 352 struct gk20a *g = platform->g;
@@ -356,7 +356,7 @@ static int gk20a_tegra_busy(struct platform_device *dev)
356 return 0; 356 return 0;
357} 357}
358 358
359static void gk20a_tegra_idle(struct platform_device *dev) 359void gk20a_tegra_idle(struct platform_device *dev)
360{ 360{
361 struct gk20a_platform *platform = gk20a_get_platform(dev); 361 struct gk20a_platform *platform = gk20a_get_platform(dev);
362 struct gk20a *g = platform->g; 362 struct gk20a *g = platform->g;