From patchwork Fri Nov 6 04:27:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 320767 Delivered-To: patches@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp1002004ilc; Thu, 5 Nov 2020 20:27:17 -0800 (PST) X-Received: by 2002:a65:4302:: with SMTP id j2mr122510pgq.177.1604636837307; Thu, 05 Nov 2020 20:27:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604636837; cv=none; d=google.com; s=arc-20160816; b=VjmFqkzzSEFh91BfJU2lv+4QuZSBHeIEyvCKHbamF8TgxyREyz+ex5uLCPWEj9E/2e OtMMzyDFEvWWzhbRPLqgN3druML/rA2k0KdzSRLutoLiCALy953gFQA2wFaNgDYTLE7B +Jhdl9iGiDmSUYMX4lUgVKK9KoHaO398k8ITd7htXrmKlcg/1WmhOQ8s0EClLKNGZvPW JAIlGZkqflcJdT0jRlLWz5LUorHnMJJwpLvbZOgdK1WedEFtCBoSzwLz1DwwtNspj/Pp 3EJKQx+oLh26X5tEWRsMvscmHJVg5/yo6igRA71HlSAQu5mafbNpaUm1S/+mzMVHDzyd tL/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NUyUANspNtxDV6SxRCRDpb8/aThmojrVXw0zcthEhBk=; b=Tll5zHzC98HwxB1ifZlubHJp/KZMUwqqoJQqIPihQbaP3oDKeBp2KNao3fchpCrVxt zg4kAw/zOa+QSz7bbrnxyFsjx67vfGjS01mEAvirlWDYE3jVerY6cf8DgjxTuCES3E/+ E1n8MFZP5LtfdC6+3qauboYtW1Ituo2iWnC4UFDiUx+0ApPVtTx5NYLroLfxckkxEWbF VHW+fq05Jp/F/yGYdfu6d1NRvXn91XlFxpwhDq0SlN2MV1V6aCHh6Rv9kWA+Rv9GRUZ3 7fUMfKBj5H3156+aPCRdTXn54uobma2yd9jEpqS7odNEg6WcRKPEYXEanV22LYCorcBX yuUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Hu5jg04R; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id t65sor50758pgt.49.2020.11.05.20.27.17 for (Google Transport Security); Thu, 05 Nov 2020 20:27:17 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Hu5jg04R; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NUyUANspNtxDV6SxRCRDpb8/aThmojrVXw0zcthEhBk=; b=Hu5jg04RZzsiEQNEkfBdU7HvTeClSbA9rbqmuTpj13kO6V2WvZdvCTlRkSjPq6d+JL rwyJm4LFVyIzI6qM/IJjtwf2Y6bDJrgU+FSGuIit1HGlJxOSjCMyMF44Gg4UyFUG7qO3 xJS0t4YYM7RIjwwv/ukdeVzHGljKFPSmfxl3eGcGS51EgrhCGt5LaLCK5wRjh1KedWUb 5zZdnbWKoSsU9m+RhG56xzrPNLx7NZ3BTIypYAK58JQHiBVaFXrtYc40iqdIyPwMVkVg uCBuF/Wu+WPso6v95Q4CbfbJKsSR+3FYzz3JL3DYmMZIZpTsSU2T/HFaWyMxl/0nXhi4 4d9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NUyUANspNtxDV6SxRCRDpb8/aThmojrVXw0zcthEhBk=; b=MipiO+KoclXSy7st4fxDCiKo1s+ggGrOvYSE+jaL7OQHHRxHiY4V3tWpyngn6xWOre y0EsKdlxUdXWpcybSa66Fp5Sw9yXZn08vz2/VArje8VUzbaI+/5SLtQH0TFY/UO3Y2kH IYLCogZJ6hEfaBPxigXcxC06sgK3womxhXQCVLAsTW/BFpBe8PINidzv9kgzi7X+l5Vg SBLUrhGkpdvacy4xNQcoFE1iWs+cf4ocJx6ndh6a7R36guMHyiZ4yVjICtWhTCYURhVB OchYZ6xBoQL/Rz8RRMq+4upYL4VE4lem8RQb9dQNP5j/lPM8+7tclcf6nXOHZuF0A5iF GFDQ== X-Gm-Message-State: AOAM530uFPhNPoZS9TOijCiEbwPB27eQ7u94Ekqk3rADLvJQJemYW+4U jSdKvzJbTHTVs8KmSZHDw9I/cFdL X-Google-Smtp-Source: ABdhPJxCgyO1IUphemwtnrgRQaBdpcBmVSqDyVQVBYjefKLrAb/d38xXs4evPD2oZV9TF1NkjAjypg== X-Received: by 2002:a63:d357:: with SMTP id u23mr161799pgi.106.1604636837005; Thu, 05 Nov 2020 20:27:17 -0800 (PST) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id e24sm179864pfl.149.2020.11.05.20.27.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 20:27:16 -0800 (PST) From: John Stultz To: lkml Cc: John Stultz , Catalin Marinas , Will Deacon , Andy Gross , Bjorn Andersson , Joerg Roedel , Thomas Gleixner , Jason Cooper , Marc Zyngier , Linus Walleij , Vinod Koul , Kalle Valo , Maulik Shah , Lina Iyer , Saravana Kannan , Todd Kjos , Greg Kroah-Hartman , linux-arm-msm@vger.kernel.org, iommu@lists.linux-foundation.org, linux-gpio@vger.kernel.org Subject: [PATCH v6 3/3] firmware: QCOM_SCM: Allow qcom_scm driver to be loadable as a permenent module Date: Fri, 6 Nov 2020 04:27:10 +0000 Message-Id: <20201106042710.55979-3-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201106042710.55979-1-john.stultz@linaro.org> References: <20201106042710.55979-1-john.stultz@linaro.org> 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). Cc: Catalin Marinas Cc: Will Deacon Cc: Andy Gross Cc: Bjorn Andersson Cc: Joerg Roedel Cc: Thomas Gleixner Cc: Jason Cooper Cc: Marc Zyngier Cc: Linus Walleij Cc: Vinod Koul Cc: Kalle Valo Cc: Maulik Shah Cc: Lina Iyer Cc: Saravana Kannan Cc: Todd Kjos Cc: Greg Kroah-Hartman Cc: linux-arm-msm@vger.kernel.org Cc: iommu@lists.linux-foundation.org Cc: linux-gpio@vger.kernel.org Acked-by: Kalle Valo Acked-by: Greg Kroah-Hartman Reviewed-by: Bjorn Andersson Signed-off-by: John Stultz --- v3: * Fix __arm_smccc_smc build issue reported by kernel test robot v4: * Add "depends on QCOM_SCM || !QCOM_SCM" bit to ath10k config that requires it. v5: * Fix QCOM_QCM typo in Kconfig, it should be QCOM_SCM --- drivers/firmware/Kconfig | 4 ++-- drivers/firmware/Makefile | 3 ++- drivers/firmware/qcom_scm.c | 4 ++++ drivers/iommu/Kconfig | 2 ++ drivers/net/wireless/ath/ath10k/Kconfig | 1 + 5 files changed, 11 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig index 3315e3c215864..5e369928bc567 100644 --- a/drivers/firmware/Kconfig +++ b/drivers/firmware/Kconfig @@ -235,8 +235,8 @@ config INTEL_STRATIX10_RSU Say Y here if you want Intel RSU support. config QCOM_SCM - bool - depends on ARM || ARM64 + tristate "Qcom SCM driver" + depends on (ARM && HAVE_ARM_SMCCC) || ARM64 select RESET_CONTROLLER config QCOM_SCM_DOWNLOAD_MODE_DEFAULT diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile index 5e013b6a3692e..523173cbff335 100644 --- a/drivers/firmware/Makefile +++ b/drivers/firmware/Makefile @@ -17,7 +17,8 @@ obj-$(CONFIG_ISCSI_IBFT) += iscsi_ibft.o obj-$(CONFIG_FIRMWARE_MEMMAP) += memmap.o obj-$(CONFIG_RASPBERRYPI_FIRMWARE) += raspberrypi.o obj-$(CONFIG_FW_CFG_SYSFS) += qemu_fw_cfg.o -obj-$(CONFIG_QCOM_SCM) += qcom_scm.o qcom_scm-smc.o qcom_scm-legacy.o +obj-$(CONFIG_QCOM_SCM) += qcom-scm.o +qcom-scm-objs += qcom_scm.o qcom_scm-smc.o qcom_scm-legacy.o obj-$(CONFIG_TI_SCI_PROTOCOL) += ti_sci.o obj-$(CONFIG_TRUSTED_FOUNDATIONS) += trusted_foundations.o obj-$(CONFIG_TURRIS_MOX_RWTM) += turris-mox-rwtm.o diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c index 7be48c1bec96d..6f431b73e617d 100644 --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c @@ -1280,6 +1280,7 @@ static const struct of_device_id qcom_scm_dt_match[] = { { .compatible = "qcom,scm" }, {} }; +MODULE_DEVICE_TABLE(of, qcom_scm_dt_match); static struct platform_driver qcom_scm_driver = { .driver = { @@ -1295,3 +1296,6 @@ static int __init qcom_scm_init(void) return platform_driver_register(&qcom_scm_driver); } subsys_initcall(qcom_scm_init); + +MODULE_DESCRIPTION("Qualcomm Technologies, Inc. SCM driver"); +MODULE_LICENSE("GPL v2"); diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index 04878caf6da49..c64d7a2b65134 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -248,6 +248,7 @@ config SPAPR_TCE_IOMMU config ARM_SMMU tristate "ARM Ltd. System MMU (SMMU) Support" depends on ARM64 || ARM || (COMPILE_TEST && !GENERIC_ATOMIC64) + depends on QCOM_SCM || !QCOM_SCM #if QCOM_SCM=m this can't be =y select IOMMU_API select IOMMU_IO_PGTABLE_LPAE select ARM_DMA_USE_IOMMU if ARM @@ -375,6 +376,7 @@ config QCOM_IOMMU # Note: iommu drivers cannot (yet?) be built as modules bool "Qualcomm IOMMU Support" depends on ARCH_QCOM || (COMPILE_TEST && !GENERIC_ATOMIC64) + depends on QCOM_SCM=y select IOMMU_API select IOMMU_IO_PGTABLE_LPAE select ARM_DMA_USE_IOMMU diff --git a/drivers/net/wireless/ath/ath10k/Kconfig b/drivers/net/wireless/ath/ath10k/Kconfig index 40f91bc8514d8..741289e385d59 100644 --- a/drivers/net/wireless/ath/ath10k/Kconfig +++ b/drivers/net/wireless/ath/ath10k/Kconfig @@ -44,6 +44,7 @@ config ATH10K_SNOC tristate "Qualcomm ath10k SNOC support" depends on ATH10K depends on ARCH_QCOM || COMPILE_TEST + depends on QCOM_SCM || !QCOM_SCM #if QCOM_SCM=m this can't be =y select QCOM_QMI_HELPERS help This module adds support for integrated WCN3990 chip connected