mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
The fuse function tegra_get_sku_id() does not exist in upstream and so when building downstream drivers against an upstream kernel, the build fails. The tegra_get_sku_id() calls the function tegra_fuse_readl() which is supported in upstream and exported so can be used by external kernel modules. The implementation of the tegra_get_sku_id() has been moved to the header file 'fuse-helpers.h' that can be used by drivers and allow drivers to be built as external modules. Therefore, migrate drivers to use this implementation so we can move the implementation from the downstream kernel. Bug 2444929 Change-Id: I5a71044a11b63becc726784b9afb31c6384cb651 Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2653442 Reviewed-by: Bibek Basu <bbasu@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2894845 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com> Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
36 lines
737 B
C
36 lines
737 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved.
|
|
*/
|
|
|
|
#include <soc/tegra/fuse.h>
|
|
|
|
#define FUSE_SKU_INFO 0x10
|
|
|
|
static inline u32 tegra_get_sku_id(void)
|
|
{
|
|
if (!tegra_sku_info.sku_id)
|
|
tegra_fuse_readl(FUSE_SKU_INFO, &tegra_sku_info.sku_id);
|
|
|
|
return tegra_sku_info.sku_id;
|
|
}
|
|
|
|
#ifdef CONFIG_TEGRA_FUSE_UPSTREAM
|
|
|
|
/*
|
|
* For upstream the following functions to determine if the
|
|
* platform is silicon and simulator are not supported and
|
|
* so for now, always assume that we are silicon.
|
|
*/
|
|
static inline bool tegra_platform_is_silicon(void)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
static inline bool tegra_platform_is_sim(void)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
#endif /* CONFIG_TEGRA_FUSE_UPSTREAM */
|