diff --git a/arch/nvgpu-common.yaml b/arch/nvgpu-common.yaml index af0480b2f..78f4d5f52 100644 --- a/arch/nvgpu-common.yaml +++ b/arch/nvgpu-common.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2022, NVIDIA CORPORATION. All Rights Reserved. +# Copyright (c) 2019-2023, NVIDIA CORPORATION. All Rights Reserved. # # Common elements and units in nvgpu. # @@ -1167,6 +1167,12 @@ cic: common/cic/rm/cic_rm_priv.h, include/nvgpu/cic_rm.h ] +gin: + owner: Austin T + safe: no + sources: [ include/nvgpu/gops/gin.h, + include/nvgpu/gin.h ] + ## ## HAL units. Currently they are under common but this needs to change. ## We are moving these to a top level directory. diff --git a/drivers/gpu/nvgpu/include/nvgpu/gin.h b/drivers/gpu/nvgpu/include/nvgpu/gin.h new file mode 100644 index 000000000..e24f35fc9 --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/gin.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2023, 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_GIN_H +#define NVGPU_GIN_H + +/** + * Value to be passed to gin.get_intr_ctrl_msg to enable routing the interrupt + * to the CPU. + */ +#define NVGPU_GIN_CPU_ENABLE true + +/** + * Value to be passed to gin.get_intr_ctrl_msg to disable routing the interrupt + * to the CPU. + */ +#define NVGPU_GIN_CPU_DISABLE false + +/** + * Value to be passed to gin.get_intr_ctrl_msg to enable routing the interrupt + * to the GSP. + */ +#define NVGPU_GIN_GSP_ENABLE true + +/** + * Value to be passed to gin.get_intr_ctrl_msg to disable routing the interrupt + * to the GSP. + */ +#define NVGPU_GIN_GSP_DISABLE false + +#endif /* NVGPU_GIN_H */ diff --git a/drivers/gpu/nvgpu/include/nvgpu/gops/gin.h b/drivers/gpu/nvgpu/include/nvgpu/gops/gin.h new file mode 100644 index 000000000..a3628eea1 --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/gops/gin.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2023, 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_GOPS_GIN_H +#define NVGPU_GOPS_GIN_H + +#include + +/** + * @file + * + * GIN HAL interface. + */ +struct gk20a; + +/** + * GIN HAL operations. + * + * @see gpu_ops. + */ +struct gops_gin { + u32 (*get_intr_ctrl_msg)(struct gk20a *g, u32 vector, + bool cpu_enable, bool gsp_enable); +}; + +#endif diff --git a/drivers/gpu/nvgpu/include/nvgpu/gpu_ops.h b/drivers/gpu/nvgpu/include/nvgpu/gpu_ops.h index 02770d7d5..809a5d91e 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gpu_ops.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gpu_ops.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2020-2023, 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"), @@ -71,6 +71,7 @@ #include #include #include +#include #ifdef CONFIG_NVGPU_NON_FUSA #include #endif @@ -272,6 +273,8 @@ struct gpu_ops { struct gops_cic_mon cic_mon; + struct gops_gin gin; + /** @cond DOXYGEN_SHOULD_SKIP_THIS */ #ifdef CONFIG_NVGPU_NON_FUSA struct gops_mssnvlink mssnvlink;