From 1c3c34f33f0b4e593efd34066d0f8e03c90a2789 Mon Sep 17 00:00:00 2001 From: Manish Bhardwaj Date: Sun, 22 Sep 2024 19:57:35 +0000 Subject: [PATCH] nvidia-oot: tegra_bpmp: add dummy driver support For some of the kernel tegra_bpmp is part of core kernel and hence it is nto required to use the OOT tegra_bpmp driver. However, some packaging still expect the tegra_bpmp.ko from the OOT path. To trick the packaging file, add dummy tegra_bpmp driver which does not have anything other than module_init/module_exit. Bug 4551265 Change-Id: Ifae52acb63be009029c820b0ba7b15da6ea7a12e Signed-off-by: Manish Bhardwaj Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3198304 Reviewed-by: Bharat Nihalani Reviewed-by: Laxman Dewangan GVS: buildbot_gerritrpt --- configs/Makefile.config.oot | 1 + drivers/firmware/tegra/Makefile | 6 ++++++ drivers/firmware/tegra/tegra_bpmp_dummy.c | 21 +++++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 drivers/firmware/tegra/tegra_bpmp_dummy.c diff --git a/configs/Makefile.config.oot b/configs/Makefile.config.oot index cf1f42ad..16e20be2 100644 --- a/configs/Makefile.config.oot +++ b/configs/Makefile.config.oot @@ -5,3 +5,4 @@ export NV_OOT_IVC_EXT_SKIP_BUILD=y export NV_OOT_TEGRA_HV_SKIP_BUILD=y +export NV_OOT_TEGRA_BPMP_SKIP_BUILD=y diff --git a/drivers/firmware/tegra/Makefile b/drivers/firmware/tegra/Makefile index bd21bea7..9bd0ab0a 100644 --- a/drivers/firmware/tegra/Makefile +++ b/drivers/firmware/tegra/Makefile @@ -11,9 +11,15 @@ else obj-m += ivc_ext.o ivc_ext-objs := ivc_ext_dummy.o endif + +ifneq ($(NV_OOT_TEGRA_BPMP_SKIP_BUILD),y) tegra_bpmp-y += ../../clk/tegra/clk-bpmp.o tegra_bpmp-y += ../../reset/tegra/reset-bpmp.o tegra_bpmp-y += ../../soc/tegra/powergate-bpmp.o tegra_bpmp-$(CONFIG_DEBUG_FS) += bpmp-debugfs.o tegra_bpmp-y += bpmp-tegra186-hv.o obj-m += tegra_bpmp.o +else +obj-m += tegra_bpmp.o +tegra_bpmp-objs += tegra_bpmp_dummy.o +endif diff --git a/drivers/firmware/tegra/tegra_bpmp_dummy.c b/drivers/firmware/tegra/tegra_bpmp_dummy.c new file mode 100644 index 00000000..e22d2549 --- /dev/null +++ b/drivers/firmware/tegra/tegra_bpmp_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 tegra_bpmp_dummy_init(void) +{ + pr_info("Inserting dummy tegra_bpmp.ko module"); + return 0; +} +module_init(tegra_bpmp_dummy_init); + +static void __exit tegra_bpmp_dummy_exit(void) +{ + pr_info("Removing dummy tegra_bpmp.ko module"); +} +module_exit(tegra_bpmp_dummy_exit); + +MODULE_AUTHOR("Manish Bhardwaj "); +MODULE_DESCRIPTION("Tegra BPMP Dummy Driver"); +MODULE_LICENSE("GPL v2");