* [PATCH v6 0/3] soc: qcom: ice: Enable firmware managed resource
@ 2026-04-30 3:21 Linlin Zhang
2026-04-30 3:21 ` [PATCH v6 1/3] dt-bindings: crypto: qcom,ice: Add sa8255p support Linlin Zhang
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Linlin Zhang @ 2026-04-30 3:21 UTC (permalink / raw)
To: linux-arm-msm, linux-crypto, linux-kernel, ebiggers
Cc: neeraj.soni, gaurav.kashyap, deepti.jaggi, bjorn.andersson,
quic_shazhuss, trilok.soni, konrad.dybcio
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 2394 bytes --]
The Qualcomm automotive SA8255p SoC relies on firmware to configure
platform resources, including clocks, interconnects and TLMM (GPIOs).
These resources are controlled by the driver via SCMI power and
performance protocols.
The SCMI power protocol is used to enable and disable platform
resources, including clocks, interconnect paths, and TLMM, by mapping
resource state transitions to the runtime PM frameworks
resume/suspend callbacks.
In this design, the ICE driver acts as an SCMI client, with clocks and
power domains abstracted and controlled by the SCMI server in firmware.
This implementation depends on pm_runtime_resume_and_get() and
pm_runtime_put_sync(), which are available in the OPP trees
linux-next branch.
v6:
- Protect calling clock API with fw_managed flag in ICE runtime OPS callbacks.
- Link to v5: http://shc-kerarch-hyd:8080/kernel_archive/20260324095703.1306437-1-linlin.zhang@oss.qualcomm.com/T/#t
v5:
- Align the continued argument line under the first argument after left parenthesis.
- Modify the return value in probe function.
- Link to v4: http://shc-kerarch-hyd:8080/kernel_archive/20260318170626.3654744-1-linlin.zhang@oss.qualcomm.com/T/
v4:
- Commit and signed-off by OSS mail id
- Enable runtime PM for ICE dirver
- Add driver data to diffrenciate the clock managed by the firmware or not
- Link to v3: http://shc-kerarch-hyd:8080/kernel_archive/20251107091315.476074-1-quic_linlzhan@quicinc.com/
v3:
- Update the subject of patch 2.
- Update returned type of remvoe function and firmware flag in ICE diver.
- Link to v2: http://shc-kerarch-hyd:8080/kernel_archive/20251104104935.2752144-1-quic_linlzhan@quicinc.com/T/#t
v2:
- Addresssed comments from Badgey
- Make Document binding of ice pass for binding checking.
- Link to v1: http://shc-kerarch-hyd:8080/kernel_archive/20251024050921.3573402-1-quic_linlzhan@quicinc.com/T/#t
Initial version:
- Add fw managed resource abstraction support in ICE driver.
- Add respective compatible and document it's bindings.
Linlin Zhang (3):
dt-bindings: crypto: qcom,ice: Add sa8255p support
soc: qcom: ice: Enable PM runtime for ICE driver
soc: qcom: ice: Add SCMI support for sa8255p based targets
.../crypto/qcom,inline-crypto-engine.yaml | 27 ++++-
drivers/soc/qcom/ice.c | 108 +++++++++++++++---
2 files changed, 115 insertions(+), 20 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v6 1/3] dt-bindings: crypto: qcom,ice: Add sa8255p support
2026-04-30 3:21 [PATCH v6 0/3] soc: qcom: ice: Enable firmware managed resource Linlin Zhang
@ 2026-04-30 3:21 ` Linlin Zhang
2026-04-30 6:13 ` Krzysztof Kozlowski
2026-04-30 3:21 ` [PATCH v6 2/3] soc: qcom: ice: Enable PM runtime for ICE driver Linlin Zhang
2026-04-30 3:21 ` [PATCH v6 3/3] soc: qcom: ice: Add SCMI support for sa8255p based targets Linlin Zhang
2 siblings, 1 reply; 5+ messages in thread
From: Linlin Zhang @ 2026-04-30 3:21 UTC (permalink / raw)
To: linux-arm-msm, linux-crypto, linux-kernel, ebiggers
Cc: neeraj.soni, gaurav.kashyap, deepti.jaggi, bjorn.andersson,
quic_shazhuss, trilok.soni, konrad.dybcio
On sa8255p, resources such as PHY, clocks, regulators, and resets are
managed by remote firmware via the SCMI power protocol. As a result, the
ICE driver cannot directly access clocks and must instead use power-domains
to request resource configuration.
Add the qcom,sa8255p-inline-crypto-engine compatible string and make clocks
optional for platforms that use power-domains instead.
Signed-off-by: Linlin Zhang <linlin.zhang@oss.qualcomm.com>
---
.../crypto/qcom,inline-crypto-engine.yaml | 27 ++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/crypto/qcom,inline-crypto-engine.yaml b/Documentation/devicetree/bindings/crypto/qcom,inline-crypto-engine.yaml
index 061ff718b23d..f90e5da550db 100644
--- a/Documentation/devicetree/bindings/crypto/qcom,inline-crypto-engine.yaml
+++ b/Documentation/devicetree/bindings/crypto/qcom,inline-crypto-engine.yaml
@@ -16,6 +16,7 @@ properties:
- qcom,kaanapali-inline-crypto-engine
- qcom,milos-inline-crypto-engine
- qcom,qcs8300-inline-crypto-engine
+ - qcom,sa8255p-inline-crypto-engine
- qcom,sa8775p-inline-crypto-engine
- qcom,sc7180-inline-crypto-engine
- qcom,sc7280-inline-crypto-engine
@@ -31,10 +32,26 @@ properties:
clocks:
maxItems: 1
+ power-domains:
+ maxItems: 1
+
required:
- compatible
- reg
- - clocks
+
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - qcom,sa8255p-inline-crypto-engine
+ then:
+ required:
+ - power-domains
+ else:
+ required:
+ - clocks
additionalProperties: false
@@ -48,4 +65,12 @@ examples:
reg = <0x01d88000 0x8000>;
clocks = <&gcc GCC_UFS_PHY_ICE_CORE_CLK>;
};
+
+ - |
+ crypto@1d88000 {
+ compatible = "qcom,sa8255p-inline-crypto-engine",
+ "qcom,inline-crypto-engine";
+ reg = <0x01d88000 0x8000>;
+ power-domains = <&scmi26_pd 0>;
+ };
...
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v6 2/3] soc: qcom: ice: Enable PM runtime for ICE driver
2026-04-30 3:21 [PATCH v6 0/3] soc: qcom: ice: Enable firmware managed resource Linlin Zhang
2026-04-30 3:21 ` [PATCH v6 1/3] dt-bindings: crypto: qcom,ice: Add sa8255p support Linlin Zhang
@ 2026-04-30 3:21 ` Linlin Zhang
2026-04-30 3:21 ` [PATCH v6 3/3] soc: qcom: ice: Add SCMI support for sa8255p based targets Linlin Zhang
2 siblings, 0 replies; 5+ messages in thread
From: Linlin Zhang @ 2026-04-30 3:21 UTC (permalink / raw)
To: linux-arm-msm, linux-crypto, linux-kernel, ebiggers
Cc: neeraj.soni, gaurav.kashyap, deepti.jaggi, bjorn.andersson,
quic_shazhuss, trilok.soni, konrad.dybcio
The QCOM ICE driver manages the ICE core clock through direct calls to
clk_prepare_enable() and clk_disable_unprepare(), which limits integration
with platforms that rely on firmware-managed resources or platform-specific
power management mechanisms.
Replace direct clock management with runtime PM support by moving clock
enable and disable into runtime PM callbacks. Use
pm_runtime_resume_and_get() and pm_runtime_put_sync() in qcom_ice_resume()
and qcom_ice_suspend() to drive power state transitions, and enable runtime
PM in qcom_ice_probe().
Reviewed-by: Neeraj Soni <neeraj.soni@oss.qualcomm.com>
Reviewed-by: Deepti Jaggi <deepti.jaggi@oss.qualcomm.com>
Signed-off-by: Linlin Zhang <linlin.zhang@oss.qualcomm.com>
---
drivers/soc/qcom/ice.c | 58 ++++++++++++++++++++++++++++++++++++++----
1 file changed, 53 insertions(+), 5 deletions(-)
diff --git a/drivers/soc/qcom/ice.c b/drivers/soc/qcom/ice.c
index b203bc685cad..6f9d679b530c 100644
--- a/drivers/soc/qcom/ice.c
+++ b/drivers/soc/qcom/ice.c
@@ -16,6 +16,7 @@
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
#include <linux/firmware/qcom/qcom_scm.h>
@@ -310,8 +311,8 @@ int qcom_ice_resume(struct qcom_ice *ice)
struct device *dev = ice->dev;
int err;
- err = clk_prepare_enable(ice->core_clk);
- if (err) {
+ err = pm_runtime_resume_and_get(dev);
+ if (err < 0) {
dev_err(dev, "failed to enable core clock (%d)\n",
err);
return err;
@@ -323,7 +324,7 @@ EXPORT_SYMBOL_GPL(qcom_ice_resume);
int qcom_ice_suspend(struct qcom_ice *ice)
{
- clk_disable_unprepare(ice->core_clk);
+ pm_runtime_put_sync(ice->dev);
ice->hwkm_init_complete = false;
return 0;
@@ -716,24 +717,69 @@ EXPORT_SYMBOL_GPL(devm_of_qcom_ice_get);
static int qcom_ice_probe(struct platform_device *pdev)
{
+ struct device *dev = &pdev->dev;
struct qcom_ice *engine;
void __iomem *base;
+ int ret;
base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(base)) {
- dev_warn(&pdev->dev, "ICE registers not found\n");
+ dev_warn(dev, "ICE registers not found\n");
return PTR_ERR(base);
}
- engine = qcom_ice_create(&pdev->dev, base);
+ engine = qcom_ice_create(dev, base);
if (IS_ERR(engine))
return PTR_ERR(engine);
platform_set_drvdata(pdev, engine);
+ ret = devm_pm_runtime_enable(dev);
+ if (ret) {
+ dev_warn(dev, "Enable runtime PM failed, ret: %d\n", ret);
+ return ret;
+ }
+
+ ret = pm_runtime_resume_and_get(dev);
+ if (ret < 0) {
+ dev_warn(dev, "Runtime PM fails to resume, ret: %d\n", ret);
+ return ret;
+ }
+
return 0;
}
+static void qcom_ice_remove(struct platform_device *pdev)
+{
+ pm_runtime_put_sync(&pdev->dev);
+}
+
+static int ice_runtime_resume(struct device *dev)
+{
+ struct qcom_ice *ice = dev_get_drvdata(dev);
+ int err = 0;
+
+ err = clk_prepare_enable(ice->core_clk);
+ if (err) {
+ dev_err(dev, "failed to enable core clock (%d)\n",
+ err);
+ }
+
+ return err;
+}
+
+static int ice_runtime_suspend(struct device *dev)
+{
+ struct qcom_ice *ice = dev_get_drvdata(dev);
+
+ clk_disable_unprepare(ice->core_clk);
+ return 0;
+}
+
+static const struct dev_pm_ops ice_pm_ops = {
+ SET_RUNTIME_PM_OPS(ice_runtime_suspend, ice_runtime_resume, NULL)
+};
+
static const struct of_device_id qcom_ice_of_match_table[] = {
{ .compatible = "qcom,inline-crypto-engine" },
{ },
@@ -742,8 +788,10 @@ MODULE_DEVICE_TABLE(of, qcom_ice_of_match_table);
static struct platform_driver qcom_ice_driver = {
.probe = qcom_ice_probe,
+ .remove = qcom_ice_remove,
.driver = {
.name = "qcom-ice",
+ .pm = &ice_pm_ops,
.of_match_table = qcom_ice_of_match_table,
},
};
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v6 3/3] soc: qcom: ice: Add SCMI support for sa8255p based targets
2026-04-30 3:21 [PATCH v6 0/3] soc: qcom: ice: Enable firmware managed resource Linlin Zhang
2026-04-30 3:21 ` [PATCH v6 1/3] dt-bindings: crypto: qcom,ice: Add sa8255p support Linlin Zhang
2026-04-30 3:21 ` [PATCH v6 2/3] soc: qcom: ice: Enable PM runtime for ICE driver Linlin Zhang
@ 2026-04-30 3:21 ` Linlin Zhang
2 siblings, 0 replies; 5+ messages in thread
From: Linlin Zhang @ 2026-04-30 3:21 UTC (permalink / raw)
To: linux-arm-msm, linux-crypto, linux-kernel, ebiggers
Cc: neeraj.soni, gaurav.kashyap, deepti.jaggi, bjorn.andersson,
quic_shazhuss, trilok.soni, konrad.dybcio, Deepti Jaggi
The Qualcomm automotive SA8255p SoC relies on firmware to configure
platform resources, including clocks, interconnects and TLMM.
The driver requests resources operations over SCMI using power
and performance protocols.
The SCMI power protocol enables or disables resources like clocks,
interconnect paths, and TLMM (GPIOs) using runtime PM framework APIs,
such as resume/suspend, to control power states(on/off).
The SCMI performance protocol manages ICE clock, with a power domain
set for ICE clock. The driver uses runtime PM framework APIs to
request power on/off status of the clock.
Reviewed-by: Neeraj Soni <neeraj.soni@oss.qualcomm.com>
Reviewed-by: Deepti Jaggi <quic_djaggi@quicinc.com>
Signed-off-by: Linlin Zhang <linlin.zhang@oss.qualcomm.com>
---
drivers/soc/qcom/ice.c | 64 ++++++++++++++++++++++++++++--------------
1 file changed, 43 insertions(+), 21 deletions(-)
diff --git a/drivers/soc/qcom/ice.c b/drivers/soc/qcom/ice.c
index 6f9d679b530c..cf185a6e1973 100644
--- a/drivers/soc/qcom/ice.c
+++ b/drivers/soc/qcom/ice.c
@@ -68,6 +68,10 @@ union crypto_cfg {
};
};
+struct engine_desc {
+ bool fw_managed;
+};
+
/* QCOM ICE HWKM (Hardware Key Manager) registers */
#define HWKM_OFFSET 0x8000
@@ -554,6 +558,7 @@ static struct qcom_ice *qcom_ice_create(struct device *dev,
void __iomem *base)
{
struct qcom_ice *engine;
+ const struct engine_desc *engine_cfg = NULL;
if (!qcom_scm_is_available())
return ERR_PTR(-EPROBE_DEFER);
@@ -570,20 +575,23 @@ static struct qcom_ice *qcom_ice_create(struct device *dev,
engine->dev = dev;
engine->base = base;
- /*
- * Legacy DT binding uses different clk names for each consumer,
- * so lets try those first. If none of those are a match, it means
- * the we only have one clock and it is part of the dedicated DT node.
- * Also, enable the clock before we check what HW version the driver
- * supports.
- */
- engine->core_clk = devm_clk_get_optional_enabled(dev, "ice_core_clk");
- if (!engine->core_clk)
- engine->core_clk = devm_clk_get_optional_enabled(dev, "ice");
- if (!engine->core_clk)
- engine->core_clk = devm_clk_get_enabled(dev, NULL);
- if (IS_ERR(engine->core_clk))
- return ERR_CAST(engine->core_clk);
+ engine_cfg = device_get_match_data(dev);
+ if (!engine_cfg || !engine_cfg->fw_managed) {
+ /*
+ * Legacy DT binding uses different clk names for each consumer,
+ * so lets try those first. If none of those are a match, it means
+ * the we only have one clock and it is part of the dedicated DT node.
+ * Also, enable the clock before we check what HW version the driver
+ * supports.
+ */
+ engine->core_clk = devm_clk_get_optional_enabled(dev, "ice_core_clk");
+ if (!engine->core_clk)
+ engine->core_clk = devm_clk_get_optional_enabled(dev, "ice");
+ if (!engine->core_clk)
+ engine->core_clk = devm_clk_get_enabled(dev, NULL);
+ if (IS_ERR(engine->core_clk))
+ return ERR_CAST(engine->core_clk);
+ }
if (!qcom_ice_check_supported(engine))
return ERR_PTR(-EOPNOTSUPP);
@@ -756,13 +764,17 @@ static void qcom_ice_remove(struct platform_device *pdev)
static int ice_runtime_resume(struct device *dev)
{
- struct qcom_ice *ice = dev_get_drvdata(dev);
+ struct engine_desc *engine_cfg = device_get_match_data(dev);
int err = 0;
- err = clk_prepare_enable(ice->core_clk);
- if (err) {
- dev_err(dev, "failed to enable core clock (%d)\n",
- err);
+ if (!engine_cfg || !engine_cfg->fw_managed) {
+ struct qcom_ice *ice = dev_get_drvdata(dev);
+
+ err = clk_prepare_enable(ice->core_clk);
+ if (err) {
+ dev_err(dev, "failed to enable core clock (%d)\n",
+ err);
+ }
}
return err;
@@ -770,9 +782,14 @@ static int ice_runtime_resume(struct device *dev)
static int ice_runtime_suspend(struct device *dev)
{
- struct qcom_ice *ice = dev_get_drvdata(dev);
+ const struct engine_desc *engine_cfg = device_get_match_data(dev);
+
+ if (!engine_cfg || !engine_cfg->fw_managed) {
+ struct qcom_ice *ice = dev_get_drvdata(dev);
+
+ clk_disable_unprepare(ice->core_clk);
+ }
- clk_disable_unprepare(ice->core_clk);
return 0;
}
@@ -780,8 +797,13 @@ static const struct dev_pm_ops ice_pm_ops = {
SET_RUNTIME_PM_OPS(ice_runtime_suspend, ice_runtime_resume, NULL)
};
+static const struct engine_desc cfg_fw_managed = {
+ .fw_managed = true,
+};
+
static const struct of_device_id qcom_ice_of_match_table[] = {
{ .compatible = "qcom,inline-crypto-engine" },
+ { .compatible = "qcom,sa8255p-inline-crypto-engine", .data = &cfg_fw_managed },
{ },
};
MODULE_DEVICE_TABLE(of, qcom_ice_of_match_table);
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v6 1/3] dt-bindings: crypto: qcom,ice: Add sa8255p support
2026-04-30 3:21 ` [PATCH v6 1/3] dt-bindings: crypto: qcom,ice: Add sa8255p support Linlin Zhang
@ 2026-04-30 6:13 ` Krzysztof Kozlowski
0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2026-04-30 6:13 UTC (permalink / raw)
To: Linlin Zhang, linux-arm-msm, linux-crypto, linux-kernel, ebiggers
Cc: neeraj.soni, gaurav.kashyap, deepti.jaggi, bjorn.andersson,
quic_shazhuss, trilok.soni, konrad.dybcio
On 30/04/2026 05:21, Linlin Zhang wrote:
> On sa8255p, resources such as PHY, clocks, regulators, and resets are
> managed by remote firmware via the SCMI power protocol. As a result, the
> ICE driver cannot directly access clocks and must instead use power-domains
> to request resource configuration.
>
> Add the qcom,sa8255p-inline-crypto-engine compatible string and make clocks
> optional for platforms that use power-domains instead.
Please use scripts/get_maintainers.pl to get a list of necessary people
and lists to CC. It might happen, that command when run on an older
kernel, gives you outdated entries. Therefore please be sure you base
your patches on recent Linux kernel.
Tools like b4 or scripts/get_maintainer.pl provide you proper list of
people, so fix your workflow. Tools might also fail if you work on some
ancient tree (don't, instead use mainline) or work on fork of kernel
(don't, instead use mainline). Just use b4 and everything should be
fine, although remember about `b4 prep --auto-to-cc` if you added new
patches to the patchset.
You missed at least devicetree list (maybe more), so this won't be
tested by automated tooling. Performing review on untested code might be
a waste of time.
Please kindly resend and include all necessary To/Cc entries.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-04-30 6:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-30 3:21 [PATCH v6 0/3] soc: qcom: ice: Enable firmware managed resource Linlin Zhang
2026-04-30 3:21 ` [PATCH v6 1/3] dt-bindings: crypto: qcom,ice: Add sa8255p support Linlin Zhang
2026-04-30 6:13 ` Krzysztof Kozlowski
2026-04-30 3:21 ` [PATCH v6 2/3] soc: qcom: ice: Enable PM runtime for ICE driver Linlin Zhang
2026-04-30 3:21 ` [PATCH v6 3/3] soc: qcom: ice: Add SCMI support for sa8255p based targets Linlin Zhang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox