]> Git Repo - linux.git/blobdiff - drivers/firmware/qcom_scm.c
selftests: error out if kernel header files are not yet built
[linux.git] / drivers / firmware / qcom_scm.c
index 468d4d5ab550c91cfa415418cc5333746dc596c8..fde33acd46b756f2b9ac2bd1c9a2341084bcb974 100644 (file)
@@ -905,7 +905,7 @@ static int __qcom_scm_assign_mem(struct device *dev, phys_addr_t mem_region,
  * Return negative errno on failure or 0 on success with @srcvm updated.
  */
 int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz,
-                       unsigned int *srcvm,
+                       u64 *srcvm,
                        const struct qcom_scm_vmperm *newvm,
                        unsigned int dest_cnt)
 {
@@ -922,9 +922,9 @@ int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz,
        __le32 *src;
        void *ptr;
        int ret, i, b;
-       unsigned long srcvm_bits = *srcvm;
+       u64 srcvm_bits = *srcvm;
 
-       src_sz = hweight_long(srcvm_bits) * sizeof(*src);
+       src_sz = hweight64(srcvm_bits) * sizeof(*src);
        mem_to_map_sz = sizeof(*mem_to_map);
        dest_sz = dest_cnt * sizeof(*destvm);
        ptr_sz = ALIGN(src_sz, SZ_64) + ALIGN(mem_to_map_sz, SZ_64) +
@@ -937,8 +937,10 @@ int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz,
        /* Fill source vmid detail */
        src = ptr;
        i = 0;
-       for_each_set_bit(b, &srcvm_bits, BITS_PER_LONG)
-               src[i++] = cpu_to_le32(b);
+       for (b = 0; b < BITS_PER_TYPE(u64); b++) {
+               if (srcvm_bits & BIT(b))
+                       src[i++] = cpu_to_le32(b);
+       }
 
        /* Fill details of mem buff to map */
        mem_to_map = ptr + ALIGN(src_sz, SZ_64);
@@ -1479,7 +1481,7 @@ static int qcom_scm_probe(struct platform_device *pdev)
 
        init_completion(&__scm->waitq_comp);
 
-       irq = platform_get_irq(pdev, 0);
+       irq = platform_get_irq_optional(pdev, 0);
        if (irq < 0) {
                if (irq != -ENXIO)
                        return irq;
@@ -1506,8 +1508,7 @@ static int qcom_scm_probe(struct platform_device *pdev)
 static void qcom_scm_shutdown(struct platform_device *pdev)
 {
        /* Clean shutdown, disable download mode to allow normal restart */
-       if (download_mode)
-               qcom_scm_set_download_mode(false);
+       qcom_scm_set_download_mode(false);
 }
 
 static const struct of_device_id qcom_scm_dt_match[] = {
@@ -1542,6 +1543,7 @@ static const struct of_device_id qcom_scm_dt_match[] = {
        },
        { .compatible = "qcom,scm-msm8994" },
        { .compatible = "qcom,scm-msm8996" },
+       { .compatible = "qcom,scm-sm6375", .data = (void *)SCM_HAS_CORE_CLK },
        { .compatible = "qcom,scm" },
        {}
 };
This page took 0.034128 seconds and 4 git commands to generate.