Skip to content

Commit b42000e

Browse files
johnstultz-workandersson
authored andcommitted
firmware: qcom_scm: Allow qcom_scm driver to be loadable as a permenent module
Allow the qcom_scm driver to be loadable as a permenent module. This still uses the "depends on QCOM_SCM || !QCOM_SCM" bit to ensure that drivers that call into the qcom_scm driver are also built as modules. While not ideal in some cases its the only safe way I can find to avoid build errors without having those drivers select QCOM_SCM and have to force it on (as QCOM_SCM=n can be valid for those drivers). Reviving this now that Saravana's fw_devlink defaults to on, which should avoid loading troubles seen before. Acked-by: Kalle Valo <kvalo@codeaurora.org> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Will Deacon <will@kernel.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: John Stultz <john.stultz@linaro.org> Link: https://lore.kernel.org/r/20210707045320.529186-1-john.stultz@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
1 parent 0d361b0 commit b42000e

5 files changed

Lines changed: 10 additions & 2 deletions

File tree

‎drivers/firmware/Kconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ config INTEL_STRATIX10_RSU
235235
Say Y here if you want Intel RSU support.
236236

237237
config QCOM_SCM
238-
bool
238+
tristate "Qcom SCM driver"
239239
depends on ARM || ARM64
240240
depends on HAVE_ARM_SMCCC
241241
select RESET_CONTROLLER

‎drivers/firmware/Makefile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ obj-$(CONFIG_ISCSI_IBFT) += iscsi_ibft.o
1717
obj-$(CONFIG_FIRMWARE_MEMMAP) += memmap.o
1818
obj-$(CONFIG_RASPBERRYPI_FIRMWARE) += raspberrypi.o
1919
obj-$(CONFIG_FW_CFG_SYSFS) += qemu_fw_cfg.o
20-
obj-$(CONFIG_QCOM_SCM) += qcom_scm.o qcom_scm-smc.o qcom_scm-legacy.o
20+
obj-$(CONFIG_QCOM_SCM) += qcom-scm.o
21+
qcom-scm-objs += qcom_scm.o qcom_scm-smc.o qcom_scm-legacy.o
2122
obj-$(CONFIG_TI_SCI_PROTOCOL) += ti_sci.o
2223
obj-$(CONFIG_TRUSTED_FOUNDATIONS) += trusted_foundations.o
2324
obj-$(CONFIG_TURRIS_MOX_RWTM) += turris-mox-rwtm.o

‎drivers/firmware/qcom_scm.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,6 +1299,7 @@ static const struct of_device_id qcom_scm_dt_match[] = {
12991299
{ .compatible = "qcom,scm" },
13001300
{}
13011301
};
1302+
MODULE_DEVICE_TABLE(of, qcom_scm_dt_match);
13021303

13031304
static struct platform_driver qcom_scm_driver = {
13041305
.driver = {
@@ -1315,3 +1316,6 @@ static int __init qcom_scm_init(void)
13151316
return platform_driver_register(&qcom_scm_driver);
13161317
}
13171318
subsys_initcall(qcom_scm_init);
1319+
1320+
MODULE_DESCRIPTION("Qualcomm Technologies, Inc. SCM driver");
1321+
MODULE_LICENSE("GPL v2");

‎drivers/iommu/Kconfig‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ config SPAPR_TCE_IOMMU
253253
config ARM_SMMU
254254
tristate "ARM Ltd. System MMU (SMMU) Support"
255255
depends on ARM64 || ARM || (COMPILE_TEST && !GENERIC_ATOMIC64)
256+
depends on QCOM_SCM || !QCOM_SCM #if QCOM_SCM=m this can't be =y
256257
select IOMMU_API
257258
select IOMMU_IO_PGTABLE_LPAE
258259
select ARM_DMA_USE_IOMMU if ARM
@@ -382,6 +383,7 @@ config QCOM_IOMMU
382383
# Note: iommu drivers cannot (yet?) be built as modules
383384
bool "Qualcomm IOMMU Support"
384385
depends on ARCH_QCOM || (COMPILE_TEST && !GENERIC_ATOMIC64)
386+
depends on QCOM_SCM=y
385387
select IOMMU_API
386388
select IOMMU_IO_PGTABLE_LPAE
387389
select ARM_DMA_USE_IOMMU

‎drivers/net/wireless/ath/ath10k/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ config ATH10K_SNOC
4444
tristate "Qualcomm ath10k SNOC support"
4545
depends on ATH10K
4646
depends on ARCH_QCOM || COMPILE_TEST
47+
depends on QCOM_SCM || !QCOM_SCM #if QCOM_SCM=m this can't be =y
4748
select QCOM_QMI_HELPERS
4849
help
4950
This module adds support for integrated WCN3990 chip connected

0 commit comments

Comments
 (0)