From 65d85c5c166bacd9ac52e9a140305b42fd5bb783 Mon Sep 17 00:00:00 2001 From: Manish Bhardwaj Date: Thu, 19 Sep 2024 18:25:22 +0000 Subject: [PATCH] nvidia-oot: ivc_ext: add dummy driver support For some of the kernel ivc_ext is part of core kernel and hence it is nto required to use the OOT ivc_ext driver. However, some packaging still expect the ivc_ext.ko from the OOT path. To trick the packaging file, add dummy ivc_ext driver which does not have anything other than module_init/module_exit. Bug 4551265 Change-Id: I315c9f302e65b4cdc1376815a7bc23e4b7ca3e00 Signed-off-by: Manish Bhardwaj Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3214053 Reviewed-by: Laxman Dewangan Reviewed-by: Bharat Nihalani GVS: buildbot_gerritrpt --- configs/Makefile.config.oot | 6 ++++++ drivers/firmware/tegra/Makefile | 5 +++++ drivers/firmware/tegra/ivc_ext_dummy.c | 21 +++++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 configs/Makefile.config.oot create mode 100644 drivers/firmware/tegra/ivc_ext_dummy.c diff --git a/configs/Makefile.config.oot b/configs/Makefile.config.oot new file mode 100644 index 00000000..a8817404 --- /dev/null +++ b/configs/Makefile.config.oot @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0-only +# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +# Kernel OOT specific environment variables to configure the OOT modules + +export NV_OOT_IVC_EXT_SKIP_BUILD=y diff --git a/drivers/firmware/tegra/Makefile b/drivers/firmware/tegra/Makefile index 71463ff6..bd21bea7 100644 --- a/drivers/firmware/tegra/Makefile +++ b/drivers/firmware/tegra/Makefile @@ -5,7 +5,12 @@ # Makefile for Extended IVC Driver and BPMP driver # +ifneq ($(NV_OOT_IVC_EXT_SKIP_BUILD),y) obj-m += ivc_ext.o +else +obj-m += ivc_ext.o +ivc_ext-objs := ivc_ext_dummy.o +endif tegra_bpmp-y += ../../clk/tegra/clk-bpmp.o tegra_bpmp-y += ../../reset/tegra/reset-bpmp.o tegra_bpmp-y += ../../soc/tegra/powergate-bpmp.o diff --git a/drivers/firmware/tegra/ivc_ext_dummy.c b/drivers/firmware/tegra/ivc_ext_dummy.c new file mode 100644 index 00000000..92c93e7d --- /dev/null +++ b/drivers/firmware/tegra/ivc_ext_dummy.c @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0-only +// SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +#include + +static int __init ivc_driver_dummy_init(void) +{ + pr_info("Inserting dummy ivc_ext.ko module"); + return 0; +} +module_init(ivc_driver_dummy_init); + +static void __exit ivc_driver_dummy_exit(void) +{ + pr_info("Removing dummy ivc_ext.ko module"); +} +module_exit(ivc_driver_dummy_exit); + +MODULE_AUTHOR("Laxman Dewangan "); +MODULE_DESCRIPTION("Extended IVC Dummy Driver"); +MODULE_LICENSE("GPL v2");