diff --git a/include/soc/tegra/fuse-helper.h b/include/soc/tegra/fuse-helper.h new file mode 100644 index 00000000..fafbb83c --- /dev/null +++ b/include/soc/tegra/fuse-helper.h @@ -0,0 +1,35 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. + */ + +#include + +#ifdef CONFIG_TEGRA_FUSE_UPSTREAM + +#define FUSE_SKU_INFO 0x10 + +/* + * 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; +} + +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; +} + +#endif /* CONFIG_TEGRA_FUSE_UPSTREAM */