From b0092ea95c6e1f695912cdb0b13767f3881cb22f Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 27 Sep 2017 15:05:50 -0700 Subject: gpu: nvgpu: gv11b: Abstract IO aperture accessors Implement T19x specific usermode aperture initialization functions. Move usermode_regs field to nvgpu_os_linux_t19x, because it is Linux specific. JIRA NVGPU-259 Change-Id: I9d6ce243a692ab48209d468288ed85f89fb26770 Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1569699 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/io_t19x.h | 29 ++++++++++++++++++++++ drivers/gpu/nvgpu/include/nvgpu/linux/io_t19x.h | 26 +++++++++++++++++++ .../gpu/nvgpu/include/nvgpu/linux/module_t19x.h | 27 ++++++++++++++++++++ .../gpu/nvgpu/include/nvgpu/linux/os_linux_t19x.h | 26 +++++++++++++++++++ 4 files changed, 108 insertions(+) create mode 100644 drivers/gpu/nvgpu/include/nvgpu/io_t19x.h create mode 100644 drivers/gpu/nvgpu/include/nvgpu/linux/io_t19x.h create mode 100644 drivers/gpu/nvgpu/include/nvgpu/linux/module_t19x.h create mode 100644 drivers/gpu/nvgpu/include/nvgpu/linux/os_linux_t19x.h (limited to 'drivers/gpu/nvgpu/include') diff --git a/drivers/gpu/nvgpu/include/nvgpu/io_t19x.h b/drivers/gpu/nvgpu/include/nvgpu/io_t19x.h new file mode 100644 index 00000000..f8c7dbbd --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/io_t19x.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2017, 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"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +#ifndef __NVGPU_IO_T19X_H__ +#define __NVGPU_IO_T19X_H__ + +#ifdef __KERNEL__ +#include "linux/io_t19x.h" +#endif + +#endif diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/io_t19x.h b/drivers/gpu/nvgpu/include/nvgpu/linux/io_t19x.h new file mode 100644 index 00000000..f71a6ecf --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/linux/io_t19x.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2017, 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 __NVGPU_IO_T19X_LINUX_H__ +#define __NVGPU_IO_T19X_LINUX_H__ + +#include + +struct gk20a; + +void gv11b_usermode_writel(struct gk20a *g, u32 r, u32 v); + +#endif diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/module_t19x.h b/drivers/gpu/nvgpu/include/nvgpu/linux/module_t19x.h new file mode 100644 index 00000000..a105c6dc --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/linux/module_t19x.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2017, 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 __NVGPU_MODULE_T19X_H__ +#define __NVGPU_MODULE_T19X_H__ + +struct gk20a; + +void t19x_init_support(struct gk20a *g); +void t19x_remove_support(struct gk20a *g); +void t19x_lockout_registers(struct gk20a *g); +void t19x_restore_registers(struct gk20a *g); + +#endif diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/os_linux_t19x.h b/drivers/gpu/nvgpu/include/nvgpu/linux/os_linux_t19x.h new file mode 100644 index 00000000..a306bfb8 --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/linux/os_linux_t19x.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2017, 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 NVGPU_OS_LINUX_T19X_H +#define NVGPU_OS_LINUX_T19X_H + +#include + +struct nvgpu_os_linux_t19x { + void __iomem *usermode_regs; + void __iomem *usermode_regs_saved; +}; + +#endif -- cgit v1.2.2