mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
scsi: ufs: Use conftest for Tegra264
The chip ID for Tegra264 was added in Linux v6.5 and not Linux v6.1 as
indicated in the Tegra UFS driver. Hence, the Tegra UFS driver does not
build against any generic Linux v6.1 to v6.4 kernel. Fix this by using
conftest to determine if the chip ID definition is present in the
kernel.
Bug 4221847
Change-Id: If2ca1202b2a69bf7de36fc327406f1579d2f4969
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3054870
(cherry picked from commit abeacc3534)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3054827
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
9b29abef53
commit
85692c2c64
@@ -1,5 +1,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
// Copyright (c) 2015-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
// Copyright (c) 2015-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||||
|
|
||||||
|
#include <nvidia/conftest.h>
|
||||||
|
|
||||||
#include <nvidia/conftest.h>
|
#include <nvidia/conftest.h>
|
||||||
|
|
||||||
@@ -1947,7 +1949,7 @@ static struct ufs_tegra_soc_data tegra234_soc_data = {
|
|||||||
.chip_id = TEGRA234,
|
.chip_id = TEGRA234,
|
||||||
};
|
};
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
|
#if defined(NV_TEGRA264_CHIP_ID_PRESENT) /* Linux v6.5 */
|
||||||
static struct ufs_tegra_soc_data tegra264_soc_data = {
|
static struct ufs_tegra_soc_data tegra264_soc_data = {
|
||||||
.chip_id = TEGRA264,
|
.chip_id = TEGRA264,
|
||||||
};
|
};
|
||||||
@@ -1960,7 +1962,7 @@ static const struct of_device_id ufs_tegra_of_match[] = {
|
|||||||
}, {
|
}, {
|
||||||
.compatible = "tegra234,ufs_variant",
|
.compatible = "tegra234,ufs_variant",
|
||||||
.data = &tegra234_soc_data,
|
.data = &tegra234_soc_data,
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
|
#if defined(NV_TEGRA264_CHIP_ID_PRESENT) /* Linux v6.5 */
|
||||||
}, {
|
}, {
|
||||||
.compatible = "tegra264,ufs_variant",
|
.compatible = "tegra264,ufs_variant",
|
||||||
.data = &tegra264_soc_data,
|
.data = &tegra264_soc_data,
|
||||||
|
|||||||
@@ -155,6 +155,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += simple_util_dai_init
|
|||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += spi_driver_struct_remove_return_type_int
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += spi_driver_struct_remove_return_type_int
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += spi_get_chipselect
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += spi_get_chipselect
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tc_taprio_qopt_offload_struct_has_cmd
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tc_taprio_qopt_offload_struct_has_cmd
|
||||||
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra264_chip_id
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra_dev_iommu_get_stream_id
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra_dev_iommu_get_stream_id
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra_ivc_struct_has_iosys_map
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra_ivc_struct_has_iosys_map
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tty_operations_struct_send_xchar_has_u8_arg
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tty_operations_struct_send_xchar_has_u8_arg
|
||||||
|
|||||||
@@ -7541,6 +7541,22 @@ compile_test() {
|
|||||||
compile_check_conftest "$CODE" "NV_TC_TAPRIO_QOPT_OFFLOAD_STRUCT_HAS_CMD" "" "types"
|
compile_check_conftest "$CODE" "NV_TC_TAPRIO_QOPT_OFFLOAD_STRUCT_HAS_CMD" "" "types"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
tegra264_chip_id)
|
||||||
|
#
|
||||||
|
# Determine if the 'TEGRA264' definition is present.
|
||||||
|
#
|
||||||
|
# Added by commit d94436465152 ("soc/tegra: fuse: Add support for
|
||||||
|
# Tegra264") in Linux v6.5.
|
||||||
|
#
|
||||||
|
CODE="
|
||||||
|
#include <soc/tegra/fuse.h>
|
||||||
|
u8 conftest_tegra264_chip_id(void) {
|
||||||
|
return TEGRA264;
|
||||||
|
}"
|
||||||
|
|
||||||
|
compile_check_conftest "$CODE" "NV_TEGRA264_CHIP_ID_PRESENT" "" "types"
|
||||||
|
;;
|
||||||
|
|
||||||
tegra_ivc_struct_has_iosys_map)
|
tegra_ivc_struct_has_iosys_map)
|
||||||
#
|
#
|
||||||
# Determine if the 'tegra_ivc' structure has the 'map' argument.
|
# Determine if the 'tegra_ivc' structure has the 'map' argument.
|
||||||
|
|||||||
Reference in New Issue
Block a user