* [PATCH V4 0/8] Add new driver for WCSS secure PIL loading
@ 2025-04-03 12:02 Gokul Sriram Palanisamy
2025-04-03 12:02 ` [PATCH V4 1/8] firmware: qcom_scm: ipq5332: add support to pass metadata size Gokul Sriram Palanisamy
` (9 more replies)
0 siblings, 10 replies; 20+ messages in thread
From: Gokul Sriram Palanisamy @ 2025-04-03 12:02 UTC (permalink / raw)
To: andersson, mathieu.poirier, robh, krzk+dt, conor+dt, konradybcio,
quic_mmanikan, linux-arm-msm, linux-remoteproc, devicetree
Cc: quic_srichara, vignesh.viswanathan, gokul.sriram.p
This series depends on Sricharan's tmel-qmp mailbox driver series v4 [1].
- Secure PIL is signed, split firmware images which only TrustZone (TZ)
can authenticate and load. Linux kernel will send a request to TZ to
authenticate and load the PIL images.
- When secure PIL support was added to the existing wcss PIL driver
earlier in [2], Bjorn suggested not to overload the existing WCSS
rproc driver, instead post a new driver for PAS based IPQ WCSS driver.
This series adds a new secure PIL driver for the same.
- Also adds changes to scm to pass metadata size as required for IPQ5332,
reposted from [3].
[1]
https://patchwork.kernel.org/project/linux-arm-msm/cover/20250327181750.3733881-1-quic_srichara@quicinc.com/
[2]
https://patchwork.kernel.org/project/linux-arm-msm/patch/1611984013-10201-3-git-send-email-gokulsri@codeaurora.org/
[3]
https://patchwork.kernel.org/project/linux-arm-msm/patch/20240820055618.267554-6-quic_gokulsri@quicinc.com/
changes in v4:
- changed q6 firmware image format from .mdt to .mbn
- corrected arrangement of variable assignemnts as per comments
in qcom_scm.c
- added scm call to get board machid
- added support for q6 dtb loading with support for additional
reserved memory for q6 dtb in .mbn format
- updated dt-bindings to include new dts entry qcom,q6-dtb-info
and additional item in memory-region for q6 dtb region.
- removed unnecessary dependency for QCOM_Q6V5_WCSS_SEC in
Kconfig
- removed unwanted header files in qcom_q6v5_wcss_sec.c
- removed repeated dtb parsing during runtime in qcom_q6v5_wcss_sec.c
- added required check for using tmelcom, if available. Enabled
fallback to scm based authentication, if tmelcom is unavailable.
- added necessary padding for 8digt hex address in dts
Following tests were done:
- checkpatch
- kernel-doc
- dt_binding_check and dtbs_check
changes in v3:
- fixed copyright years and markings based on Jeff's comments.
- replaced devm_ioremap_wc() with ioremap_wc() in
wcss_sec_copy_segment().
- replaced rproc_alloc() and rproc_add() with their devres
counterparts.
- added mailbox call to tmelcom for secure image authentication
as required for IPQ5424. Added ipq5424 APCS comatible required.
- added changes to scm call to pass metadata size as equired for
IPQ5332.
changes in v2:
- Removed dependency of this series to q6 clock removal series
as recommended by Krzysztof
Gokul Sriram Palanisamy (3):
soc: qcom: smem: introduce qcom_smem_get_machid()
remoteproc: qcom: add support for Q6 device-tree loading
arm64: dts: qcom: ipq5424: add nodes to bring up q6
Manikanta Mylavarapu (4):
firmware: qcom_scm: ipq5332: add support to pass metadata size
dt-bindings: remoteproc: qcom: document hexagon based WCSS secure PIL
arm64: dts: qcom: ipq5332: add nodes to bringup q6
arm64: dts: qcom: ipq9574: add nodes to bring up q6
Vignesh Viswanathan (1):
remoteproc: qcom: add hexagon based WCSS secure PIL driver
.../remoteproc/qcom,wcss-sec-pil.yaml | 146 +++++
arch/arm64/boot/dts/qcom/ipq5332.dtsi | 71 ++-
arch/arm64/boot/dts/qcom/ipq5424.dtsi | 87 ++-
arch/arm64/boot/dts/qcom/ipq9574.dtsi | 61 +-
drivers/firmware/qcom/qcom_scm.c | 17 +-
drivers/firmware/qcom/qcom_scm.h | 1 +
drivers/remoteproc/Kconfig | 19 +
drivers/remoteproc/Makefile | 1 +
drivers/remoteproc/qcom_q6v5_wcss_sec.c | 526 ++++++++++++++++++
drivers/soc/qcom/smem.c | 26 +
include/linux/remoteproc.h | 2 +
include/linux/soc/qcom/smem.h | 1 +
12 files changed, 951 insertions(+), 7 deletions(-)
create mode 100644 Documentation/devicetree/bindings/remoteproc/qcom,wcss-sec-pil.yaml
create mode 100644 drivers/remoteproc/qcom_q6v5_wcss_sec.c
--
2.34.1
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH V4 1/8] firmware: qcom_scm: ipq5332: add support to pass metadata size
2025-04-03 12:02 [PATCH V4 0/8] Add new driver for WCSS secure PIL loading Gokul Sriram Palanisamy
@ 2025-04-03 12:02 ` Gokul Sriram Palanisamy
2025-04-04 22:41 ` Konrad Dybcio
2025-04-03 12:02 ` [PATCH V4 2/8] dt-bindings: remoteproc: qcom: document hexagon based WCSS secure PIL Gokul Sriram Palanisamy
` (8 subsequent siblings)
9 siblings, 1 reply; 20+ messages in thread
From: Gokul Sriram Palanisamy @ 2025-04-03 12:02 UTC (permalink / raw)
To: andersson, mathieu.poirier, robh, krzk+dt, conor+dt, konradybcio,
quic_mmanikan, linux-arm-msm, linux-remoteproc, devicetree
Cc: quic_srichara, vignesh.viswanathan, gokul.sriram.p
From: Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
IPQ5332 security software running under trustzone requires metadata size.
With new command support added in TrustZone that includes a size parameter,
pass metadata size as well.
Signed-off-by: Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
Signed-off-by: Gokul Sriram Palanisamy <gokul.sriram.p@oss.qualcomm.com>
---
drivers/firmware/qcom/qcom_scm.c | 17 +++++++++++++----
drivers/firmware/qcom/qcom_scm.h | 1 +
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c
index fc4d67e4c4a6..456e4de538b2 100644
--- a/drivers/firmware/qcom/qcom_scm.c
+++ b/drivers/firmware/qcom/qcom_scm.c
@@ -583,9 +583,6 @@ int qcom_scm_pas_init_image(u32 peripheral, const void *metadata, size_t size,
int ret;
struct qcom_scm_desc desc = {
.svc = QCOM_SCM_SVC_PIL,
- .cmd = QCOM_SCM_PIL_PAS_INIT_IMAGE,
- .arginfo = QCOM_SCM_ARGS(2, QCOM_SCM_VAL, QCOM_SCM_RW),
- .args[0] = peripheral,
.owner = ARM_SMCCC_OWNER_SIP,
};
struct qcom_scm_res res;
@@ -617,7 +614,19 @@ int qcom_scm_pas_init_image(u32 peripheral, const void *metadata, size_t size,
if (ret)
goto disable_clk;
- desc.args[1] = mdata_phys;
+ if (__qcom_scm_is_call_available(__scm->dev, QCOM_SCM_SVC_PIL,
+ QCOM_SCM_PIL_PAS_INIT_IMAGE_V2)) {
+ desc.cmd = QCOM_SCM_PIL_PAS_INIT_IMAGE_V2;
+ desc.arginfo = QCOM_SCM_ARGS(3, QCOM_SCM_VAL, QCOM_SCM_RW, QCOM_SCM_VAL);
+ desc.args[0] = peripheral;
+ desc.args[1] = mdata_phys;
+ desc.args[2] = size;
+ } else {
+ desc.cmd = QCOM_SCM_PIL_PAS_INIT_IMAGE;
+ desc.arginfo = QCOM_SCM_ARGS(2, QCOM_SCM_VAL, QCOM_SCM_RW);
+ desc.args[0] = peripheral;
+ desc.args[1] = mdata_phys;
+ }
ret = qcom_scm_call(__scm->dev, &desc, &res);
qcom_scm_bw_disable();
diff --git a/drivers/firmware/qcom/qcom_scm.h b/drivers/firmware/qcom/qcom_scm.h
index 097369d38b84..0f40e5828a67 100644
--- a/drivers/firmware/qcom/qcom_scm.h
+++ b/drivers/firmware/qcom/qcom_scm.h
@@ -96,6 +96,7 @@ struct qcom_tzmem_pool *qcom_scm_get_tzmem_pool(void);
#define QCOM_SCM_SVC_PIL 0x02
#define QCOM_SCM_PIL_PAS_INIT_IMAGE 0x01
+#define QCOM_SCM_PIL_PAS_INIT_IMAGE_V2 0x1a
#define QCOM_SCM_PIL_PAS_MEM_SETUP 0x02
#define QCOM_SCM_PIL_PAS_AUTH_AND_RESET 0x05
#define QCOM_SCM_PIL_PAS_SHUTDOWN 0x06
--
2.34.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH V4 2/8] dt-bindings: remoteproc: qcom: document hexagon based WCSS secure PIL
2025-04-03 12:02 [PATCH V4 0/8] Add new driver for WCSS secure PIL loading Gokul Sriram Palanisamy
2025-04-03 12:02 ` [PATCH V4 1/8] firmware: qcom_scm: ipq5332: add support to pass metadata size Gokul Sriram Palanisamy
@ 2025-04-03 12:02 ` Gokul Sriram Palanisamy
2025-04-03 14:21 ` Krzysztof Kozlowski
2025-04-03 12:02 ` [PATCH V4 3/8] remoteproc: qcom: add hexagon based WCSS secure PIL driver Gokul Sriram Palanisamy
` (7 subsequent siblings)
9 siblings, 1 reply; 20+ messages in thread
From: Gokul Sriram Palanisamy @ 2025-04-03 12:02 UTC (permalink / raw)
To: andersson, mathieu.poirier, robh, krzk+dt, conor+dt, konradybcio,
quic_mmanikan, linux-arm-msm, linux-remoteproc, devicetree
Cc: quic_srichara, vignesh.viswanathan, gokul.sriram.p
From: Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
Add new binding document for hexagon based WCSS secure PIL.
All IPQ SoCs use secure PIL.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
Signed-off-by: Gokul Sriram Palanisamy <gokul.sriram.p@oss.qualcomm.com>
---
.../remoteproc/qcom,wcss-sec-pil.yaml | 146 ++++++++++++++++++
1 file changed, 146 insertions(+)
create mode 100644 Documentation/devicetree/bindings/remoteproc/qcom,wcss-sec-pil.yaml
diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,wcss-sec-pil.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,wcss-sec-pil.yaml
new file mode 100644
index 000000000000..d427470f20fd
--- /dev/null
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,wcss-sec-pil.yaml
@@ -0,0 +1,146 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/remoteproc/qcom,wcss-sec-pil.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm WCSS Secure Peripheral Image Loader
+
+maintainers:
+ - Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
+
+description:
+ Wireless Connectivity Subsystem (WCSS) Secure Peripheral Image Loader loads
+ firmware and power up QDSP6 remoteproc on the Qualcomm IPQ series SoC.
+
+properties:
+ compatible:
+ enum:
+ - qcom,ipq5332-wcss-sec-pil
+ - qcom,ipq5424-wcss-sec-pil
+ - qcom,ipq9574-wcss-sec-pil
+
+ reg:
+ maxItems: 1
+
+ firmware-name:
+ items:
+ - description: Firmware name for the Hexagon core
+ - description: Firmware name for the Hexagon devicetree
+
+ interrupts:
+ items:
+ - description: Watchdog interrupt
+ - description: Fatal interrupt
+ - description: Ready interrupt
+ - description: Handover interrupt
+ - description: Stop acknowledge interrupt
+
+ interrupt-names:
+ items:
+ - const: wdog
+ - const: fatal
+ - const: ready
+ - const: handover
+ - const: stop-ack
+
+ clocks:
+ items:
+ - description: sleep clock
+
+ clock-names:
+ items:
+ - const: sleep
+
+ mboxes:
+ maxItems: 1
+ description: A phandle for the TMECom mailbox driver
+
+ qcom,smem-states:
+ $ref: /schemas/types.yaml#/definitions/phandle-array
+ description: States used by the AP to signal the remote processor
+ items:
+ - description: Stop Q6
+ - description: Shutdown Q6
+
+ qcom,smem-state-names:
+ description:
+ Names of the states used by the AP to signal the remote processor
+ items:
+ - const: stop
+ - const: shutdown
+
+ memory-region:
+ minItems: 1
+ items:
+ - description: Q6 reserved region
+ - description: Q6 dtb reserved region
+
+ qcom,q6-dtb-info:
+ $ref: /schemas/types.yaml#/definitions/phandle-array
+ items:
+ - items:
+ - description: phandle to TCSR hardware block
+ - description: TCSR offset to write lower-order 32-bit physical address of dtb
+ - description: TCSR offset to write higher-order 32-bit physical address of dtb
+ - description: TCSR offset to write board machid
+ description: Q6 device-tree information
+
+ glink-edge:
+ $ref: /schemas/remoteproc/qcom,glink-edge.yaml#
+ description:
+ Qualcomm G-Link subnode which represents communication edge, channels
+ and devices related to the Modem.
+ unevaluatedProperties: false
+
+required:
+ - compatible
+ - reg
+ - firmware-name
+ - interrupts
+ - interrupt-names
+ - qcom,smem-states
+ - qcom,smem-state-names
+ - memory-region
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/clock/qcom,ipq5332-gcc.h>
+ remoteproc@d100000 {
+ compatible = "qcom,ipq5332-wcss-sec-pil";
+ reg = <0xd100000 0x4040>;
+ firmware-name = "ath12k/IPQ5332/hw1.0/q6_fw.mbn",
+ "ath12k/IPQ5332/hw1.0/qdsp6sw_dtb.mbn";
+ interrupts-extended = <&intc GIC_SPI 291 IRQ_TYPE_EDGE_RISING>,
+ <&wcss_smp2p_in 0 IRQ_TYPE_NONE>,
+ <&wcss_smp2p_in 1 IRQ_TYPE_NONE>,
+ <&wcss_smp2p_in 2 IRQ_TYPE_NONE>,
+ <&wcss_smp2p_in 3 IRQ_TYPE_NONE>;
+ interrupt-names = "wdog",
+ "fatal",
+ "ready",
+ "handover",
+ "stop-ack";
+
+ clocks = <&gcc GCC_IM_SLEEP_CLK>;
+ clock-names = "sleep";
+
+ mboxes = <&tmel_qmp 0>;
+ qcom,smem-states = <&wcss_smp2p_out 1>,
+ <&wcss_smp2p_out 0>;
+ qcom,smem-state-names = "stop",
+ "shutdown";
+
+ memory-region = <&q6_region>, <&q6_dtb_region>;
+ qcom,q6-dtb-info = <&tcsr 0x1f004 0x1f008 0x1f00c>;
+
+ glink-edge {
+ interrupts = <GIC_SPI 417 IRQ_TYPE_EDGE_RISING>;
+ label = "rtr";
+ qcom,remote-pid = <1>;
+ mboxes = <&apcs_glb 8>;
+ };
+ };
--
2.34.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH V4 3/8] remoteproc: qcom: add hexagon based WCSS secure PIL driver
2025-04-03 12:02 [PATCH V4 0/8] Add new driver for WCSS secure PIL loading Gokul Sriram Palanisamy
2025-04-03 12:02 ` [PATCH V4 1/8] firmware: qcom_scm: ipq5332: add support to pass metadata size Gokul Sriram Palanisamy
2025-04-03 12:02 ` [PATCH V4 2/8] dt-bindings: remoteproc: qcom: document hexagon based WCSS secure PIL Gokul Sriram Palanisamy
@ 2025-04-03 12:02 ` Gokul Sriram Palanisamy
2025-04-03 12:03 ` [PATCH V4 4/8] soc: qcom: smem: introduce qcom_smem_get_machid() Gokul Sriram Palanisamy
` (6 subsequent siblings)
9 siblings, 0 replies; 20+ messages in thread
From: Gokul Sriram Palanisamy @ 2025-04-03 12:02 UTC (permalink / raw)
To: andersson, mathieu.poirier, robh, krzk+dt, conor+dt, konradybcio,
quic_mmanikan, linux-arm-msm, linux-remoteproc, devicetree
Cc: quic_srichara, vignesh.viswanathan, gokul.sriram.p
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. This change also introduces secure firmware
authentication using Trusted Management Engine-Lite (TME-L) which is
supported on IPQ5424 SoC. This driver uses mailbox based PAS request to
TME-L for image authentication if supported, else it will fallback to use
SCM call based PAS request to TZ.
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>
---
drivers/remoteproc/Kconfig | 19 ++
drivers/remoteproc/Makefile | 1 +
drivers/remoteproc/qcom_q6v5_wcss_sec.c | 399 ++++++++++++++++++++++++
include/linux/remoteproc.h | 2 +
4 files changed, 421 insertions(+)
create mode 100644 drivers/remoteproc/qcom_q6v5_wcss_sec.c
diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig
index 83962a114dc9..656cbb12b54d 100644
--- a/drivers/remoteproc/Kconfig
+++ b/drivers/remoteproc/Kconfig
@@ -255,6 +255,25 @@ config QCOM_Q6V5_WCSS
Hexagon V5 based WCSS remote processors on e.g. IPQ8074. This is
a non-TrustZone wireless subsystem.
+config QCOM_Q6V5_WCSS_SEC
+ tristate "Qualcomm Hexagon based WCSS Secure Peripheral Image Loader"
+ depends on OF && ARCH_QCOM
+ depends on QCOM_SMEM
+ depends on RPMSG_QCOM_GLINK_SMEM || RPMSG_QCOM_GLINK_SMEM=n
+ depends on RPMSG_QCOM_GLINK || RPMSG_QCOM_GLINK=n
+ select QCOM_MDT_LOADER
+ select QCOM_PIL_INFO
+ select QCOM_Q6V5_COMMON
+ select QCOM_RPROC_COMMON
+ select QCOM_SCM
+ help
+ Say y here to support the Qualcomm Secure Peripheral Image Loader
+ for the Hexagon based remote processors on e.g. IPQ5332.
+
+ This is TrustZone wireless subsystem. The firmware is
+ verified and booted with the help of the Peripheral Authentication
+ System (PAS) in TrustZone.
+
config QCOM_SYSMON
tristate "Qualcomm sysmon driver"
depends on RPMSG
diff --git a/drivers/remoteproc/Makefile b/drivers/remoteproc/Makefile
index 5ff4e2fee4ab..d4971b672812 100644
--- a/drivers/remoteproc/Makefile
+++ b/drivers/remoteproc/Makefile
@@ -28,6 +28,7 @@ obj-$(CONFIG_QCOM_Q6V5_ADSP) += qcom_q6v5_adsp.o
obj-$(CONFIG_QCOM_Q6V5_MSS) += qcom_q6v5_mss.o
obj-$(CONFIG_QCOM_Q6V5_PAS) += qcom_q6v5_pas.o
obj-$(CONFIG_QCOM_Q6V5_WCSS) += qcom_q6v5_wcss.o
+obj-$(CONFIG_QCOM_Q6V5_WCSS_SEC) += qcom_q6v5_wcss_sec.o
obj-$(CONFIG_QCOM_SYSMON) += qcom_sysmon.o
obj-$(CONFIG_QCOM_WCNSS_PIL) += qcom_wcnss_pil.o
qcom_wcnss_pil-y += qcom_wcnss.o
diff --git a/drivers/remoteproc/qcom_q6v5_wcss_sec.c b/drivers/remoteproc/qcom_q6v5_wcss_sec.c
new file mode 100644
index 000000000000..30422c6c982d
--- /dev/null
+++ b/drivers/remoteproc/qcom_q6v5_wcss_sec.c
@@ -0,0 +1,399 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2016-2018 Linaro Ltd.
+ * Copyright (C) 2014 Sony Mobile Communications AB
+ * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2024-2025 Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+#include <linux/clk.h>
+#include <linux/firmware/qcom/qcom_scm.h>
+#include <linux/io.h>
+#include <linux/mailbox_client.h>
+#include <linux/mailbox/tmelcom-qmp.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;
+};
+
+struct wcss_data {
+ u32 pasid;
+ const char *ss_name;
+ bool auto_boot;
+ bool tmelcom;
+};
+
+static int wcss_sec_start(struct rproc *rproc)
+{
+ struct wcss_sec *wcss = rproc->priv;
+ struct device *dev = wcss->dev;
+ int ret;
+
+ ret = qcom_q6v5_prepare(&wcss->q6);
+ if (ret)
+ return ret;
+
+ if (!IS_ERR_OR_NULL(wcss->mbox_chan)) {
+ struct tmel_sec_auth tsa;
+ struct tmel_qmp_msg tqm;
+
+ tsa.data = wcss->metadata;
+ tsa.size = wcss->metadata_len;
+ tsa.pas_id = wcss->desc->pasid;
+ tqm.msg = &tsa;
+ tqm.msg_id = TMEL_MSG_UID_SECBOOT_SEC_AUTH;
+
+ ret = mbox_send_message(wcss->mbox_chan, (void *)&tqm);
+ if (ret < 0) {
+ dev_err(dev, "Failed to send message via mailbox\n");
+ goto unprepare;
+ }
+ } else {
+ ret = qcom_scm_pas_auth_and_reset(wcss->desc->pasid);
+ if (ret) {
+ dev_err(dev, "wcss_reset failed\n");
+ goto unprepare;
+ }
+ }
+
+ ret = qcom_q6v5_wait_for_start(&wcss->q6, Q6_WAIT_TIMEOUT);
+ if (ret == -ETIMEDOUT)
+ dev_err(dev, "start timed out\n");
+
+unprepare:
+ qcom_q6v5_unprepare(&wcss->q6);
+
+ return ret;
+}
+
+static int wcss_sec_stop(struct rproc *rproc)
+{
+ struct wcss_sec *wcss = rproc->priv;
+ struct device *dev = wcss->dev;
+ int ret;
+
+ if (!IS_ERR_OR_NULL(wcss->mbox_chan)) {
+ struct tmel_sec_auth tsa = {0};
+ struct tmel_qmp_msg tqm;
+
+ tsa.pas_id = wcss->desc->pasid;
+ tqm.msg = &tsa;
+ tqm.msg_id = TMEL_MSG_UID_SECBOOT_SS_TEAR_DOWN;
+
+ mbox_send_message(wcss->mbox_chan, (void *)&tqm);
+ } else {
+ ret = qcom_scm_pas_shutdown(wcss->desc->pasid);
+ if (ret) {
+ dev_err(dev, "not able to shutdown\n");
+ return ret;
+ }
+ }
+
+ qcom_q6v5_unprepare(&wcss->q6);
+
+ return 0;
+}
+
+static void *wcss_sec_da_to_va(struct rproc *rproc, u64 da, size_t len,
+ bool *is_iomem)
+{
+ struct wcss_sec *wcss = rproc->priv;
+ int offset;
+
+ offset = da - wcss->mem_reloc;
+ if (offset < 0 || offset + len > wcss->mem_size)
+ return NULL;
+
+ return wcss->mem_region + offset;
+}
+
+static int wcss_sec_load(struct rproc *rproc, const struct firmware *fw)
+{
+ struct wcss_sec *wcss = rproc->priv;
+ struct device *dev = wcss->dev;
+ int ret;
+
+ if (!IS_ERR_OR_NULL(wcss->mbox_chan)) {
+ wcss->metadata = qcom_mdt_read_metadata(fw, &wcss->metadata_len,
+ rproc->firmware, wcss->dev);
+ if (IS_ERR(wcss->metadata)) {
+ ret = PTR_ERR(wcss->metadata);
+ dev_err(wcss->dev, "error %d reading firmware %s metadata\n",
+ ret, rproc->firmware);
+ return ret;
+ }
+
+ ret = qcom_mdt_load_no_init(wcss->dev, fw, rproc->firmware, wcss->desc->pasid,
+ wcss->mem_region, wcss->mem_phys, wcss->mem_size,
+ &wcss->mem_reloc);
+ if (ret) {
+ kfree(wcss->metadata);
+ return ret;
+ }
+ } else {
+ ret = qcom_mdt_load(dev, fw, rproc->firmware, wcss->desc->pasid, wcss->mem_region,
+ wcss->mem_phys, wcss->mem_size, &wcss->mem_reloc);
+ if (ret)
+ return ret;
+ }
+
+ qcom_pil_info_store("wcss", wcss->mem_phys, wcss->mem_size);
+
+ return 0;
+}
+
+static unsigned long wcss_sec_panic(struct rproc *rproc)
+{
+ struct wcss_sec *wcss = rproc->priv;
+
+ return qcom_q6v5_panic(&wcss->q6);
+}
+
+static void wcss_sec_copy_segment(struct rproc *rproc,
+ struct rproc_dump_segment *segment,
+ void *dest, size_t offset, size_t size)
+{
+ struct wcss_sec *wcss = rproc->priv;
+ struct device *dev = wcss->dev;
+
+ if (!segment->io_ptr)
+ segment->io_ptr = ioremap_wc(segment->da, segment->size);
+
+ if (!segment->io_ptr) {
+ dev_err(dev, "Failed to ioremap segment %pad size 0x%zx\n",
+ &segment->da, segment->size);
+ return;
+ }
+
+ if (offset + size <= segment->size) {
+ memcpy(dest, segment->io_ptr + offset, size);
+ } else {
+ iounmap(segment->io_ptr);
+ segment->io_ptr = NULL;
+ }
+}
+
+static int wcss_sec_dump_segments(struct rproc *rproc,
+ const struct firmware *fw)
+{
+ struct device *dev = rproc->dev.parent;
+ struct reserved_mem *rmem = NULL;
+ struct device_node *node;
+ int num_segs, index;
+ int ret;
+
+ /*
+ * Parse through additional reserved memory regions for the rproc
+ * and add them to the coredump segments
+ */
+ num_segs = of_count_phandle_with_args(dev->of_node,
+ "memory-region", NULL);
+ for (index = 0; index < num_segs; index++) {
+ node = of_parse_phandle(dev->of_node,
+ "memory-region", index);
+ if (!node)
+ return -EINVAL;
+
+ rmem = of_reserved_mem_lookup(node);
+ of_node_put(node);
+ if (!rmem) {
+ dev_err(dev, "unable to acquire memory-region index %d num_segs %d\n",
+ index, num_segs);
+ return -EINVAL;
+ }
+
+ dev_dbg(dev, "Adding segment 0x%pa size 0x%pa",
+ &rmem->base, &rmem->size);
+ ret = rproc_coredump_add_custom_segment(rproc,
+ rmem->base,
+ rmem->size,
+ wcss_sec_copy_segment,
+ NULL);
+ if (ret)
+ return ret;
+ }
+
+ return 0;
+}
+
+static const struct rproc_ops wcss_sec_ops = {
+ .start = wcss_sec_start,
+ .stop = wcss_sec_stop,
+ .da_to_va = wcss_sec_da_to_va,
+ .load = wcss_sec_load,
+ .get_boot_addr = rproc_elf_get_boot_addr,
+ .panic = wcss_sec_panic,
+ .parse_fw = wcss_sec_dump_segments,
+};
+
+static int wcss_sec_alloc_memory_region(struct wcss_sec *wcss)
+{
+ struct reserved_mem *rmem = NULL;
+ struct device_node *node;
+ struct device *dev = wcss->dev;
+
+ node = of_parse_phandle(dev->of_node, "memory-region", 0);
+ if (!node) {
+ dev_err(dev, "can't find phandle memory-region\n");
+ return -EINVAL;
+ }
+
+ rmem = of_reserved_mem_lookup(node);
+ of_node_put(node);
+
+ if (!rmem) {
+ dev_err(dev, "unable to acquire memory-region\n");
+ return -EINVAL;
+ }
+
+ wcss->mem_phys = rmem->base;
+ wcss->mem_reloc = rmem->base;
+ wcss->mem_size = rmem->size;
+ wcss->mem_region = devm_ioremap_wc(dev, wcss->mem_phys, wcss->mem_size);
+ if (!wcss->mem_region) {
+ dev_err(dev, "unable to map memory region: %pa+%pa\n",
+ &rmem->base, &rmem->size);
+ return -ENOMEM;
+ }
+
+ return 0;
+}
+
+static int wcss_sec_probe(struct platform_device *pdev)
+{
+ struct rproc *rproc;
+ struct wcss_sec *wcss;
+ struct clk *sleep_clk;
+ const char *fw_name = NULL;
+ const struct wcss_data *desc = of_device_get_match_data(&pdev->dev);
+ 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");
+
+ 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);
+
+ if (desc->tmelcom) {
+ wcss->mbox_client.dev = wcss->dev;
+ wcss->mbox_client.knows_txdone = true;
+ wcss->mbox_client.tx_block = true;
+ wcss->mbox_chan = mbox_request_channel(&wcss->mbox_client, 0);
+ if (IS_ERR(wcss->mbox_chan))
+ return dev_err_probe(wcss->dev, PTR_ERR(wcss->mbox_chan),
+ "mbox chan for IPC is missing\n");
+ }
+
+ ret = devm_rproc_add(&pdev->dev, rproc);
+ if (ret)
+ 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_ipq5424_res_init = {
+ .pasid = MPD_WCSS_PAS_ID,
+ .ss_name = "q6wcss",
+ .tmelcom = true,
+};
+
+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,ipq5332-wcss-sec-pil", .data = &wcss_sec_ipq5332_res_init },
+ { .compatible = "qcom,ipq5424-wcss-sec-pil", .data = &wcss_sec_ipq5424_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);
--
2.34.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH V4 4/8] soc: qcom: smem: introduce qcom_smem_get_machid()
2025-04-03 12:02 [PATCH V4 0/8] Add new driver for WCSS secure PIL loading Gokul Sriram Palanisamy
` (2 preceding siblings ...)
2025-04-03 12:02 ` [PATCH V4 3/8] remoteproc: qcom: add hexagon based WCSS secure PIL driver Gokul Sriram Palanisamy
@ 2025-04-03 12:03 ` Gokul Sriram Palanisamy
2025-04-04 22:45 ` Konrad Dybcio
2025-04-03 12:03 ` [PATCH V4 5/8] remoteproc: qcom: add support for Q6 device-tree loading Gokul Sriram Palanisamy
` (5 subsequent siblings)
9 siblings, 1 reply; 20+ messages in thread
From: Gokul Sriram Palanisamy @ 2025-04-03 12:03 UTC (permalink / raw)
To: andersson, mathieu.poirier, robh, krzk+dt, conor+dt, konradybcio,
quic_mmanikan, linux-arm-msm, linux-remoteproc, devicetree
Cc: quic_srichara, vignesh.viswanathan, gokul.sriram.p
Introduce a helper to return the machid which is used to identify the
specific board variant derived from the same SoC.
Signed-off-by: Gokul Sriram Palanisamy <gokul.sriram.p@oss.qualcomm.com>
---
drivers/soc/qcom/smem.c | 26 ++++++++++++++++++++++++++
include/linux/soc/qcom/smem.h | 1 +
2 files changed, 27 insertions(+)
diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c
index 592819701809..327f7358191d 100644
--- a/drivers/soc/qcom/smem.c
+++ b/drivers/soc/qcom/smem.c
@@ -827,6 +827,32 @@ int qcom_smem_get_soc_id(u32 *id)
}
EXPORT_SYMBOL_GPL(qcom_smem_get_soc_id);
+/**
+ * qcom_smem_get_machid() - return the machid
+ * @id: On success, we return the machid here.
+ *
+ * generate machid from HW/SW build ID and return it.
+ *
+ * Return: 0 on success, negative errno on failure.
+ */
+
+int qcom_smem_get_machid(u32 *id)
+{
+ struct socinfo *info;
+
+ info = qcom_smem_get(QCOM_SMEM_HOST_ANY, SMEM_HW_SW_BUILD_ID, NULL);
+ if (IS_ERR(info))
+ return PTR_ERR(info);
+
+ *id = ((info->hw_plat << 24) |
+ (((info->plat_ver & 0xffff0000) >> 16) << 16) |
+ ((info->plat_ver & 0x0000ffff) << 8) |
+ (info->hw_plat_subtype));
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(qcom_smem_get_machid);
+
/**
* qcom_smem_get_feature_code() - return the feature code
* @code: On success, return the feature code here.
diff --git a/include/linux/soc/qcom/smem.h b/include/linux/soc/qcom/smem.h
index f946e3beca21..82f2e6df7853 100644
--- a/include/linux/soc/qcom/smem.h
+++ b/include/linux/soc/qcom/smem.h
@@ -13,6 +13,7 @@ int qcom_smem_get_free_space(unsigned host);
phys_addr_t qcom_smem_virt_to_phys(void *p);
int qcom_smem_get_soc_id(u32 *id);
+int qcom_smem_get_machid(u32 *id);
int qcom_smem_get_feature_code(u32 *code);
int qcom_smem_bust_hwspin_lock_by_host(unsigned int host);
--
2.34.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH V4 5/8] remoteproc: qcom: add support for Q6 device-tree loading
2025-04-03 12:02 [PATCH V4 0/8] Add new driver for WCSS secure PIL loading Gokul Sriram Palanisamy
` (3 preceding siblings ...)
2025-04-03 12:03 ` [PATCH V4 4/8] soc: qcom: smem: introduce qcom_smem_get_machid() Gokul Sriram Palanisamy
@ 2025-04-03 12:03 ` Gokul Sriram Palanisamy
2025-04-03 12:03 ` [PATCH V4 6/8] arm64: dts: qcom: ipq5332: add nodes to bringup q6 Gokul Sriram Palanisamy
` (4 subsequent siblings)
9 siblings, 0 replies; 20+ messages in thread
From: Gokul Sriram Palanisamy @ 2025-04-03 12:03 UTC (permalink / raw)
To: andersson, mathieu.poirier, robh, krzk+dt, conor+dt, konradybcio,
quic_mmanikan, linux-arm-msm, linux-remoteproc, devicetree
Cc: quic_srichara, vignesh.viswanathan, gokul.sriram.p
In IPQ5332 and IPQ5424 SoCs, Q6 requires separate device-tree.
Signed-off-by: Gokul Sriram Palanisamy <gokul.sriram.p@oss.qualcomm.com>
---
drivers/remoteproc/qcom_q6v5_wcss_sec.c | 147 ++++++++++++++++++++++--
1 file changed, 137 insertions(+), 10 deletions(-)
diff --git a/drivers/remoteproc/qcom_q6v5_wcss_sec.c b/drivers/remoteproc/qcom_q6v5_wcss_sec.c
index 30422c6c982d..e4cc7caebd7c 100644
--- a/drivers/remoteproc/qcom_q6v5_wcss_sec.c
+++ b/drivers/remoteproc/qcom_q6v5_wcss_sec.c
@@ -10,9 +10,12 @@
#include <linux/io.h>
#include <linux/mailbox_client.h>
#include <linux/mailbox/tmelcom-qmp.h>
+#include <linux/mfd/syscon.h>
#include <linux/of_reserved_mem.h>
#include <linux/platform_device.h>
+#include <linux/regmap.h>
#include <linux/soc/qcom/mdt_loader.h>
+#include <linux/soc/qcom/smem.h>
#include "qcom_common.h"
#include "qcom_q6v5.h"
@@ -34,6 +37,18 @@ struct wcss_sec {
phys_addr_t mem_reloc;
void *mem_region;
size_t mem_size;
+
+ const char *dtb_firmware_name;
+ const struct firmware *dtb_firmware;
+ phys_addr_t dtb_mem_phys;
+ phys_addr_t dtb_mem_reloc;
+ void *dtb_mem_region;
+ size_t dtb_mem_size;
+ struct regmap *tcsr_map;
+ u32 dtb_low_offset;
+ u32 dtb_high_offset;
+ u32 machid_offset;
+
const struct wcss_data *desc;
struct mbox_client mbox_client;
@@ -46,6 +61,7 @@ struct wcss_data {
u32 pasid;
const char *ss_name;
bool auto_boot;
+ const char *dtb_firmware_name;
bool tmelcom;
};
@@ -137,8 +153,45 @@ static int wcss_sec_load(struct rproc *rproc, const struct firmware *fw)
{
struct wcss_sec *wcss = rproc->priv;
struct device *dev = wcss->dev;
+ u32 machid;
int ret;
+ if (wcss->dtb_firmware_name) {
+ ret = request_firmware(&wcss->dtb_firmware, wcss->dtb_firmware_name, wcss->dev);
+ if (ret) {
+ dev_err(wcss->dev, "request_firmware failed for %s: %d\n",
+ wcss->dtb_firmware_name, ret);
+ return ret;
+ }
+
+ ret = qcom_mdt_load_no_init(wcss->dev, wcss->dtb_firmware,
+ wcss->dtb_firmware_name, 0, wcss->dtb_mem_region,
+ wcss->dtb_mem_phys, wcss->dtb_mem_size,
+ &wcss->dtb_mem_reloc);
+ if (ret)
+ goto release_dtb_firmware;
+
+ ret = qcom_smem_get_machid(&machid);
+ if (ret) {
+ pr_err("machid get failed, ret = %d\n", ret);
+ goto release_dtb_firmware;
+ }
+
+ ret = regmap_write(wcss->tcsr_map, wcss->dtb_low_offset,
+ wcss->dtb_mem_phys & 0xFFFFFFFF);
+ if (ret)
+ goto release_dtb_firmware;
+
+ ret = regmap_write(wcss->tcsr_map, wcss->dtb_high_offset,
+ wcss->dtb_mem_phys & (0xFFFFFFFF << 31));
+ if (ret)
+ goto release_dtb_firmware;
+
+ ret = regmap_write(wcss->tcsr_map, wcss->machid_offset, machid);
+ if (ret)
+ goto release_dtb_firmware;
+ }
+
if (!IS_ERR_OR_NULL(wcss->mbox_chan)) {
wcss->metadata = qcom_mdt_read_metadata(fw, &wcss->metadata_len,
rproc->firmware, wcss->dev);
@@ -146,26 +199,33 @@ static int wcss_sec_load(struct rproc *rproc, const struct firmware *fw)
ret = PTR_ERR(wcss->metadata);
dev_err(wcss->dev, "error %d reading firmware %s metadata\n",
ret, rproc->firmware);
- return ret;
+ goto release_dtb_firmware;
}
ret = qcom_mdt_load_no_init(wcss->dev, fw, rproc->firmware, wcss->desc->pasid,
wcss->mem_region, wcss->mem_phys, wcss->mem_size,
&wcss->mem_reloc);
- if (ret) {
- kfree(wcss->metadata);
- return ret;
- }
+ if (ret)
+ goto release_metadata;
} else {
ret = qcom_mdt_load(dev, fw, rproc->firmware, wcss->desc->pasid, wcss->mem_region,
wcss->mem_phys, wcss->mem_size, &wcss->mem_reloc);
if (ret)
- return ret;
+ goto release_dtb_firmware;
}
qcom_pil_info_store("wcss", wcss->mem_phys, wcss->mem_size);
return 0;
+
+release_metadata:
+ if (!IS_ERR_OR_NULL(wcss->mbox_chan))
+ kfree(wcss->metadata);
+release_dtb_firmware:
+ if (wcss->dtb_firmware_name)
+ release_firmware(wcss->dtb_firmware);
+
+ return ret;
}
static unsigned long wcss_sec_panic(struct rproc *rproc)
@@ -282,6 +342,33 @@ static int wcss_sec_alloc_memory_region(struct wcss_sec *wcss)
return -ENOMEM;
}
+ if (!wcss->dtb_firmware_name)
+ return 0;
+
+ node = of_parse_phandle(dev->of_node, "memory-region", 1);
+ if (!node) {
+ dev_err(dev, "can't find dtb memory-region\n");
+ return -EINVAL;
+ }
+
+ rmem = of_reserved_mem_lookup(node);
+ of_node_put(node);
+
+ if (!rmem) {
+ dev_err(dev, "unable to resolve dtb memory-region\n");
+ return -EINVAL;
+ }
+
+ wcss->dtb_mem_phys = rmem->base;
+ wcss->dtb_mem_reloc = rmem->base;
+ wcss->dtb_mem_size = rmem->size;
+ wcss->dtb_mem_region = devm_ioremap_wc(dev, wcss->dtb_mem_phys, wcss->dtb_mem_size);
+ if (!wcss->dtb_mem_region) {
+ dev_err(dev, "unable to map dtb memory region: %pa+%pa\n",
+ &rmem->base, &rmem->size);
+ return -ENOMEM;
+ }
+
return 0;
}
@@ -291,6 +378,9 @@ static int wcss_sec_probe(struct platform_device *pdev)
struct wcss_sec *wcss;
struct clk *sleep_clk;
const char *fw_name = NULL;
+ const char *dtb_fw_name = NULL;
+ struct of_phandle_args args;
+ int args_cell_cnt = 3;
const struct wcss_data *desc = of_device_get_match_data(&pdev->dev);
int ret;
@@ -310,6 +400,33 @@ static int wcss_sec_probe(struct platform_device *pdev)
wcss->dev = &pdev->dev;
wcss->desc = desc;
+ if (desc->dtb_firmware_name) {
+ ret = of_property_read_string_index(pdev->dev.of_node, "firmware-name",
+ 1, &dtb_fw_name);
+ if (ret < 0)
+ return ret;
+
+ if (dtb_fw_name)
+ wcss->dtb_firmware_name = dtb_fw_name;
+
+ ret = of_parse_phandle_with_fixed_args(pdev->dev.of_node, "qcom,q6-dtb-info",
+ args_cell_cnt, 0, &args);
+ if (ret < 0) {
+ dev_err(&pdev->dev, "failed to parse qcom,q6-dtb-info\n");
+ return ret;
+ }
+
+ wcss->tcsr_map = syscon_node_to_regmap(args.np);
+ of_node_put(args.np);
+ if (IS_ERR(wcss->tcsr_map))
+ return dev_err_probe(&pdev->dev, PTR_ERR(wcss->tcsr_map),
+ "unable to get syscon regmap\n");
+
+ wcss->dtb_low_offset = args.args[0];
+ wcss->dtb_high_offset = args.args[1];
+ wcss->machid_offset = args.args[2];
+ }
+
ret = wcss_sec_alloc_memory_region(wcss);
if (ret)
return ret;
@@ -336,18 +453,26 @@ static int wcss_sec_probe(struct platform_device *pdev)
wcss->mbox_client.knows_txdone = true;
wcss->mbox_client.tx_block = true;
wcss->mbox_chan = mbox_request_channel(&wcss->mbox_client, 0);
- if (IS_ERR(wcss->mbox_chan))
- return dev_err_probe(wcss->dev, PTR_ERR(wcss->mbox_chan),
- "mbox chan for IPC is missing\n");
+ if (IS_ERR(wcss->mbox_chan)) {
+ ret = dev_err_probe(&pdev->dev, PTR_ERR(wcss->mbox_chan),
+ "mbox chan for IPC is missing\n");
+ goto remove_subdevs;
+ }
}
ret = devm_rproc_add(&pdev->dev, rproc);
if (ret)
- return ret;
+ goto remove_subdevs;
platform_set_drvdata(pdev, rproc);
return 0;
+
+remove_subdevs:
+ qcom_remove_glink_subdev(rproc, &wcss->glink_subdev);
+ qcom_remove_ssr_subdev(rproc, &wcss->ssr_subdev);
+
+ return ret;
}
static void wcss_sec_remove(struct platform_device *pdev)
@@ -364,11 +489,13 @@ static void wcss_sec_remove(struct platform_device *pdev)
static const struct wcss_data wcss_sec_ipq5332_res_init = {
.pasid = MPD_WCSS_PAS_ID,
.ss_name = "q6wcss",
+ .dtb_firmware_name = "qdsp6sw_dtb.mbn",
};
static const struct wcss_data wcss_sec_ipq5424_res_init = {
.pasid = MPD_WCSS_PAS_ID,
.ss_name = "q6wcss",
+ .dtb_firmware_name = "qdsp6sw_dtb.mbn",
.tmelcom = true,
};
--
2.34.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH V4 6/8] arm64: dts: qcom: ipq5332: add nodes to bringup q6
2025-04-03 12:02 [PATCH V4 0/8] Add new driver for WCSS secure PIL loading Gokul Sriram Palanisamy
` (4 preceding siblings ...)
2025-04-03 12:03 ` [PATCH V4 5/8] remoteproc: qcom: add support for Q6 device-tree loading Gokul Sriram Palanisamy
@ 2025-04-03 12:03 ` Gokul Sriram Palanisamy
2025-04-03 12:03 ` [PATCH V4 7/8] arm64: dts: qcom: ipq5424: add nodes to bring up q6 Gokul Sriram Palanisamy
` (3 subsequent siblings)
9 siblings, 0 replies; 20+ messages in thread
From: Gokul Sriram Palanisamy @ 2025-04-03 12:03 UTC (permalink / raw)
To: andersson, mathieu.poirier, robh, krzk+dt, conor+dt, konradybcio,
quic_mmanikan, linux-arm-msm, linux-remoteproc, devicetree
Cc: quic_srichara, vignesh.viswanathan, gokul.sriram.p
From: Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
Enable nodes required for q6 remoteproc bring up.
Signed-off-by: Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
Signed-off-by: Gokul Sriram Palanisamy <gokul.sriram.p@oss.qualcomm.com>
---
arch/arm64/boot/dts/qcom/ipq5332.dtsi | 71 ++++++++++++++++++++++++++-
1 file changed, 70 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/qcom/ipq5332.dtsi b/arch/arm64/boot/dts/qcom/ipq5332.dtsi
index 69dda757925d..af0de072abd2 100644
--- a/arch/arm64/boot/dts/qcom/ipq5332.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq5332.dtsi
@@ -2,7 +2,7 @@
/*
* IPQ5332 device tree source
*
- * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2025 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <dt-bindings/clock/qcom,apss-ipq.h>
@@ -146,6 +146,16 @@ smem@4a800000 {
hwlocks = <&tcsr_mutex 3>;
};
+
+ q6_region: wcss@4a900000 {
+ reg = <0x0 0x4a900000 0x0 0x2b00000>;
+ no-map;
+ };
+
+ q6_dtb_region: wcss-dtb@4d400000 {
+ reg = <0x0 0x4d400000 0x0 0x2000>;
+ no-map;
+ };
};
soc@0 {
@@ -545,6 +555,41 @@ frame@b128000 {
status = "disabled";
};
};
+
+ q6v5_wcss: remoteproc@d100000 {
+ compatible = "qcom,ipq5332-wcss-sec-pil";
+ reg = <0x0d100000 0x4040>;
+ firmware-name = "ath12k/IPQ5332/hw1.0/q6_fw0.mbn",
+ "ath12k/IPQ5332/hw1.0/qdsp6sw_dtb.mbn";
+ interrupts-extended = <&intc GIC_SPI 421 IRQ_TYPE_EDGE_RISING>,
+ <&smp2p_wcss_in 0 IRQ_TYPE_NONE>,
+ <&smp2p_wcss_in 1 IRQ_TYPE_NONE>,
+ <&smp2p_wcss_in 2 IRQ_TYPE_NONE>,
+ <&smp2p_wcss_in 3 IRQ_TYPE_NONE>;
+ interrupt-names = "wdog",
+ "fatal",
+ "ready",
+ "handover",
+ "stop-ack";
+
+ clocks = <&gcc GCC_IM_SLEEP_CLK>;
+ clock-names = "sleep";
+
+ qcom,smem-states = <&smp2p_wcss_out 1>,
+ <&smp2p_wcss_out 0>;
+ qcom,smem-state-names = "stop",
+ "shutdown";
+
+ memory-region = <&q6_region>, <&q6_dtb_region>;
+ qcom,q6-dtb-info = <&tcsr 0x1f004 0x1f008 0x1f00c>;
+
+ glink-edge {
+ interrupts = <GIC_SPI 417 IRQ_TYPE_EDGE_RISING>;
+ label = "rtr";
+ qcom,remote-pid = <1>;
+ mboxes = <&apcs_glb 8>;
+ };
+ };
};
thermal-zones {
@@ -623,4 +668,28 @@ timer {
<GIC_PPI 4 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
<GIC_PPI 1 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
};
+
+ wcss: smp2p-wcss {
+ compatible = "qcom,smp2p";
+ qcom,smem = <435>, <428>;
+
+ interrupt-parent = <&intc>;
+ interrupts = <GIC_SPI 418 IRQ_TYPE_EDGE_RISING>;
+
+ mboxes = <&apcs_glb 9>;
+
+ qcom,local-pid = <0>;
+ qcom,remote-pid = <1>;
+
+ smp2p_wcss_out: master-kernel {
+ qcom,entry-name = "master-kernel";
+ #qcom,smem-state-cells = <1>;
+ };
+
+ smp2p_wcss_in: slave-kernel {
+ qcom,entry-name = "slave-kernel";
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ };
+ };
};
--
2.34.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH V4 7/8] arm64: dts: qcom: ipq5424: add nodes to bring up q6
2025-04-03 12:02 [PATCH V4 0/8] Add new driver for WCSS secure PIL loading Gokul Sriram Palanisamy
` (5 preceding siblings ...)
2025-04-03 12:03 ` [PATCH V4 6/8] arm64: dts: qcom: ipq5332: add nodes to bringup q6 Gokul Sriram Palanisamy
@ 2025-04-03 12:03 ` Gokul Sriram Palanisamy
2025-04-03 14:23 ` Krzysztof Kozlowski
2025-04-03 12:03 ` [PATCH V4 8/8] arm64: dts: qcom: ipq9574: " Gokul Sriram Palanisamy
` (2 subsequent siblings)
9 siblings, 1 reply; 20+ messages in thread
From: Gokul Sriram Palanisamy @ 2025-04-03 12:03 UTC (permalink / raw)
To: andersson, mathieu.poirier, robh, krzk+dt, conor+dt, konradybcio,
quic_mmanikan, linux-arm-msm, linux-remoteproc, devicetree
Cc: quic_srichara, vignesh.viswanathan, gokul.sriram.p
Enable nodes required for q6 remoteproc bring up.
Signed-off-by: Gokul Sriram Palanisamy <gokul.sriram.p@oss.qualcomm.com>
---
arch/arm64/boot/dts/qcom/ipq5424.dtsi | 87 ++++++++++++++++++++++++++-
1 file changed, 86 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/qcom/ipq5424.dtsi b/arch/arm64/boot/dts/qcom/ipq5424.dtsi
index 5d6ed2172b1b..26c297ffb602 100644
--- a/arch/arm64/boot/dts/qcom/ipq5424.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq5424.dtsi
@@ -3,7 +3,7 @@
* IPQ5424 device tree source
*
* Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2025 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <dt-bindings/interrupt-controller/arm-gic.h>
@@ -149,6 +149,16 @@ smem@8a800000 {
hwlocks = <&tcsr_mutex 3>;
};
+
+ q6_region: wcss@8a900000 {
+ reg = <0x0 0x8a900000 0x0 0x2800000>;
+ no-map;
+ };
+
+ q6_dtb_region: wcss-dtb@8d100000 {
+ reg = <0x0 0x8d100000 0x0 0x2000>;
+ no-map;
+ };
};
soc@0 {
@@ -541,6 +551,57 @@ dwc_0: usb@8a00000 {
};
};
+ apcs_glb: mailbox@f400004 {
+ compatible = "qcom,ipq5424-apcs-apps-global",
+ "qcom,ipq6018-apcs-apps-global";
+ reg = <0 0xf400004 0 0x6000>;
+ #clock-cells = <1>;
+ #mbox-cells = <1>;
+ };
+
+ tmel_qmp: qmp@32090000 {
+ compatible = "qcom,ipq5424-tmel";
+ reg = <0 0x32090000 0 0x2000>;
+ interrupts = <GIC_SPI 126 IRQ_TYPE_EDGE_RISING>;
+ mboxes = <&apcs_glb 20>;
+ #mbox-cells = <1>;
+ };
+
+ q6v5_wcss: remoteproc@d100000 {
+ compatible = "qcom,ipq5424-wcss-sec-pil";
+ reg = <0 0x0d100000 0 0x4040>;
+ firmware-name = "ath12k/IPQ5424/hw1.0/q6_fw0.mbn",
+ "ath12k/IPQ5424/hw1.0/qdsp6sw_dtb.mbn";
+ interrupts-extended = <&intc GIC_SPI 508 IRQ_TYPE_EDGE_RISING>,
+ <&smp2p_wcss_in 0 0>,
+ <&smp2p_wcss_in 1 0>,
+ <&smp2p_wcss_in 2 0>,
+ <&smp2p_wcss_in 3 0>;
+ interrupt-names = "wdog",
+ "fatal",
+ "ready",
+ "handover",
+ "stop-ack";
+
+ mboxes = <&tmel_qmp 0>;
+ qcom,smem-states = <&smp2p_wcss_out 1>,
+ <&smp2p_wcss_out 0>;
+ qcom,smem-state-names = "stop",
+ "shutdown";
+
+ memory-region = <&q6_region>, <&q6_dtb_region>;
+ qcom,q6-dtb-info = <&tcsr 0x1f004 0x1f008 0x1f00c>;
+
+ status = "okay";
+
+ glink-edge {
+ interrupts = <GIC_SPI 500 IRQ_TYPE_EDGE_RISING>;
+ label = "rtr";
+ qcom,remote-pid = <1>;
+ mboxes = <&apcs_glb 8>;
+ };
+ };
+
timer@f420000 {
compatible = "arm,armv7-timer-mem";
reg = <0 0xf420000 0 0x1000>;
@@ -724,4 +785,28 @@ timer {
<GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
<GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
};
+
+ wcss: smp2p-wcss {
+ compatible = "qcom,smp2p";
+ qcom,smem = <435>, <428>;
+
+ interrupt-parent = <&intc>;
+ interrupts = <GIC_SPI 501 IRQ_TYPE_EDGE_RISING>;
+
+ mboxes = <&apcs_glb 9>;
+
+ qcom,local-pid = <0>;
+ qcom,remote-pid = <1>;
+
+ smp2p_wcss_out: master-kernel {
+ qcom,entry-name = "master-kernel";
+ #qcom,smem-state-cells = <1>;
+ };
+
+ smp2p_wcss_in: slave-kernel {
+ qcom,entry-name = "slave-kernel";
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ };
+ };
};
--
2.34.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH V4 8/8] arm64: dts: qcom: ipq9574: add nodes to bring up q6
2025-04-03 12:02 [PATCH V4 0/8] Add new driver for WCSS secure PIL loading Gokul Sriram Palanisamy
` (6 preceding siblings ...)
2025-04-03 12:03 ` [PATCH V4 7/8] arm64: dts: qcom: ipq5424: add nodes to bring up q6 Gokul Sriram Palanisamy
@ 2025-04-03 12:03 ` Gokul Sriram Palanisamy
2025-04-03 14:51 ` Krzysztof Kozlowski
2025-04-03 14:20 ` [PATCH V4 0/8] Add new driver for WCSS secure PIL loading Krzysztof Kozlowski
2025-04-03 14:35 ` Rob Herring (Arm)
9 siblings, 1 reply; 20+ messages in thread
From: Gokul Sriram Palanisamy @ 2025-04-03 12:03 UTC (permalink / raw)
To: andersson, mathieu.poirier, robh, krzk+dt, conor+dt, konradybcio,
quic_mmanikan, linux-arm-msm, linux-remoteproc, devicetree
Cc: quic_srichara, vignesh.viswanathan, gokul.sriram.p
From: Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
Enable nodes required for q6 remoteproc bring up.
Signed-off-by: Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
Signed-off-by: Gokul Sriram Palanisamy <gokul.sriram.p@oss.qualcomm.com>
---
arch/arm64/boot/dts/qcom/ipq9574.dtsi | 61 ++++++++++++++++++++++++++-
1 file changed, 60 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
index db69bff41afa..11a1849ec50f 100644
--- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
@@ -3,7 +3,7 @@
* IPQ9574 SoC device tree source
*
* Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2023-2024, Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2023-2025, Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <dt-bindings/clock/qcom,apss-ipq.h>
@@ -226,6 +226,11 @@ smem@4aa00000 {
hwlocks = <&tcsr_mutex 3>;
no-map;
};
+
+ q6_region: wcss@4ab00000 {
+ reg = <0x0 0x4ab00000 0x0 0x2b00000>;
+ no-map;
+ };
};
soc: soc@0 {
@@ -1473,6 +1478,36 @@ top_glue-critical {
};
};
};
+
+ q6v5_wcss: remoteproc@cd00000 {
+ compatible = "qcom,ipq9574-wcss-sec-pil";
+ reg = <0x0cd00000 0x4040>;
+ firmware-name = "ath11k/IPQ9574/hw1.0/q6_fw.mbn",
+ "ath11k/IPQ9574/hw1.0/qdsp6sw_dtb.mbn";
+ interrupts-extended = <&intc GIC_SPI 325 IRQ_TYPE_EDGE_RISING>,
+ <&smp2p_wcss_in 0 IRQ_TYPE_NONE>,
+ <&smp2p_wcss_in 1 IRQ_TYPE_NONE>,
+ <&smp2p_wcss_in 2 IRQ_TYPE_NONE>,
+ <&smp2p_wcss_in 3 IRQ_TYPE_NONE>;
+ interrupt-names = "wdog",
+ "fatal",
+ "ready",
+ "handover",
+ "stop-ack";
+
+ qcom,smem-states = <&smp2p_wcss_out 1>,
+ <&smp2p_wcss_out 0>;
+ qcom,smem-state-names = "stop",
+ "shutdown";
+ memory-region = <&q6_region>;
+
+ glink-edge {
+ interrupts = <GIC_SPI 321 IRQ_TYPE_EDGE_RISING>;
+ label = "rtr";
+ qcom,remote-pid = <1>;
+ mboxes = <&apcs_glb 8>;
+ };
+ };
};
timer {
@@ -1482,4 +1517,28 @@ timer {
<GIC_PPI 4 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
<GIC_PPI 1 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
};
+
+ wcss: smp2p-wcss {
+ compatible = "qcom,smp2p";
+ qcom,smem = <435>, <428>;
+
+ interrupt-parent = <&intc>;
+ interrupts = <GIC_SPI 322 IRQ_TYPE_EDGE_RISING>;
+
+ mboxes = <&apcs_glb 9>;
+
+ qcom,local-pid = <0>;
+ qcom,remote-pid = <1>;
+
+ smp2p_wcss_out: master-kernel {
+ qcom,entry-name = "master-kernel";
+ #qcom,smem-state-cells = <1>;
+ };
+
+ smp2p_wcss_in: slave-kernel {
+ qcom,entry-name = "slave-kernel";
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ };
+ };
};
--
2.34.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH V4 0/8] Add new driver for WCSS secure PIL loading
2025-04-03 12:02 [PATCH V4 0/8] Add new driver for WCSS secure PIL loading Gokul Sriram Palanisamy
` (7 preceding siblings ...)
2025-04-03 12:03 ` [PATCH V4 8/8] arm64: dts: qcom: ipq9574: " Gokul Sriram Palanisamy
@ 2025-04-03 14:20 ` Krzysztof Kozlowski
2025-04-03 14:35 ` Rob Herring (Arm)
9 siblings, 0 replies; 20+ messages in thread
From: Krzysztof Kozlowski @ 2025-04-03 14:20 UTC (permalink / raw)
To: Gokul Sriram Palanisamy, andersson, mathieu.poirier, robh,
krzk+dt, conor+dt, konradybcio, quic_mmanikan, linux-arm-msm,
linux-remoteproc, devicetree
Cc: quic_srichara, vignesh.viswanathan
On 03/04/2025 14:02, Gokul Sriram Palanisamy wrote:
> This series depends on Sricharan's tmel-qmp mailbox driver series v4 [1].
>
> - Secure PIL is signed, split firmware images which only TrustZone (TZ)
> can authenticate and load. Linux kernel will send a request to TZ to
> authenticate and load the PIL images.
>
> - When secure PIL support was added to the existing wcss PIL driver
> earlier in [2], Bjorn suggested not to overload the existing WCSS
> rproc driver, instead post a new driver for PAS based IPQ WCSS driver.
> This series adds a new secure PIL driver for the same.
>
> - Also adds changes to scm to pass metadata size as required for IPQ5332,
> reposted from [3].
>
> [1]
> https://patchwork.kernel.org/project/linux-arm-msm/cover/20250327181750.3733881-1-quic_srichara@quicinc.com/
>
> [2]
> https://patchwork.kernel.org/project/linux-arm-msm/patch/1611984013-10201-3-git-send-email-gokulsri@codeaurora.org/
>
> [3]
> https://patchwork.kernel.org/project/linux-arm-msm/patch/20240820055618.267554-6-quic_gokulsri@quicinc.com/
>
> changes in v4:
> - changed q6 firmware image format from .mdt to .mbn
> - corrected arrangement of variable assignemnts as per comments
> in qcom_scm.c
> - added scm call to get board machid
> - added support for q6 dtb loading with support for additional
> reserved memory for q6 dtb in .mbn format
> - updated dt-bindings to include new dts entry qcom,q6-dtb-info
> and additional item in memory-region for q6 dtb region.
This invalidates review.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH V4 2/8] dt-bindings: remoteproc: qcom: document hexagon based WCSS secure PIL
2025-04-03 12:02 ` [PATCH V4 2/8] dt-bindings: remoteproc: qcom: document hexagon based WCSS secure PIL Gokul Sriram Palanisamy
@ 2025-04-03 14:21 ` Krzysztof Kozlowski
2025-04-04 7:08 ` Gokul Sriram P
0 siblings, 1 reply; 20+ messages in thread
From: Krzysztof Kozlowski @ 2025-04-03 14:21 UTC (permalink / raw)
To: Gokul Sriram Palanisamy, andersson, mathieu.poirier, robh,
krzk+dt, conor+dt, konradybcio, quic_mmanikan, linux-arm-msm,
linux-remoteproc, devicetree
Cc: quic_srichara, vignesh.viswanathan
On 03/04/2025 14:02, Gokul Sriram Palanisamy wrote:
> + minItems: 1
> + items:
> + - description: Q6 reserved region
> + - description: Q6 dtb reserved region
> +
> + qcom,q6-dtb-info:
> + $ref: /schemas/types.yaml#/definitions/phandle-array
NAK, you added new properties which invalidates review. You must drop
review after making such significant changes (3 new properties? Several
other changed).
See submitting patches.
Anyway, NAK for the property, you don't get DTB info from DTB.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH V4 7/8] arm64: dts: qcom: ipq5424: add nodes to bring up q6
2025-04-03 12:03 ` [PATCH V4 7/8] arm64: dts: qcom: ipq5424: add nodes to bring up q6 Gokul Sriram Palanisamy
@ 2025-04-03 14:23 ` Krzysztof Kozlowski
0 siblings, 0 replies; 20+ messages in thread
From: Krzysztof Kozlowski @ 2025-04-03 14:23 UTC (permalink / raw)
To: Gokul Sriram Palanisamy, andersson, mathieu.poirier, robh,
krzk+dt, conor+dt, konradybcio, quic_mmanikan, linux-arm-msm,
linux-remoteproc, devicetree
Cc: quic_srichara, vignesh.viswanathan
On 03/04/2025 14:03, Gokul Sriram Palanisamy wrote:
> + "stop-ack";
> +
> + mboxes = <&tmel_qmp 0>;
> + qcom,smem-states = <&smp2p_wcss_out 1>,
> + <&smp2p_wcss_out 0>;
> + qcom,smem-state-names = "stop",
> + "shutdown";
> +
> + memory-region = <&q6_region>, <&q6_dtb_region>;
> + qcom,q6-dtb-info = <&tcsr 0x1f004 0x1f008 0x1f00c>;
> +
> + status = "okay";
How this could appear here? What is happening with this patchset?
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH V4 0/8] Add new driver for WCSS secure PIL loading
2025-04-03 12:02 [PATCH V4 0/8] Add new driver for WCSS secure PIL loading Gokul Sriram Palanisamy
` (8 preceding siblings ...)
2025-04-03 14:20 ` [PATCH V4 0/8] Add new driver for WCSS secure PIL loading Krzysztof Kozlowski
@ 2025-04-03 14:35 ` Rob Herring (Arm)
9 siblings, 0 replies; 20+ messages in thread
From: Rob Herring (Arm) @ 2025-04-03 14:35 UTC (permalink / raw)
To: Gokul Sriram Palanisamy
Cc: krzk+dt, andersson, quic_mmanikan, linux-remoteproc, konradybcio,
vignesh.viswanathan, conor+dt, devicetree, quic_srichara,
mathieu.poirier, linux-arm-msm
On Thu, 03 Apr 2025 17:32:56 +0530, Gokul Sriram Palanisamy wrote:
> This series depends on Sricharan's tmel-qmp mailbox driver series v4 [1].
>
> - Secure PIL is signed, split firmware images which only TrustZone (TZ)
> can authenticate and load. Linux kernel will send a request to TZ to
> authenticate and load the PIL images.
>
> - When secure PIL support was added to the existing wcss PIL driver
> earlier in [2], Bjorn suggested not to overload the existing WCSS
> rproc driver, instead post a new driver for PAS based IPQ WCSS driver.
> This series adds a new secure PIL driver for the same.
>
> - Also adds changes to scm to pass metadata size as required for IPQ5332,
> reposted from [3].
>
> [1]
> https://patchwork.kernel.org/project/linux-arm-msm/cover/20250327181750.3733881-1-quic_srichara@quicinc.com/
>
> [2]
> https://patchwork.kernel.org/project/linux-arm-msm/patch/1611984013-10201-3-git-send-email-gokulsri@codeaurora.org/
>
> [3]
> https://patchwork.kernel.org/project/linux-arm-msm/patch/20240820055618.267554-6-quic_gokulsri@quicinc.com/
>
> changes in v4:
> - changed q6 firmware image format from .mdt to .mbn
> - corrected arrangement of variable assignemnts as per comments
> in qcom_scm.c
> - added scm call to get board machid
> - added support for q6 dtb loading with support for additional
> reserved memory for q6 dtb in .mbn format
> - updated dt-bindings to include new dts entry qcom,q6-dtb-info
> and additional item in memory-region for q6 dtb region.
> - removed unnecessary dependency for QCOM_Q6V5_WCSS_SEC in
> Kconfig
> - removed unwanted header files in qcom_q6v5_wcss_sec.c
> - removed repeated dtb parsing during runtime in qcom_q6v5_wcss_sec.c
> - added required check for using tmelcom, if available. Enabled
> fallback to scm based authentication, if tmelcom is unavailable.
> - added necessary padding for 8digt hex address in dts
>
> Following tests were done:
> - checkpatch
> - kernel-doc
> - dt_binding_check and dtbs_check
>
> changes in v3:
> - fixed copyright years and markings based on Jeff's comments.
> - replaced devm_ioremap_wc() with ioremap_wc() in
> wcss_sec_copy_segment().
> - replaced rproc_alloc() and rproc_add() with their devres
> counterparts.
> - added mailbox call to tmelcom for secure image authentication
> as required for IPQ5424. Added ipq5424 APCS comatible required.
> - added changes to scm call to pass metadata size as equired for
> IPQ5332.
>
> changes in v2:
> - Removed dependency of this series to q6 clock removal series
> as recommended by Krzysztof
>
> Gokul Sriram Palanisamy (3):
> soc: qcom: smem: introduce qcom_smem_get_machid()
> remoteproc: qcom: add support for Q6 device-tree loading
> arm64: dts: qcom: ipq5424: add nodes to bring up q6
>
> Manikanta Mylavarapu (4):
> firmware: qcom_scm: ipq5332: add support to pass metadata size
> dt-bindings: remoteproc: qcom: document hexagon based WCSS secure PIL
> arm64: dts: qcom: ipq5332: add nodes to bringup q6
> arm64: dts: qcom: ipq9574: add nodes to bring up q6
>
> Vignesh Viswanathan (1):
> remoteproc: qcom: add hexagon based WCSS secure PIL driver
>
> .../remoteproc/qcom,wcss-sec-pil.yaml | 146 +++++
> arch/arm64/boot/dts/qcom/ipq5332.dtsi | 71 ++-
> arch/arm64/boot/dts/qcom/ipq5424.dtsi | 87 ++-
> arch/arm64/boot/dts/qcom/ipq9574.dtsi | 61 +-
> drivers/firmware/qcom/qcom_scm.c | 17 +-
> drivers/firmware/qcom/qcom_scm.h | 1 +
> drivers/remoteproc/Kconfig | 19 +
> drivers/remoteproc/Makefile | 1 +
> drivers/remoteproc/qcom_q6v5_wcss_sec.c | 526 ++++++++++++++++++
> drivers/soc/qcom/smem.c | 26 +
> include/linux/remoteproc.h | 2 +
> include/linux/soc/qcom/smem.h | 1 +
> 12 files changed, 951 insertions(+), 7 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/remoteproc/qcom,wcss-sec-pil.yaml
> create mode 100644 drivers/remoteproc/qcom_q6v5_wcss_sec.c
>
> --
> 2.34.1
>
>
>
My bot found new DTB warnings on the .dts files added or changed in this
series.
Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings
are fixed by another series. Ultimately, it is up to the platform
maintainer whether these warnings are acceptable or not. No need to reply
unless the platform maintainer has comments.
If you already ran DT checks and didn't see these error(s), then
make sure dt-schema is up to date:
pip3 install dtschema --upgrade
This patch series was applied (using b4) to base:
Base: attempting to guess base-commit...
Base: tags/next-20250403 (exact match)
If this is not the correct base, please add 'base-commit' tag
(or use b4 which does this automatically)
New warnings running 'make CHECK_DTBS=y for arch/arm64/boot/dts/qcom/' for 20250403120304.2345677-1-gokul.sriram.p@oss.qualcomm.com:
arch/arm64/boot/dts/qcom/ipq9574.dtsi:1484.4-30: Warning (reg_format): /thermal-zones/remoteproc@cd00000:reg: property has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1)
arch/arm64/boot/dts/qcom/ipq9574-rdp454.dtb: Warning (pci_device_reg): Failed prerequisite 'reg_format'
arch/arm64/boot/dts/qcom/ipq9574-rdp454.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
arch/arm64/boot/dts/qcom/ipq9574-rdp454.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'
arch/arm64/boot/dts/qcom/ipq9574-rdp454.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
arch/arm64/boot/dts/qcom/ipq9574.dtsi:1482.33-1510.5: Warning (avoid_default_addr_size): /thermal-zones/remoteproc@cd00000: Relying on default #address-cells value
arch/arm64/boot/dts/qcom/ipq9574.dtsi:1482.33-1510.5: Warning (avoid_default_addr_size): /thermal-zones/remoteproc@cd00000: Relying on default #size-cells value
arch/arm64/boot/dts/qcom/ipq9574-rdp454.dtb: thermal-zones: 'remoteproc@cd00000' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\-]{1,10}-thermal$', 'pinctrl-[0-9]+'
from schema $id: http://devicetree.org/schemas/thermal/thermal-zones.yaml#
arch/arm64/boot/dts/qcom/ipq5424-rdp466.dtb: /soc@0/qmp@32090000: failed to match any schema with compatible: ['qcom,ipq5424-tmel']
arch/arm64/boot/dts/qcom/ipq9574.dtsi:1484.4-30: Warning (reg_format): /thermal-zones/remoteproc@cd00000:reg: property has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1)
arch/arm64/boot/dts/qcom/ipq9574-rdp433.dtb: Warning (pci_device_reg): Failed prerequisite 'reg_format'
arch/arm64/boot/dts/qcom/ipq9574-rdp433.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
arch/arm64/boot/dts/qcom/ipq9574-rdp433.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'
arch/arm64/boot/dts/qcom/ipq9574-rdp433.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
arch/arm64/boot/dts/qcom/ipq9574.dtsi:1482.33-1510.5: Warning (avoid_default_addr_size): /thermal-zones/remoteproc@cd00000: Relying on default #address-cells value
arch/arm64/boot/dts/qcom/ipq9574.dtsi:1482.33-1510.5: Warning (avoid_default_addr_size): /thermal-zones/remoteproc@cd00000: Relying on default #size-cells value
arch/arm64/boot/dts/qcom/ipq9574-rdp433.dtb: thermal-zones: 'remoteproc@cd00000' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\-]{1,10}-thermal$', 'pinctrl-[0-9]+'
from schema $id: http://devicetree.org/schemas/thermal/thermal-zones.yaml#
arch/arm64/boot/dts/qcom/ipq9574.dtsi:1484.4-30: Warning (reg_format): /thermal-zones/remoteproc@cd00000:reg: property has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1)
arch/arm64/boot/dts/qcom/ipq9574-rdp453.dtb: Warning (pci_device_reg): Failed prerequisite 'reg_format'
arch/arm64/boot/dts/qcom/ipq9574-rdp453.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
arch/arm64/boot/dts/qcom/ipq9574-rdp453.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'
arch/arm64/boot/dts/qcom/ipq9574-rdp453.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
arch/arm64/boot/dts/qcom/ipq9574.dtsi:1482.33-1510.5: Warning (avoid_default_addr_size): /thermal-zones/remoteproc@cd00000: Relying on default #address-cells value
arch/arm64/boot/dts/qcom/ipq9574.dtsi:1482.33-1510.5: Warning (avoid_default_addr_size): /thermal-zones/remoteproc@cd00000: Relying on default #size-cells value
arch/arm64/boot/dts/qcom/ipq9574-rdp453.dtb: thermal-zones: 'remoteproc@cd00000' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\-]{1,10}-thermal$', 'pinctrl-[0-9]+'
from schema $id: http://devicetree.org/schemas/thermal/thermal-zones.yaml#
arch/arm64/boot/dts/qcom/ipq9574.dtsi:1484.4-30: Warning (reg_format): /thermal-zones/remoteproc@cd00000:reg: property has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1)
arch/arm64/boot/dts/qcom/ipq9574-rdp449.dtb: Warning (pci_device_reg): Failed prerequisite 'reg_format'
arch/arm64/boot/dts/qcom/ipq9574-rdp449.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
arch/arm64/boot/dts/qcom/ipq9574-rdp449.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'
arch/arm64/boot/dts/qcom/ipq9574-rdp449.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
arch/arm64/boot/dts/qcom/ipq9574.dtsi:1482.33-1510.5: Warning (avoid_default_addr_size): /thermal-zones/remoteproc@cd00000: Relying on default #address-cells value
arch/arm64/boot/dts/qcom/ipq9574.dtsi:1482.33-1510.5: Warning (avoid_default_addr_size): /thermal-zones/remoteproc@cd00000: Relying on default #size-cells value
arch/arm64/boot/dts/qcom/ipq9574-rdp449.dtb: thermal-zones: 'remoteproc@cd00000' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\-]{1,10}-thermal$', 'pinctrl-[0-9]+'
from schema $id: http://devicetree.org/schemas/thermal/thermal-zones.yaml#
arch/arm64/boot/dts/qcom/ipq9574.dtsi:1484.4-30: Warning (reg_format): /thermal-zones/remoteproc@cd00000:reg: property has invalid length (8 bytes) (#address-cells == 2, #size-cells == 1)
arch/arm64/boot/dts/qcom/ipq9574-rdp418.dtb: Warning (pci_device_reg): Failed prerequisite 'reg_format'
arch/arm64/boot/dts/qcom/ipq9574-rdp418.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
arch/arm64/boot/dts/qcom/ipq9574-rdp418.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'
arch/arm64/boot/dts/qcom/ipq9574-rdp418.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
arch/arm64/boot/dts/qcom/ipq9574.dtsi:1482.33-1510.5: Warning (avoid_default_addr_size): /thermal-zones/remoteproc@cd00000: Relying on default #address-cells value
arch/arm64/boot/dts/qcom/ipq9574.dtsi:1482.33-1510.5: Warning (avoid_default_addr_size): /thermal-zones/remoteproc@cd00000: Relying on default #size-cells value
arch/arm64/boot/dts/qcom/ipq9574-rdp418.dtb: thermal-zones: 'remoteproc@cd00000' does not match any of the regexes: '^[a-zA-Z][a-zA-Z0-9\-]{1,10}-thermal$', 'pinctrl-[0-9]+'
from schema $id: http://devicetree.org/schemas/thermal/thermal-zones.yaml#
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH V4 8/8] arm64: dts: qcom: ipq9574: add nodes to bring up q6
2025-04-03 12:03 ` [PATCH V4 8/8] arm64: dts: qcom: ipq9574: " Gokul Sriram Palanisamy
@ 2025-04-03 14:51 ` Krzysztof Kozlowski
2025-04-04 7:18 ` Gokul Sriram P
0 siblings, 1 reply; 20+ messages in thread
From: Krzysztof Kozlowski @ 2025-04-03 14:51 UTC (permalink / raw)
To: Gokul Sriram Palanisamy, andersson, mathieu.poirier, robh,
krzk+dt, conor+dt, konradybcio, quic_mmanikan, linux-arm-msm,
linux-remoteproc, devicetree
Cc: quic_srichara, vignesh.viswanathan
On 03/04/2025 14:03, Gokul Sriram Palanisamy wrote:
> From: Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
>
> Enable nodes required for q6 remoteproc bring up.
>
> Signed-off-by: Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
> Signed-off-by: Gokul Sriram Palanisamy <gokul.sriram.p@oss.qualcomm.com>
> ---
> arch/arm64/boot/dts/qcom/ipq9574.dtsi | 61 ++++++++++++++++++++++++++-
> 1 file changed, 60 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
> index db69bff41afa..11a1849ec50f 100644
> --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi
> +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
> @@ -3,7 +3,7 @@
> * IPQ9574 SoC device tree source
> *
> * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
> - * Copyright (c) 2023-2024, Qualcomm Innovation Center, Inc. All rights reserved.
> + * Copyright (c) 2023-2025, Qualcomm Innovation Center, Inc. All rights reserved.
> */
>
> #include <dt-bindings/clock/qcom,apss-ipq.h>
> @@ -226,6 +226,11 @@ smem@4aa00000 {
> hwlocks = <&tcsr_mutex 3>;
> no-map;
> };
> +
> + q6_region: wcss@4ab00000 {
> + reg = <0x0 0x4ab00000 0x0 0x2b00000>;
> + no-map;
> + };
> };
>
> soc: soc@0 {
> @@ -1473,6 +1478,36 @@ top_glue-critical {
> };
> };
> };
> +
> + q6v5_wcss: remoteproc@cd00000 {
> + compatible = "qcom,ipq9574-wcss-sec-pil";
> + reg = <0x0cd00000 0x4040>;
So this obviously was never built tested :/
I don't understand why bindings and DTS is being changed after half a
year. You got already review and what you sent supposed to be complete.
Now, half a year later, you change both bindings and DTS thus:
1. What was the point of reviewing it that time? I will skip reviewing
next time and wait till your patchsets reach v4 or v8 and review only
then. This is not the first time for IPQ patches. It is actually pattern.
2. How released hardware can change within this timeframe?
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH V4 2/8] dt-bindings: remoteproc: qcom: document hexagon based WCSS secure PIL
2025-04-03 14:21 ` Krzysztof Kozlowski
@ 2025-04-04 7:08 ` Gokul Sriram P
2025-04-14 4:47 ` Gokul Sriram P
0 siblings, 1 reply; 20+ messages in thread
From: Gokul Sriram P @ 2025-04-04 7:08 UTC (permalink / raw)
To: Krzysztof Kozlowski, andersson, mathieu.poirier, robh, krzk+dt,
conor+dt, konradybcio, quic_mmanikan, linux-arm-msm,
linux-remoteproc, devicetree
Cc: quic_srichara, vignesh.viswanathan
On 4/3/2025 7:51 PM, Krzysztof Kozlowski wrote:
> On 03/04/2025 14:02, Gokul Sriram Palanisamy wrote:
>> + minItems: 1
>> + items:
>> + - description: Q6 reserved region
>> + - description: Q6 dtb reserved region
>> +
>> + qcom,q6-dtb-info:
>> + $ref: /schemas/types.yaml#/definitions/phandle-array
> NAK, you added new properties which invalidates review. You must drop
> review after making such significant changes (3 new properties? Several
> other changed).
> See submitting patches.
>
> Anyway, NAK for the property, you don't get DTB info from DTB.
Sorry for the confusion. My bad, this Q6 DTB loading from rproc is a new
topic.
The HW/FW has not changed, will revert.
I will repost V5 with just the comments from V3 addressed and introduce
the changes
required for Q6 DTB in a separate series. Is that fine ?
Regards,
Gokul
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH V4 8/8] arm64: dts: qcom: ipq9574: add nodes to bring up q6
2025-04-03 14:51 ` Krzysztof Kozlowski
@ 2025-04-04 7:18 ` Gokul Sriram P
0 siblings, 0 replies; 20+ messages in thread
From: Gokul Sriram P @ 2025-04-04 7:18 UTC (permalink / raw)
To: Krzysztof Kozlowski, andersson, mathieu.poirier, robh, krzk+dt,
conor+dt, konradybcio, quic_mmanikan, linux-arm-msm,
linux-remoteproc, devicetree
Cc: quic_srichara, vignesh.viswanathan
On 4/3/2025 8:21 PM, Krzysztof Kozlowski wrote:
> On 03/04/2025 14:03, Gokul Sriram Palanisamy wrote:
>> From: Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
>>
>> Enable nodes required for q6 remoteproc bring up.
>>
>> Signed-off-by: Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
>> Signed-off-by: Gokul Sriram Palanisamy <gokul.sriram.p@oss.qualcomm.com>
>> ---
>> arch/arm64/boot/dts/qcom/ipq9574.dtsi | 61 ++++++++++++++++++++++++++-
>> 1 file changed, 60 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
>> index db69bff41afa..11a1849ec50f 100644
>> --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi
>> @@ -3,7 +3,7 @@
>> * IPQ9574 SoC device tree source
>> *
>> * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
>> - * Copyright (c) 2023-2024, Qualcomm Innovation Center, Inc. All rights reserved.
>> + * Copyright (c) 2023-2025, Qualcomm Innovation Center, Inc. All rights reserved.
>> */
>>
>> #include <dt-bindings/clock/qcom,apss-ipq.h>
>> @@ -226,6 +226,11 @@ smem@4aa00000 {
>> hwlocks = <&tcsr_mutex 3>;
>> no-map;
>> };
>> +
>> + q6_region: wcss@4ab00000 {
>> + reg = <0x0 0x4ab00000 0x0 0x2b00000>;
>> + no-map;
>> + };
>> };
>>
>> soc: soc@0 {
>> @@ -1473,6 +1478,36 @@ top_glue-critical {
>> };
>> };
>> };
>> +
>> + q6v5_wcss: remoteproc@cd00000 {
>> + compatible = "qcom,ipq9574-wcss-sec-pil";
>> + reg = <0x0cd00000 0x4040>;
> So this obviously was never built tested :/
>
> I don't understand why bindings and DTS is being changed after half a
> year. You got already review and what you sent supposed to be complete.
> Now, half a year later, you change both bindings and DTS thus:
> 1. What was the point of reviewing it that time? I will skip reviewing
> next time and wait till your patchsets reach v4 or v8 and review only
> then. This is not the first time for IPQ patches. It is actually pattern.
>
> 2. How released hardware can change within this timeframe?
The hardware/firmware hasn't changed. Will keep the Q6 DTB changes
separately outside
this series to make it clear and repost V5.
Regards,
Gokul
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH V4 1/8] firmware: qcom_scm: ipq5332: add support to pass metadata size
2025-04-03 12:02 ` [PATCH V4 1/8] firmware: qcom_scm: ipq5332: add support to pass metadata size Gokul Sriram Palanisamy
@ 2025-04-04 22:41 ` Konrad Dybcio
0 siblings, 0 replies; 20+ messages in thread
From: Konrad Dybcio @ 2025-04-04 22:41 UTC (permalink / raw)
To: Gokul Sriram Palanisamy, andersson, mathieu.poirier, robh,
krzk+dt, conor+dt, konradybcio, quic_mmanikan, linux-arm-msm,
linux-remoteproc, devicetree
Cc: quic_srichara, vignesh.viswanathan
On 4/3/25 2:02 PM, Gokul Sriram Palanisamy wrote:
> From: Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
>
> IPQ5332 security software running under trustzone requires metadata size.
> With new command support added in TrustZone that includes a size parameter,
> pass metadata size as well.
>
> Signed-off-by: Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
> Signed-off-by: Gokul Sriram Palanisamy <gokul.sriram.p@oss.qualcomm.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH V4 4/8] soc: qcom: smem: introduce qcom_smem_get_machid()
2025-04-03 12:03 ` [PATCH V4 4/8] soc: qcom: smem: introduce qcom_smem_get_machid() Gokul Sriram Palanisamy
@ 2025-04-04 22:45 ` Konrad Dybcio
2025-04-07 5:00 ` Gokul Sriram P
0 siblings, 1 reply; 20+ messages in thread
From: Konrad Dybcio @ 2025-04-04 22:45 UTC (permalink / raw)
To: Gokul Sriram Palanisamy, andersson, mathieu.poirier, robh,
krzk+dt, conor+dt, konradybcio, quic_mmanikan, linux-arm-msm,
linux-remoteproc, devicetree
Cc: quic_srichara, vignesh.viswanathan
On 4/3/25 2:03 PM, Gokul Sriram Palanisamy wrote:
> Introduce a helper to return the machid which is used to identify the
> specific board variant derived from the same SoC.
>
> Signed-off-by: Gokul Sriram Palanisamy <gokul.sriram.p@oss.qualcomm.com>
> ---
> drivers/soc/qcom/smem.c | 26 ++++++++++++++++++++++++++
> include/linux/soc/qcom/smem.h | 1 +
> 2 files changed, 27 insertions(+)
>
> diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c
> index 592819701809..327f7358191d 100644
> --- a/drivers/soc/qcom/smem.c
> +++ b/drivers/soc/qcom/smem.c
> @@ -827,6 +827,32 @@ int qcom_smem_get_soc_id(u32 *id)
> }
> EXPORT_SYMBOL_GPL(qcom_smem_get_soc_id);
>
> +/**
> + * qcom_smem_get_machid() - return the machid
> + * @id: On success, we return the machid here.
> + *
> + * generate machid from HW/SW build ID and return it.
> + *
> + * Return: 0 on success, negative errno on failure.
> + */
> +
> +int qcom_smem_get_machid(u32 *id)
> +{
> + struct socinfo *info;
> +
> + info = qcom_smem_get(QCOM_SMEM_HOST_ANY, SMEM_HW_SW_BUILD_ID, NULL);
> + if (IS_ERR(info))
> + return PTR_ERR(info);
> +
> + *id = ((info->hw_plat << 24) |
> + (((info->plat_ver & 0xffff0000) >> 16) << 16) |
> + ((info->plat_ver & 0x0000ffff) << 8) |
> + (info->hw_plat_subtype));
FIELD_PREP + GENMASK, not raw bit ops, please
Is this format specific to this usecase, or is it used more widely?
If the former, it may be better to export these variables separately
and combine them into this specific combination of fields in the
consumer
Konrad
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH V4 4/8] soc: qcom: smem: introduce qcom_smem_get_machid()
2025-04-04 22:45 ` Konrad Dybcio
@ 2025-04-07 5:00 ` Gokul Sriram P
0 siblings, 0 replies; 20+ messages in thread
From: Gokul Sriram P @ 2025-04-07 5:00 UTC (permalink / raw)
To: Konrad Dybcio, andersson, mathieu.poirier, robh, krzk+dt,
conor+dt, konradybcio, quic_mmanikan, linux-arm-msm,
linux-remoteproc, devicetree
Cc: quic_srichara, vignesh.viswanathan
On 4/5/2025 4:15 AM, Konrad Dybcio wrote:
> On 4/3/25 2:03 PM, Gokul Sriram Palanisamy wrote:
>> Introduce a helper to return the machid which is used to identify the
>> specific board variant derived from the same SoC.
>>
>> Signed-off-by: Gokul Sriram Palanisamy <gokul.sriram.p@oss.qualcomm.com>
>> ---
>> drivers/soc/qcom/smem.c | 26 ++++++++++++++++++++++++++
>> include/linux/soc/qcom/smem.h | 1 +
>> 2 files changed, 27 insertions(+)
>>
>> diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c
>> index 592819701809..327f7358191d 100644
>> --- a/drivers/soc/qcom/smem.c
>> +++ b/drivers/soc/qcom/smem.c
>> @@ -827,6 +827,32 @@ int qcom_smem_get_soc_id(u32 *id)
>> }
>> EXPORT_SYMBOL_GPL(qcom_smem_get_soc_id);
>>
>> +/**
>> + * qcom_smem_get_machid() - return the machid
>> + * @id: On success, we return the machid here.
>> + *
>> + * generate machid from HW/SW build ID and return it.
>> + *
>> + * Return: 0 on success, negative errno on failure.
>> + */
>> +
>> +int qcom_smem_get_machid(u32 *id)
>> +{
>> + struct socinfo *info;
>> +
>> + info = qcom_smem_get(QCOM_SMEM_HOST_ANY, SMEM_HW_SW_BUILD_ID, NULL);
>> + if (IS_ERR(info))
>> + return PTR_ERR(info);
>> +
>> + *id = ((info->hw_plat << 24) |
>> + (((info->plat_ver & 0xffff0000) >> 16) << 16) |
>> + ((info->plat_ver & 0x0000ffff) << 8) |
>> + (info->hw_plat_subtype));
> FIELD_PREP + GENMASK, not raw bit ops, please
>
> Is this format specific to this usecase, or is it used more widely?
> If the former, it may be better to export these variables separately
> and combine them into this specific combination of fields in the
> consumer
>
This is specific to this usecase. Will use FIELD_PREP and GENMASK.
Regards,
Gokul
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH V4 2/8] dt-bindings: remoteproc: qcom: document hexagon based WCSS secure PIL
2025-04-04 7:08 ` Gokul Sriram P
@ 2025-04-14 4:47 ` Gokul Sriram P
0 siblings, 0 replies; 20+ messages in thread
From: Gokul Sriram P @ 2025-04-14 4:47 UTC (permalink / raw)
To: Krzysztof Kozlowski, andersson, mathieu.poirier, robh, krzk+dt,
conor+dt, konradybcio, quic_mmanikan, linux-arm-msm,
linux-remoteproc, devicetree
Cc: quic_srichara, vignesh.viswanathan
On 4/4/2025 12:38 PM, Gokul Sriram P wrote:
> On 4/3/2025 7:51 PM, Krzysztof Kozlowski wrote:
>> On 03/04/2025 14:02, Gokul Sriram Palanisamy wrote:
>>> + minItems: 1
>>> + items:
>>> + - description: Q6 reserved region
>>> + - description: Q6 dtb reserved region
>>> +
>>> + qcom,q6-dtb-info:
>>> + $ref: /schemas/types.yaml#/definitions/phandle-array
>> NAK, you added new properties which invalidates review. You must drop
>> review after making such significant changes (3 new properties? Several
>> other changed).
>> See submitting patches.
>>
>> Anyway, NAK for the property, you don't get DTB info from DTB.
> Sorry for the confusion. My bad, this Q6 DTB loading from rproc is a new
> topic.
> The HW/FW has not changed, will revert.
> I will repost V5 with just the comments from V3 addressed and introduce
> the changes
> required for Q6 DTB in a separate series. Is that fine ?
Hi Krzysztof,
while posting v5 with changes to dt-bindings in v4 reverted and retain
it the same as in v3, can I keep your reviewed-by ?
Regards,
Gokul
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2025-04-14 4:47 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-03 12:02 [PATCH V4 0/8] Add new driver for WCSS secure PIL loading Gokul Sriram Palanisamy
2025-04-03 12:02 ` [PATCH V4 1/8] firmware: qcom_scm: ipq5332: add support to pass metadata size Gokul Sriram Palanisamy
2025-04-04 22:41 ` Konrad Dybcio
2025-04-03 12:02 ` [PATCH V4 2/8] dt-bindings: remoteproc: qcom: document hexagon based WCSS secure PIL Gokul Sriram Palanisamy
2025-04-03 14:21 ` Krzysztof Kozlowski
2025-04-04 7:08 ` Gokul Sriram P
2025-04-14 4:47 ` Gokul Sriram P
2025-04-03 12:02 ` [PATCH V4 3/8] remoteproc: qcom: add hexagon based WCSS secure PIL driver Gokul Sriram Palanisamy
2025-04-03 12:03 ` [PATCH V4 4/8] soc: qcom: smem: introduce qcom_smem_get_machid() Gokul Sriram Palanisamy
2025-04-04 22:45 ` Konrad Dybcio
2025-04-07 5:00 ` Gokul Sriram P
2025-04-03 12:03 ` [PATCH V4 5/8] remoteproc: qcom: add support for Q6 device-tree loading Gokul Sriram Palanisamy
2025-04-03 12:03 ` [PATCH V4 6/8] arm64: dts: qcom: ipq5332: add nodes to bringup q6 Gokul Sriram Palanisamy
2025-04-03 12:03 ` [PATCH V4 7/8] arm64: dts: qcom: ipq5424: add nodes to bring up q6 Gokul Sriram Palanisamy
2025-04-03 14:23 ` Krzysztof Kozlowski
2025-04-03 12:03 ` [PATCH V4 8/8] arm64: dts: qcom: ipq9574: " Gokul Sriram Palanisamy
2025-04-03 14:51 ` Krzysztof Kozlowski
2025-04-04 7:18 ` Gokul Sriram P
2025-04-03 14:20 ` [PATCH V4 0/8] Add new driver for WCSS secure PIL loading Krzysztof Kozlowski
2025-04-03 14:35 ` Rob Herring (Arm)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox