diff --git a/arch/nvgpu-linux.yaml b/arch/nvgpu-linux.yaml index 654a92064..143175232 100644 --- a/arch/nvgpu-linux.yaml +++ b/arch/nvgpu-linux.yaml @@ -211,6 +211,7 @@ timers: vgpu: sources: [ os/linux/vgpu/fecs_trace_vgpu_linux.c, os/linux/vgpu/gv11b/platform_gv11b_vgpu_tegra.c, + os/linux/vgpu/gv11b/platform_gv11b_vgpu_tegra.h, os/linux/vgpu/platform_vgpu_tegra.c, os/linux/vgpu/platform_vgpu_tegra.h, os/linux/vgpu/sysfs_vgpu.c, diff --git a/arch/nvgpu.yaml b/arch/nvgpu.yaml index 0a76b3460..2dca53bac 100644 --- a/arch/nvgpu.yaml +++ b/arch/nvgpu.yaml @@ -58,7 +58,7 @@ nvgpu: hal-vgpu: safe: yes children: - !include nvgpu-hal-vgpu.yaml + !include nvgpu-hal-vgpu.yaml nvgpu-next-hal-vgpu.yaml # A meta-element for the GPU HW. A good example of this is the HW headers. # This is not code we write in nvgpu, but we import it from the GPU HW diff --git a/drivers/gpu/nvgpu/hal/vgpu/init/init_hal_vgpu.c b/drivers/gpu/nvgpu/hal/vgpu/init/init_hal_vgpu.c index 0710eabe4..de7125ea0 100644 --- a/drivers/gpu/nvgpu/hal/vgpu/init/init_hal_vgpu.c +++ b/drivers/gpu/nvgpu/hal/vgpu/init/init_hal_vgpu.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,6 +26,10 @@ #include #include +#if defined(CONFIG_NVGPU_HAL_NON_FUSA) && defined(CONFIG_NVGPU_NEXT) +#include "nvgpu_next_gpuid.h" +#endif + #include "init_hal_vgpu.h" #include "vgpu_hal_gp10b.h" #include "vgpu_hal_gv11b.h" @@ -44,6 +48,11 @@ int vgpu_init_hal(struct gk20a *g) case NVGPU_GPUID_GV11B: err = vgpu_gv11b_init_hal(g); break; +#ifdef CONFIG_NVGPU_NEXT + case NVGPU_NEXT_GPUID: + err = NVGPU_NEXT_VGPU_INIT_HAL(g); + break; +#endif #endif default: nvgpu_err(g, "no support for %x", ver); diff --git a/drivers/gpu/nvgpu/os/linux/module.c b/drivers/gpu/nvgpu/os/linux/module.c index 59c77287a..ab3e82dcb 100644 --- a/drivers/gpu/nvgpu/os/linux/module.c +++ b/drivers/gpu/nvgpu/os/linux/module.c @@ -731,6 +731,10 @@ static struct of_device_id tegra_gk20a_of_match[] = { #if defined(CONFIG_NVGPU_NEXT) && defined(CONFIG_NVGPU_NON_FUSA) { .compatible = NVGPU_NEXT_COMPATIBLE, .data = &NVGPU_NEXT_PLATFORM}, +#ifdef CONFIG_NVGPU_GR_VIRTUALIZATION + { .compatible = NVGPU_NEXT_COMPATIBLE_VGPU, + .data = &NVGPU_NEXT_PLATFORM_VGPU}, +#endif #endif #endif { }, diff --git a/drivers/gpu/nvgpu/os/linux/vgpu/gv11b/platform_gv11b_vgpu_tegra.c b/drivers/gpu/nvgpu/os/linux/vgpu/gv11b/platform_gv11b_vgpu_tegra.c index ae230f58e..ce1fc7388 100644 --- a/drivers/gpu/nvgpu/os/linux/vgpu/gv11b/platform_gv11b_vgpu_tegra.c +++ b/drivers/gpu/nvgpu/os/linux/vgpu/gv11b/platform_gv11b_vgpu_tegra.c @@ -27,7 +27,7 @@ #include "os/linux/vgpu/vgpu_linux.h" #include "os/linux/vgpu/platform_vgpu_tegra.h" -static int gv11b_vgpu_probe(struct device *dev) +int gv11b_vgpu_probe(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct gk20a_platform *platform = dev_get_drvdata(dev); diff --git a/drivers/gpu/nvgpu/os/linux/vgpu/gv11b/platform_gv11b_vgpu_tegra.h b/drivers/gpu/nvgpu/os/linux/vgpu/gv11b/platform_gv11b_vgpu_tegra.h new file mode 100644 index 000000000..36415308e --- /dev/null +++ b/drivers/gpu/nvgpu/os/linux/vgpu/gv11b/platform_gv11b_vgpu_tegra.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef PLATFORM_GV11B_VGPU_LINUX_H +#define PLATFORM_GV11B_VGPU_LINUX_H + +struct device; + +int gv11b_vgpu_probe(struct device *dev); + +#endif