From f3f14cdff53f4b936e2505d44aad6e3bca143056 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 17 Jan 2018 12:39:13 -0800 Subject: gpu: nvgpu: Fold T19x code back to main code paths Lots of code paths were split to T19x specific code paths and structs due to split repository. Now that repositories are merged, fold all of them back to main code paths and structs and remove the T19x specific Kconfig flag. Change-Id: Id0d17a5f0610fc0b49f51ab6664e716dc8b222b6 Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1640606 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/enabled.h | 4 ++- drivers/gpu/nvgpu/include/nvgpu/enabled_t19x.h | 29 ----------------- drivers/gpu/nvgpu/include/nvgpu/gmmu.h | 10 ++---- drivers/gpu/nvgpu/include/nvgpu/gmmu_t19x.h | 34 -------------------- drivers/gpu/nvgpu/include/nvgpu/io.h | 5 +-- drivers/gpu/nvgpu/include/nvgpu/io_t19x.h | 29 ----------------- drivers/gpu/nvgpu/include/nvgpu/io_usermode.h | 27 ++++++++++++++++ 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 --------------- drivers/gpu/nvgpu/include/nvgpu/linux/pci_t19x.h | 23 -------------- drivers/gpu/nvgpu/include/nvgpu/mm.h | 5 +-- drivers/gpu/nvgpu/include/nvgpu/nvhost.h | 16 +++++++++- drivers/gpu/nvgpu/include/nvgpu/nvhost_t19x.h | 37 ---------------------- 14 files changed, 51 insertions(+), 247 deletions(-) delete mode 100644 drivers/gpu/nvgpu/include/nvgpu/enabled_t19x.h delete mode 100644 drivers/gpu/nvgpu/include/nvgpu/gmmu_t19x.h delete mode 100644 drivers/gpu/nvgpu/include/nvgpu/io_t19x.h create mode 100644 drivers/gpu/nvgpu/include/nvgpu/io_usermode.h delete mode 100644 drivers/gpu/nvgpu/include/nvgpu/linux/io_t19x.h delete mode 100644 drivers/gpu/nvgpu/include/nvgpu/linux/module_t19x.h delete mode 100644 drivers/gpu/nvgpu/include/nvgpu/linux/os_linux_t19x.h delete mode 100644 drivers/gpu/nvgpu/include/nvgpu/linux/pci_t19x.h delete mode 100644 drivers/gpu/nvgpu/include/nvgpu/nvhost_t19x.h (limited to 'drivers/gpu/nvgpu/include') diff --git a/drivers/gpu/nvgpu/include/nvgpu/enabled.h b/drivers/gpu/nvgpu/include/nvgpu/enabled.h index 001cafb0..c614ce4d 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/enabled.h +++ b/drivers/gpu/nvgpu/include/nvgpu/enabled.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2018, 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"), @@ -142,6 +142,8 @@ struct gk20a; /* set if ASPM is enabled; only makes sense for PCI */ #define NVGPU_SUPPORT_ASPM 62 +/* subcontexts are available */ +#define NVGPU_SUPPORT_TSG_SUBCONTEXTS 63 /* * Must be greater than the largest bit offset in the above list. */ diff --git a/drivers/gpu/nvgpu/include/nvgpu/enabled_t19x.h b/drivers/gpu/nvgpu/include/nvgpu/enabled_t19x.h deleted file mode 100644 index 9ef1dc30..00000000 --- a/drivers/gpu/nvgpu/include/nvgpu/enabled_t19x.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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_ENABLED_T19X_H__ -#define __NVGPU_ENABLED_T19X_H__ - -/* subcontexts are available */ -#define NVGPU_SUPPORT_TSG_SUBCONTEXTS 63 - -#endif diff --git a/drivers/gpu/nvgpu/include/nvgpu/gmmu.h b/drivers/gpu/nvgpu/include/nvgpu/gmmu.h index ade94df9..02b211d6 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gmmu.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gmmu.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2018, 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"), @@ -29,10 +29,6 @@ #include #include -#ifdef CONFIG_TEGRA_19x_GPU -#include -#endif - /* * This is the GMMU API visible to blocks outside of the GMMU. Basically this * API supports all the different types of mappings that might be done in the @@ -180,9 +176,7 @@ struct nvgpu_gmmu_attrs { enum nvgpu_aperture aperture; bool debug; -#ifdef CONFIG_TEGRA_19x_GPU - struct nvgpu_gmmu_attrs_t19x t19x_attrs; -#endif + bool l3_alloc; }; struct gk20a_mmu_level { diff --git a/drivers/gpu/nvgpu/include/nvgpu/gmmu_t19x.h b/drivers/gpu/nvgpu/include/nvgpu/gmmu_t19x.h deleted file mode 100644 index eea51fbb..00000000 --- a/drivers/gpu/nvgpu/include/nvgpu/gmmu_t19x.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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_GMMU_T19X_H__ -#define __NVGPU_GMMU_T19X_H__ - -struct nvgpu_gmmu_attrs; - -struct nvgpu_gmmu_attrs_t19x { - bool l3_alloc; -}; - -void nvgpu_gmmu_add_t19x_attrs(struct nvgpu_gmmu_attrs *attrs, u32 flags); - -#endif diff --git a/drivers/gpu/nvgpu/include/nvgpu/io.h b/drivers/gpu/nvgpu/include/nvgpu/io.h index b7281b41..28011e04 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/io.h +++ b/drivers/gpu/nvgpu/include/nvgpu/io.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2018, 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"), @@ -23,9 +23,6 @@ #define __NVGPU_IO_H__ #include -#ifdef CONFIG_TEGRA_19x_GPU -#include -#endif /* Legacy defines - should be removed once everybody uses nvgpu_* */ #define gk20a_writel nvgpu_writel diff --git a/drivers/gpu/nvgpu/include/nvgpu/io_t19x.h b/drivers/gpu/nvgpu/include/nvgpu/io_t19x.h deleted file mode 100644 index f8c7dbbd..00000000 --- a/drivers/gpu/nvgpu/include/nvgpu/io_t19x.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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/io_usermode.h b/drivers/gpu/nvgpu/include/nvgpu/io_usermode.h new file mode 100644 index 00000000..a756ef44 --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/io_usermode.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2017-2018, 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_USERMODE_H__ +#define __NVGPU_IO_USERMODE_H__ + +void nvgpu_usermode_writel(struct gk20a *g, u32 r, u32 v); + +#endif diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/io_t19x.h b/drivers/gpu/nvgpu/include/nvgpu/linux/io_t19x.h deleted file mode 100644 index f71a6ecf..00000000 --- a/drivers/gpu/nvgpu/include/nvgpu/linux/io_t19x.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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 deleted file mode 100644 index a105c6dc..00000000 --- a/drivers/gpu/nvgpu/include/nvgpu/linux/module_t19x.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 deleted file mode 100644 index a306bfb8..00000000 --- a/drivers/gpu/nvgpu/include/nvgpu/linux/os_linux_t19x.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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 diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/pci_t19x.h b/drivers/gpu/nvgpu/include/nvgpu/linux/pci_t19x.h deleted file mode 100644 index c94176cc..00000000 --- a/drivers/gpu/nvgpu/include/nvgpu/linux/pci_t19x.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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_PCI_T19X_H__ -#define __NVGPU_PCI_T19X_H__ - -struct nvgpu_os_linux; - -void t19x_nvgpu_pci_init_support(struct nvgpu_os_linux *l); - -#endif diff --git a/drivers/gpu/nvgpu/include/nvgpu/mm.h b/drivers/gpu/nvgpu/include/nvgpu/mm.h index f2d3ba26..e7b3e52c 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/mm.h +++ b/drivers/gpu/nvgpu/include/nvgpu/mm.h @@ -1,4 +1,6 @@ /* + * Copyright (c) 2017-2018, 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 @@ -126,13 +128,12 @@ struct mm_gk20a { struct nvgpu_mem bar2_desc; -#ifdef CONFIG_TEGRA_19x_GPU struct nvgpu_mem hw_fault_buf[FAULT_TYPE_NUM]; unsigned int hw_fault_buf_status[FAULT_TYPE_NUM]; struct mmu_fault_info *fault_info[FAULT_TYPE_NUM]; struct nvgpu_mutex hub_isr_mutex; u32 hub_intr_types; -#endif + /* * Separate function to cleanup the CE since it requires a channel to * be closed which must happen before fifo cleanup. diff --git a/drivers/gpu/nvgpu/include/nvgpu/nvhost.h b/drivers/gpu/nvgpu/include/nvgpu/nvhost.h index d852c77c..6e92637a 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/nvhost.h +++ b/drivers/gpu/nvgpu/include/nvgpu/nvhost.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2018, 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"), @@ -77,5 +77,19 @@ struct sync_fence *nvgpu_nvhost_sync_create_fence( struct nvgpu_nvhost_dev *nvhost_dev, u32 id, u32 thresh, const char *name); #endif /* CONFIG_SYNC */ + +#ifdef CONFIG_TEGRA_T19X_GRHOST +int nvgpu_nvhost_syncpt_unit_interface_get_aperture( + struct nvgpu_nvhost_dev *nvhost_dev, + u64 *base, size_t *size); +u32 nvgpu_nvhost_syncpt_unit_interface_get_byte_offset(u32 syncpt_id); +#else +static inline int nvgpu_nvhost_syncpt_unit_interface_get_aperture( + struct nvgpu_nvhost_dev *nvhost_dev, + u64 *base, size_t *size) { return -EINVAL; } +static inline u32 nvgpu_nvhost_syncpt_unit_interface_get_byte_offset(u32 syncpt_id) { + return 0; +} +#endif #endif /* CONFIG_TEGRA_GK20A_NVHOST */ #endif /* __NVGPU_NVHOST_H__ */ diff --git a/drivers/gpu/nvgpu/include/nvgpu/nvhost_t19x.h b/drivers/gpu/nvgpu/include/nvgpu/nvhost_t19x.h deleted file mode 100644 index 4b499882..00000000 --- a/drivers/gpu/nvgpu/include/nvgpu/nvhost_t19x.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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_NVHOST_T19X_H__ -#define __NVGPU_NVHOST_T19X_H__ - -#ifdef CONFIG_TEGRA_GK20A_NVHOST -#include - -struct nvgpu_nvhost_dev; - -int nvgpu_nvhost_syncpt_unit_interface_get_aperture( - struct nvgpu_nvhost_dev *nvhost_dev, - u64 *base, size_t *size); -u32 nvgpu_nvhost_syncpt_unit_interface_get_byte_offset(u32 syncpt_id); - -#endif -#endif /* __NVGPU_NVHOST_T19X_H__ */ -- cgit v1.2.2