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>
This commit is contained in:
Kenneth Adams
2014-10-29 08:28:27 +02:00
committed by Dan Willemsen
parent 8371833f42
commit aec94d8093
7 changed files with 51 additions and 5 deletions

View File

@@ -6,6 +6,12 @@ ccflags-y += -Idrivers/devfreq
ccflags-y += -Wno-multichar
ccflags-y += -Werror
ifeq ($(CONFIG_ARCH_TEGRA_18x_SOC),y)
ccflags-$(CONFIG_GK20A) += -I$(srctree)/../kernel-t18x/drivers/gpu/nvgpu
ccflags-$(CONFIG_GK20A) += -I$(srctree)/../kernel-t18x/include
ccflags-$(CONFIG_GK20A) += -I$(srctree)/../kernel-t18x/include/uapi
endif
obj-$(CONFIG_GK20A) := nvgpu.o
nvgpu-y := \
@@ -70,3 +76,9 @@ nvgpu-$(CONFIG_TEGRA_CLK_FRAMEWORK) += \
nvgpu-$(CONFIG_GK20A_DEVFREQ) += \
gk20a/gk20a_scale.o
ifeq ($(CONFIG_ARCH_TEGRA_18x_SOC),y)
ccflags-$(CONFIG_GK20A) += -I$(srctree)/../kernel-t18x/drivers/gpu/nvgpu
ccflags-$(CONFIG_GK20A) += -I$(srctree)/../kernel-t18x/include
obj-$(CONFIG_GK20A) += ../../../../kernel-t18x/drivers/gpu/nvgpu/
endif

View File

@@ -64,6 +64,10 @@
#define CREATE_TRACE_POINTS
#include <trace/events/gk20a.h>
#ifdef CONFIG_ARCH_TEGRA_18x_SOC
#include "nvgpu_gpuid_t18x.h"
#endif
#ifdef CONFIG_ARM64
#define __cpuc_flush_dcache_area __flush_dcache_area
#endif
@@ -878,6 +882,10 @@ static struct of_device_id tegra_gk20a_of_match[] = {
.data = &gk20a_tegra_platform },
{ .compatible = "nvidia,tegra210-gm20b",
.data = &gm20b_tegra_platform },
#ifdef CONFIG_ARCH_TEGRA_18x_SOC
{ .compatible = TEGRA_18x_GPU_COMPAT_TEGRA,
.data = &gk20a_tegra_platform },
#endif
#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION
{ .compatible = "nvidia,tegra124-gk20a-vgpu",
.data = &vgpu_tegra_platform },
@@ -887,11 +895,20 @@ static struct of_device_id tegra_gk20a_of_match[] = {
.data = &gk20a_generic_platform },
{ .compatible = "nvidia,tegra210-gm20b",
.data = &gk20a_generic_platform },
#ifdef CONFIG_ARCH_TEGRA_18x_SOC
{ .compatible = TEGRA_18x_GPU_COMPAT_TEGRA,
.data = &gk20a_generic_platform },
#endif
#endif
{ .compatible = "nvidia,generic-gk20a",
.data = &gk20a_generic_platform },
{ .compatible = "nvidia,generic-gm20b",
.data = &gk20a_generic_platform },
#ifdef CONFIG_ARCH_TEGRA_18x_SOC
{ .compatible = TEGRA_18x_GPU_COMPAT_GENERIC,
.data = &gk20a_generic_platform },
#endif
{ },
};

View File

@@ -2150,8 +2150,7 @@ int gr_gk20a_load_ctxsw_ucode(struct gk20a *g)
* In case bootloader is not supported, revert to the old way of
* loading gr ucode, without the faster bootstrap routine.
*/
if (g->gpu_characteristics.arch != NVGPU_GPU_ARCH_GK100 &&
g->gpu_characteristics.arch != NVGPU_GPU_ARCH_GM200) {
if (g->gpu_characteristics.arch > NVGPU_GPU_ARCH_GM200) {
gr_gk20a_load_falcon_dmem(g);
gr_gk20a_load_falcon_imem(g);
gr_gk20a_start_falcon_ucode(g);

View File

@@ -17,6 +17,10 @@
#include "hal_gk20a.h"
#include "gm20b/hal_gm20b.h"
#ifdef CONFIG_ARCH_TEGRA_18x_SOC
#include "nvgpu_gpuid_t18x.h"
#endif
int gpu_init_hal(struct gk20a *g)
{
u32 ver = g->gpu_characteristics.arch + g->gpu_characteristics.impl;
@@ -30,6 +34,12 @@ int gpu_init_hal(struct gk20a *g)
if (gm20b_init_hal(&g->ops))
return -ENODEV;
break;
#if defined(CONFIG_ARCH_TEGRA_18x_SOC)
case TEGRA_18x_GPUID:
if (TEGRA_18x_GPUID_HAL(&g->ops))
return -ENODEV;
break;
#endif
default:
gk20a_err(&g->dev->dev, "no support for %x", ver);
return -ENODEV;

View File

@@ -185,4 +185,8 @@ static inline bool gk20a_platform_has_syncpoints(struct platform_device *dev)
return p->has_syncpoints;
}
int gk20a_tegra_busy(struct platform_device *dev);
void gk20a_tegra_idle(struct platform_device *dev);
void gk20a_tegra_debug_dump(struct platform_device *pdev);
#endif

View File

@@ -339,14 +339,14 @@ static void gk20a_tegra_scale_init(struct platform_device *pdev)
profile->private_data = emc_params;
}
static void gk20a_tegra_debug_dump(struct platform_device *pdev)
void gk20a_tegra_debug_dump(struct platform_device *pdev)
{
struct gk20a_platform *platform = gk20a_get_platform(pdev);
struct gk20a *g = platform->g;
nvhost_debug_dump_device(g->host1x_dev);
}
static int gk20a_tegra_busy(struct platform_device *dev)
int gk20a_tegra_busy(struct platform_device *dev)
{
struct gk20a_platform *platform = gk20a_get_platform(dev);
struct gk20a *g = platform->g;
@@ -356,7 +356,7 @@ static int gk20a_tegra_busy(struct platform_device *dev)
return 0;
}
static void gk20a_tegra_idle(struct platform_device *dev)
void gk20a_tegra_idle(struct platform_device *dev)
{
struct gk20a_platform *platform = gk20a_get_platform(dev);
struct gk20a *g = platform->g;

View File

@@ -88,6 +88,10 @@ struct nvgpu_gpu_zbc_query_table_args {
#define NVGPU_GPU_ARCH_GM200 0x00000120
#define NVGPU_GPU_IMPL_GM20B 0x0000000B
#ifdef CONFIG_ARCH_TEGRA_18x_SOC
#include <linux/nvgpu-t18x.h>
#endif
#define NVGPU_GPU_BUS_TYPE_NONE 0
#define NVGPU_GPU_BUS_TYPE_AXI 32