From: Gokul Sriram P <gokul.palanisamy@oss.qualcomm.com>
To: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>,
andersson@kernel.org, mathieu.poirier@linaro.org,
robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
konradybcio@kernel.org, quic_mmanikan@quicinc.com,
linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Vignesh Viswanathan <vignesh.viswanathan@oss.qualcomm.com>,
Gokul Sriram Palanisamy <gokul.sriram.p@oss.qualcomm.com>,
George Moussalem <george.moussalem@outlook.com>
Subject: Re: [PATCH v9 3/6] remoteproc: qcom: add hexagon based WCSS secure PIL driver
Date: Mon, 12 Jan 2026 11:38:09 +0530 [thread overview]
Message-ID: <0cd181c2-76da-4b6d-97e6-bcdd553e6850@oss.qualcomm.com> (raw)
In-Reply-To: <20260106105412.3529898-4-varadarajan.narayanan@oss.qualcomm.com>
Hi Varada,
On 1/6/2026 4:24 PM, Varadarajan Narayanan wrote:
> From: Vignesh Viswanathan <vignesh.viswanathan@oss.qualcomm.com>
>
> Add support to bring up hexagon based WCSS using secure PIL. All IPQxxxx
> SoCs support secure Peripheral Image Loading (PIL).
>
> Secure PIL image is signed firmware image which only trusted software such
> as TrustZone (TZ) can authenticate and load. Linux kernel will send a
> Peripheral Authentication Service (PAS) request to TZ to authenticate and
> load the PIL images.
>
> In order to avoid overloading the existing WCSS driver or PAS driver, we
> came up with this new PAS based IPQ WCSS driver.
>
> Signed-off-by: Vignesh Viswanathan <vignesh.viswanathan@oss.qualcomm.com>
> Signed-off-by: Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
> Signed-off-by: Gokul Sriram Palanisamy <gokul.sriram.p@oss.qualcomm.com>
> Signed-off-by: George Moussalem <george.moussalem@outlook.com>
> [ Dropped ipq5424 support ]
> Signed-off-by: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>
> ---
> v8: Dropped ipq5424 support.
> The comments related to 'use_tmelcom' in [1] not applicable
> [1] https://lore.kernel.org/linux-arm-msm/72f0d4f7-8d8a-4fc5-bac2-8094e971a0e3@oss.qualcomm.com/
> Changed copyright for drivers/remoteproc/qcom_q6v5_wcss_sec.c
> ---
> drivers/remoteproc/Kconfig | 19 ++
> drivers/remoteproc/Makefile | 1 +
> drivers/remoteproc/qcom_q6v5_wcss_sec.c | 328 ++++++++++++++++++++++++
> include/linux/remoteproc.h | 2 +
> 4 files changed, 350 insertions(+)
> create mode 100644 drivers/remoteproc/qcom_q6v5_wcss_sec.c
>
[...]
> diff --git a/drivers/remoteproc/qcom_q6v5_wcss_sec.c b/drivers/remoteproc/qcom_q6v5_wcss_sec.c
> new file mode 100644
> index 000000000000..10fe3391decb
> --- /dev/null
> +++ b/drivers/remoteproc/qcom_q6v5_wcss_sec.c
> @@ -0,0 +1,328 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
> + */
> +#include <linux/clk.h>
> +#include <linux/firmware/qcom/qcom_scm.h>
> +#include <linux/io.h>
> +#include <linux/mailbox_client.h>
> +#include <linux/of_reserved_mem.h>
> +#include <linux/platform_device.h>
> +#include <linux/soc/qcom/mdt_loader.h>
> +
> +#include "qcom_common.h"
> +#include "qcom_q6v5.h"
> +#include "qcom_pil_info.h"
> +
> +#define WCSS_CRASH_REASON 421
> +
> +#define WCSS_PAS_ID 0x6
> +#define MPD_WCSS_PAS_ID 0xd
> +
> +#define Q6_WAIT_TIMEOUT (5 * HZ)
> +
> +struct wcss_sec {
> + struct device *dev;
> + struct qcom_rproc_glink glink_subdev;
> + struct qcom_rproc_ssr ssr_subdev;
> + struct qcom_q6v5 q6;
> + phys_addr_t mem_phys;
> + phys_addr_t mem_reloc;
> + void *mem_region;
> + size_t mem_size;
> + const struct wcss_data *desc;
> +
> + struct mbox_client mbox_client;
> + struct mbox_chan *mbox_chan;
> + void *metadata;
> + size_t metadata_len;
above member variables are now unused.
[...]
> +
> +static int wcss_sec_probe(struct platform_device *pdev)
> +{
> + const struct wcss_data *desc = of_device_get_match_data(&pdev->dev);
> + const char *fw_name = NULL;
> + struct wcss_sec *wcss;
> + struct clk *sleep_clk;
> + struct clk *int_clk;
> + struct rproc *rproc;
> + int ret;
> +
> + ret = of_property_read_string(pdev->dev.of_node, "firmware-name",
> + &fw_name);
> + if (ret < 0)
> + return ret;
> +
> + rproc = devm_rproc_alloc(&pdev->dev, desc->ss_name, &wcss_sec_ops,
> + fw_name, sizeof(*wcss));
> + if (!rproc) {
> + dev_err(&pdev->dev, "failed to allocate rproc\n");
> + return -ENOMEM;
> + }
> +
> + wcss = rproc->priv;
> + wcss->dev = &pdev->dev;
> + wcss->desc = desc;
> +
> + ret = wcss_sec_alloc_memory_region(wcss);
> + if (ret)
> + return ret;
> +
> + sleep_clk = devm_clk_get_optional_enabled(&pdev->dev, "sleep");
> + if (IS_ERR(sleep_clk))
> + return dev_err_probe(&pdev->dev, PTR_ERR(sleep_clk),
> + "Failed to get sleep clock\n");
> +
> + int_clk = devm_clk_get_optional_enabled(&pdev->dev, "interconnect");
> + if (IS_ERR(int_clk))
> + return dev_err_probe(&pdev->dev, PTR_ERR(int_clk),
> + "Failed to get interconnect clock\n");
> +
> + ret = qcom_q6v5_init(&wcss->q6, pdev, rproc,
> + WCSS_CRASH_REASON, NULL, NULL);
> + if (ret)
> + return ret;
> +
> + qcom_add_glink_subdev(rproc, &wcss->glink_subdev, desc->ss_name);
> + qcom_add_ssr_subdev(rproc, &wcss->ssr_subdev, desc->ss_name);
> +
> + rproc->auto_boot = false;
> + rproc->dump_conf = RPROC_COREDUMP_INLINE;
> + rproc_coredump_set_elf_info(rproc, ELFCLASS32, EM_NONE);
> +
> + ret = devm_rproc_add(&pdev->dev, rproc);
> + if (ret)
On failure, please include
qcom_remove_glink_subdev(rproc, &wcss->glink_subdev);
qcom_remove_ssr_subdev(rproc, &wcss->ssr_subdev);Regards,
Regards,
Gokul
> + return ret;
> +
> + platform_set_drvdata(pdev, rproc);
> +
> + return 0;
> +}
> +
> +static void wcss_sec_remove(struct platform_device *pdev)
> +{
> + struct rproc *rproc = platform_get_drvdata(pdev);
> + struct wcss_sec *wcss = rproc->priv;
> +
> + mbox_free_channel(wcss->mbox_chan);
> + qcom_remove_glink_subdev(rproc, &wcss->glink_subdev);
> + qcom_remove_ssr_subdev(rproc, &wcss->ssr_subdev);
> + qcom_q6v5_deinit(&wcss->q6);
> +}
> +
> +static const struct wcss_data wcss_sec_ipq5332_res_init = {
> + .pasid = MPD_WCSS_PAS_ID,
> + .ss_name = "q6wcss",
> +};
> +
> +static const struct wcss_data wcss_sec_ipq9574_res_init = {
> + .pasid = WCSS_PAS_ID,
> + .ss_name = "q6wcss",
> +};
> +
> +static const struct of_device_id wcss_sec_of_match[] = {
> + { .compatible = "qcom,ipq5018-wcss-sec-pil", .data = &wcss_sec_ipq5332_res_init },
> + { .compatible = "qcom,ipq5332-wcss-sec-pil", .data = &wcss_sec_ipq5332_res_init },
> + { .compatible = "qcom,ipq9574-wcss-sec-pil", .data = &wcss_sec_ipq9574_res_init },
> + { },
> +};
> +MODULE_DEVICE_TABLE(of, wcss_sec_of_match);
> +
> +static struct platform_driver wcss_sec_driver = {
> + .probe = wcss_sec_probe,
> + .remove = wcss_sec_remove,
> + .driver = {
> + .name = "qcom-wcss-secure-pil",
> + .of_match_table = wcss_sec_of_match,
> + },
> +};
> +module_platform_driver(wcss_sec_driver);
> +
> +MODULE_DESCRIPTION("Hexagon WCSS Secure Peripheral Image Loader");
> +MODULE_LICENSE("GPL");
> diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
> index b4795698d8c2..7b2159853345 100644
> --- a/include/linux/remoteproc.h
> +++ b/include/linux/remoteproc.h
> @@ -472,6 +472,7 @@ enum rproc_dump_mechanism {
> * @node: list node related to the rproc segment list
> * @da: device address of the segment
> * @size: size of the segment
> + * @io_ptr: ptr to store the ioremapped dump segment
> * @priv: private data associated with the dump_segment
> * @dump: custom dump function to fill device memory segment associated
> * with coredump
> @@ -483,6 +484,7 @@ struct rproc_dump_segment {
> dma_addr_t da;
> size_t size;
>
> + void *io_ptr;
> void *priv;
> void (*dump)(struct rproc *rproc, struct rproc_dump_segment *segment,
> void *dest, size_t offset, size_t size);
next prev parent reply other threads:[~2026-01-12 6:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-06 10:54 [PATCH v9 0/6] Add new driver for WCSS secure PIL loading Varadarajan Narayanan
2026-01-06 10:54 ` [PATCH v9 1/6] firmware: qcom_scm: ipq5332: add support to pass metadata size Varadarajan Narayanan
2026-01-06 16:11 ` Dmitry Baryshkov
2026-01-06 10:54 ` [PATCH v9 2/6] dt-bindings: remoteproc: qcom: document hexagon based WCSS secure PIL Varadarajan Narayanan
2026-01-07 7:32 ` Krzysztof Kozlowski
2026-01-06 10:54 ` [PATCH v9 3/6] remoteproc: qcom: add hexagon based WCSS secure PIL driver Varadarajan Narayanan
2026-01-12 6:08 ` Gokul Sriram P [this message]
2026-01-06 10:54 ` [PATCH v9 4/6] arm64: dts: qcom: ipq5018: add nodes to bring up q6 Varadarajan Narayanan
2026-01-06 10:54 ` [PATCH v9 5/6] arm64: dts: qcom: ipq5332: " Varadarajan Narayanan
2026-01-06 10:54 ` [PATCH v9 6/6] arm64: dts: qcom: ipq9574: " Varadarajan Narayanan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0cd181c2-76da-4b6d-97e6-bcdd553e6850@oss.qualcomm.com \
--to=gokul.palanisamy@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=george.moussalem@outlook.com \
--cc=gokul.sriram.p@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=quic_mmanikan@quicinc.com \
--cc=robh@kernel.org \
--cc=varadarajan.narayanan@oss.qualcomm.com \
--cc=vignesh.viswanathan@oss.qualcomm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox