From ad2857ccaa5526a58d35cf4ad8c6869df4e4ca47 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Fri, 23 Jun 2023 13:16:16 +0100 Subject: [PATCH] soc/tegra: Clean-up fuse-helper The option CONFIG_TEGRA_FUSE_UPSTREAM is not needed any longer because we always want to enable this for Linux v5.15. Therefore, remove this option completely. The function tegra_fuse_control_read() is not used anywhere and so we can also remove this too. Bug 3777983 Change-Id: I37888bc1f615f72b245c027e5c1a9251aca08af4 Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2925233 Reviewed-by: Laxman Dewangan Reviewed-by: svcacv GVS: Gerrit_Virtual_Submit --- Makefile | 2 -- drivers/video/tegra/host/nvdla/Makefile | 4 --- drivers/video/tegra/host/pva/Makefile | 3 --- include/soc/tegra/fuse-helper.h | 33 ------------------------- 4 files changed, 42 deletions(-) diff --git a/Makefile b/Makefile index d3edf3a8..c7e16ccf 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 # Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. -# Enable upstream fuse helper functions -ccflags-y += -DCONFIG_TEGRA_FUSE_UPSTREAM LINUXINCLUDE += -I$(srctree.nvidia-oot)/include obj-m += drivers/ diff --git a/drivers/video/tegra/host/nvdla/Makefile b/drivers/video/tegra/host/nvdla/Makefile index 9f4d07c0..b22d63ed 100644 --- a/drivers/video/tegra/host/nvdla/Makefile +++ b/drivers/video/tegra/host/nvdla/Makefile @@ -7,12 +7,8 @@ ifdef CONFIG_TEGRA_GRHOST ccflags-y += -DCONFIG_TEGRA_NVDLA_CHANNEL endif -# Enable FUSE UPSTREAM -CONFIG_TEGRA_FUSE_UPSTREAM := y - ccflags-y += -Werror ccflags-y += -DCONFIG_TEGRA_HOST1X -ccflags-y += -DCONFIG_TEGRA_FUSE_UPSTREAM nvhost-nvdla-objs = \ nvdla.o \ diff --git a/drivers/video/tegra/host/pva/Makefile b/drivers/video/tegra/host/pva/Makefile index c2e14d2f..b5081c2e 100644 --- a/drivers/video/tegra/host/pva/Makefile +++ b/drivers/video/tegra/host/pva/Makefile @@ -2,8 +2,6 @@ # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved. ifeq ($(findstring ack_src,$(NV_BUILD_KERNEL_OPTIONS)),) -# Enable UPSTREAM FUSE Driver always -CONFIG_TEGRA_FUSE_UPSTREAM := y GCOV_PROFILE := y ccflags-y += -I$(srctree.nvidia-oot)/drivers/video/tegra/host/pva @@ -11,7 +9,6 @@ ccflags-y += -I$(srctree.nvidia-oot)/drivers/video/tegra/host/pva/fw_include ccflags-y += -Werror ccflags-y += -DCONFIG_TEGRA_HOST1X -ccflags-y += -DCONFIG_TEGRA_FUSE_UPSTREAM ccflags-y += -DTEGRA_OOT_MODULE nvhost-pva-objs = \ diff --git a/include/soc/tegra/fuse-helper.h b/include/soc/tegra/fuse-helper.h index fb8ccba2..3213be3f 100644 --- a/include/soc/tegra/fuse-helper.h +++ b/include/soc/tegra/fuse-helper.h @@ -8,7 +8,6 @@ #include #define FUSE_SKU_INFO 0x10 -#define FUSE_BEGIN 0x100 static inline u32 tegra_get_sku_id(void) { @@ -18,8 +17,6 @@ static inline u32 tegra_get_sku_id(void) return tegra_sku_info.sku_id; } -#ifdef CONFIG_TEGRA_FUSE_UPSTREAM - static inline bool tegra_platform_is_silicon(void) { const struct soc_device_attribute tegra_soc_attrs[] = { @@ -63,33 +60,3 @@ static inline bool tegra_platform_is_vdk(void) return false; } - -/* - * tegra_fuse_control_read() - allows reading fuse offsets < 0x100. - * @offset: Offset to be read. - * @value: Pointer to an unsigned integer where the value is stored. - * - * Function tegra_fuse_control_read() allows reading fuse_offsets < 0x100 - * by using the already upstreamed tegra_fuse_readl() function. - * - * Return: Returns a negative integer in case of error, 0 in case - * of success. - */ -static inline int tegra_fuse_control_read(unsigned long offset, u32 *value) -{ - /* - * Allow reading offsets between 0x0 - 0xff. - * For offsets > 0xff, use tegra_fuse_readl instead. - */ - if (WARN_ON(offset > 0xff)) - return -EINVAL; - - /* - * This will overflow the offset value, which is safe as - * tegra_fuse_readl() would again add 0x100 to it. - */ - offset -= FUSE_BEGIN; - - return tegra_fuse_readl(offset, value); -} -#endif /* CONFIG_TEGRA_FUSE_UPSTREAM */