From 3ee67f0ee5c9eb7ed91bc4c8d41aeb0edce9ec2d Mon Sep 17 00:00:00 2001 From: Vedashree Vidwans Date: Tue, 13 Jun 2023 23:47:36 +0000 Subject: [PATCH] host1x: do not use CONFIG_TEGRA_SOC_HWPM OOT kerel builds do not use Kconfig files to define required config flags. Thus, CONFIG_TEGRA_SOC_HWPM is not defined for OOT configs. Remove use of CONFIG_TEGRA_SOC_HWPM flag from PVA, DLA and FLCN drivers. For OOT builds, HWPM driver is always compiled independent of CONFIG_TEGRA_SOC_HWPM flag. For safety builds where HWPM functionality is not allowed, mock HWPM functions will be used. Bug 4061775 Change-Id: I49d8df6d3293e9bde9e233561363872fc41742f4 Signed-off-by: Vedashree Vidwans Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2920819 Reviewed-by: svcacv Reviewed-by: Adeel Raza GVS: Gerrit_Virtual_Submit --- drivers/video/tegra/host/nvdla/nvdla.c | 14 +------------- drivers/video/tegra/host/pva/pva.c | 9 --------- drivers/video/tegra/host/pva/pva.h | 4 ---- drivers/video/tegra/host/pva/pva_nvhost.h | 3 --- 4 files changed, 1 insertion(+), 29 deletions(-) diff --git a/drivers/video/tegra/host/nvdla/nvdla.c b/drivers/video/tegra/host/nvdla/nvdla.c index eaa66194..b46b5388 100644 --- a/drivers/video/tegra/host/nvdla/nvdla.c +++ b/drivers/video/tegra/host/nvdla/nvdla.c @@ -20,9 +20,7 @@ #include #include #include -#ifdef CONFIG_TEGRA_SOC_HWPM #include -#endif #if (IS_ENABLED(CONFIG_TEGRA_HSIERRRPTINJ)) #include @@ -760,7 +758,6 @@ static int nvdla_alloc_window_size_memory(struct platform_device *pdev) return err; } -#ifdef CONFIG_TEGRA_SOC_HWPM static int nvdla_hwpm_ip_pm(void *ip_dev, bool disable) { int err = 0; @@ -798,7 +795,6 @@ static int nvdla_hwpm_ip_reg_op(void *ip_dev, return 0; } -#endif static uint32_t nvdla_read_soft_sku_scratch_register(void) { @@ -982,9 +978,7 @@ static int nvdla_probe(struct platform_device *pdev) struct nvdla_device *nvdla_dev = NULL; struct device *dev = &pdev->dev; uint32_t soft_fuse_ret = 0U; -#ifdef CONFIG_TEGRA_SOC_HWPM struct tegra_soc_hwpm_ip_ops hwpm_ip_ops; -#endif #if !IS_ENABLED(CONFIG_TEGRA_GRHOST) struct kobj_attribute *attr = NULL; @@ -1128,7 +1122,6 @@ static int nvdla_probe(struct platform_device *pdev) if (err) goto err_alloc_window_size_mem; -#ifdef CONFIG_TEGRA_SOC_HWPM nvdla_dbg_info(pdev, "hwpm ip %s register", pdev->name); hwpm_ip_ops.ip_dev = (void *)pdev; hwpm_ip_ops.ip_base_address = pdev->resource[0].start; @@ -1136,7 +1129,6 @@ static int nvdla_probe(struct platform_device *pdev) hwpm_ip_ops.hwpm_ip_pm = &nvdla_hwpm_ip_pm; hwpm_ip_ops.hwpm_ip_reg_op = &nvdla_hwpm_ip_reg_op; tegra_soc_hwpm_ip_register(&hwpm_ip_ops); -#endif #if (IS_ENABLED(CONFIG_TEGRA_HSIERRRPTINJ)) err = nvdla_error_inj_handler_init(nvdla_dev); @@ -1195,9 +1187,7 @@ err_clk_cap_fail: #endif #if (IS_ENABLED(CONFIG_TEGRA_HSIERRRPTINJ)) err_inj_handler_init: -#ifdef CONFIG_TEGRA_SOC_HWPM tegra_soc_hwpm_ip_unregister(&hwpm_ip_ops); -#endif /* CONFIG_TEGRA_SOC_HWPM */ nvdla_free_window_size_memory(pdev); #endif /* CONFIG_TEGRA_HSIERRRPTINJ */ err_alloc_window_size_mem: @@ -1227,6 +1217,7 @@ static int __exit nvdla_remove(struct platform_device *pdev) { struct nvhost_device_data *pdata = platform_get_drvdata(pdev); struct nvdla_device *nvdla_dev = pdata->private_data; + struct tegra_soc_hwpm_ip_ops hwpm_ip_ops; #if !IS_ENABLED(CONFIG_TEGRA_GRHOST) int i; @@ -1242,8 +1233,6 @@ static int __exit nvdla_remove(struct platform_device *pdev) } #endif -#ifdef CONFIG_TEGRA_SOC_HWPM - struct tegra_soc_hwpm_ip_ops hwpm_ip_ops; nvdla_dbg_info(pdev, "hwpm ip %s unregister", pdev->name); hwpm_ip_ops.ip_dev = (void *)pdev; hwpm_ip_ops.ip_base_address = pdev->resource[0].start; @@ -1251,7 +1240,6 @@ static int __exit nvdla_remove(struct platform_device *pdev) hwpm_ip_ops.hwpm_ip_pm = NULL; hwpm_ip_ops.hwpm_ip_reg_op = NULL; tegra_soc_hwpm_ip_unregister(&hwpm_ip_ops); -#endif #if (IS_ENABLED(CONFIG_TEGRA_HSIERRRPTINJ)) nvdla_error_inj_handler_deinit(nvdla_dev); diff --git a/drivers/video/tegra/host/pva/pva.c b/drivers/video/tegra/host/pva/pva.c index 23bc15b1..9972b76b 100644 --- a/drivers/video/tegra/host/pva/pva.c +++ b/drivers/video/tegra/host/pva/pva.c @@ -925,7 +925,6 @@ int pva_prepare_poweroff(struct platform_device *pdev) return 0; } -#ifdef CONFIG_TEGRA_SOC_HWPM int pva_hwpm_ip_pm(void *ip_dev, bool disable) { int err = 0; @@ -970,7 +969,6 @@ int pva_hwpm_ip_reg_op(void *ip_dev, enum tegra_soc_hwpm_ip_reg_op reg_op, return 0; } -#endif #if !IS_ENABLED(CONFIG_TEGRA_GRHOST) static ssize_t clk_cap_store(struct kobject *kobj, @@ -1042,10 +1040,7 @@ static int pva_probe(struct platform_device *pdev) struct pva *pva; int err = 0; size_t i; - -#ifdef CONFIG_TEGRA_SOC_HWPM u32 offset; -#endif #if !IS_ENABLED(CONFIG_TEGRA_GRHOST) struct kobj_attribute *attr = NULL; @@ -1270,7 +1265,6 @@ static int pva_probe(struct platform_device *pdev) ++(pva->sid_count); -#ifdef CONFIG_TEGRA_SOC_HWPM offset = hwpm_get_offset(); if ((UINT_MAX - offset) < pdev->resource[0].start) { @@ -1285,7 +1279,6 @@ static int pva_probe(struct platform_device *pdev) pva->hwpm_ip_ops.hwpm_ip_pm = &pva_hwpm_ip_pm; pva->hwpm_ip_ops.hwpm_ip_reg_op = &pva_hwpm_ip_reg_op; tegra_soc_hwpm_ip_register(&pva->hwpm_ip_ops); -#endif #if !IS_ENABLED(CONFIG_TEGRA_GRHOST) if (pdata->num_clks > 0) { @@ -1377,9 +1370,7 @@ static int __exit pva_remove(struct platform_device *pdev) } #endif -#ifdef CONFIG_TEGRA_SOC_HWPM tegra_soc_hwpm_ip_unregister(&pva->hwpm_ip_ops); -#endif #ifdef CONFIG_DEBUG_FS pva_debugfs_deinit(pva); diff --git a/drivers/video/tegra/host/pva/pva.h b/drivers/video/tegra/host/pva/pva.h index bbc84c52..3e9e3616 100644 --- a/drivers/video/tegra/host/pva/pva.h +++ b/drivers/video/tegra/host/pva/pva.h @@ -20,9 +20,7 @@ #include "pva_vpu_app_auth.h" #include "pva_fw_carveout.h" -#ifdef CONFIG_TEGRA_SOC_HWPM #include -#endif /** * PVA Host1x class IDs @@ -441,9 +439,7 @@ struct pva { struct pva_vpu_dbg_block vpu_dbg_blocks[NUM_VPU_BLOCKS]; -#ifdef CONFIG_TEGRA_SOC_HWPM struct tegra_soc_hwpm_ip_ops hwpm_ip_ops; -#endif }; /** diff --git a/drivers/video/tegra/host/pva/pva_nvhost.h b/drivers/video/tegra/host/pva/pva_nvhost.h index 5e20fbe3..6e9530aa 100644 --- a/drivers/video/tegra/host/pva/pva_nvhost.h +++ b/drivers/video/tegra/host/pva/pva_nvhost.h @@ -38,8 +38,6 @@ int pva_finalize_poweron(struct platform_device *pdev); */ int pva_prepare_poweroff(struct platform_device *pdev); -#ifdef CONFIG_TEGRA_SOC_HWPM - enum tegra_soc_hwpm_ip_reg_op; /** @@ -78,4 +76,3 @@ int pva_hwpm_ip_reg_op(void *ip_dev, u32 inst_element_index, u64 reg_offset, u32 *reg_data); #endif -#endif